From 99dfeb5fc86bce593a5d3f43f45c26eedc00ab0a Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 10 九月 2024 16:28:54 +0800 Subject: [PATCH] bug --- packageBookService/pages/bookServices/detail/index.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 53 insertions(+), 3 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 99d3595..8d73b89 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -169,6 +169,37 @@ 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, @@ -2647,9 +2678,24 @@ '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) { @@ -2690,6 +2736,7 @@ 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) { @@ -2700,6 +2747,8 @@ medioType = '璧勬簮鍖�' } else if (pictureData.indexOf(Extension) > -1) { medioType = '鍥剧墖' + } else if (documentData.indexOf(Extension) > -1) { + medioType = '鏂囨。' } else { medioType = '鍏朵粬' } @@ -2743,6 +2792,7 @@ that.setData({ "resourceInfo.resourceName": FileName, "resourceInfo.fileType": medioType, + fileList: file, isShowUp: false }) @@ -2772,7 +2822,7 @@ if (this.data.resourceInfo.fileType == '') { return wx.showToast({ icon: "error", - title: "璇峰~鍐欒祫婧愮被鍨�", + title: "璇烽�夋嫨璧勬簮绫诲瀷", }); } -- Gitblit v1.9.1