| | |
| | | description: '', |
| | | agree: false |
| | | }, |
| | | resourceVisible: false, |
| | | resourceValue: [], |
| | | fileTypeList: [{ |
| | | label: '音频', |
| | | value: '音频' |
| | | }, |
| | | { |
| | | label: '视频', |
| | | value: '视频' |
| | | }, |
| | | { |
| | | label: '图片', |
| | | value: '图片' |
| | | }, |
| | | { |
| | | label: 'PDF', |
| | | value: 'PDF' |
| | | }, |
| | | { |
| | | label: '资源包', |
| | | value: '资源包' |
| | | }, |
| | | { |
| | | label: '文档', |
| | | value: '文档' |
| | | }, |
| | | { |
| | | label: '其他', |
| | | value: '其他' |
| | | } |
| | | ], |
| | | fileList: [], |
| | | isShowUp: true, |
| | | protocolShow: false, |
| | |
| | | 'resourceInfo.resourceName': e.detail.value, |
| | | }); |
| | | }, |
| | | onFileTypeInput(e) { |
| | | onResourcePicker(e) { |
| | | this.setData({ |
| | | 'resourceInfo.fileType': e.detail.value, |
| | | resourceVisible: true, |
| | | }); |
| | | }, |
| | | onPickerChange(e) { |
| | | const { |
| | | value |
| | | } = e.detail; |
| | | this.setData({ |
| | | resourceVisible: false, |
| | | resourceValue: value, |
| | | 'resourceInfo.fileType': value.join(' '), |
| | | }); |
| | | }, |
| | | onPickerCancel(e) { |
| | | this.setData({ |
| | | resourceVisible: false, |
| | | }); |
| | | }, |
| | | textareaChange(e) { |
| | |
| | | const pdfData = ['pdf'] |
| | | const Compression = ['rar', 'zip'] |
| | | const pictureData = ['jpg', 'png'] |
| | | const documentData = ['doc', 'docx', 'xls', 'xlsx', "ppt", "pptx"] |
| | | if (audioData.indexOf(Extension) > -1) { |
| | | medioType = '音频' |
| | | } else if (videoData.indexOf(Extension) > -1) { |
| | |
| | | medioType = '资源包' |
| | | } else if (pictureData.indexOf(Extension) > -1) { |
| | | medioType = '图片' |
| | | } else if (documentData.indexOf(Extension) > -1) { |
| | | medioType = '文档' |
| | | } else { |
| | | medioType = '其他' |
| | | } |
| | |
| | | that.setData({ |
| | | "resourceInfo.resourceName": FileName, |
| | | "resourceInfo.fileType": medioType, |
| | | |
| | | fileList: file, |
| | | isShowUp: false |
| | | }) |
| | |
| | | if (this.data.resourceInfo.fileType == '') { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: "请填写资源类型", |
| | | title: "请选择资源类型", |
| | | }); |
| | | } |
| | | |