From 1ef7d4d8f04fdfa8a930936f85e8be0fae22eb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=B2=A9?= Date: Wed, 25 Jun 2025 21:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E5=AE=8C=EF=BC=8C=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=BC=80=E5=8F=91=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../picture-upload/picture-upload.vue | 243 ++++++++++++++---- src/pages/courseDetail/components/comment.vue | 30 ++- src/pages/courseDetail/index.vue | 2 +- src/pages/courseDetail/submit.vue | 55 ++-- src/vite.config.js | 1 - 5 files changed, 241 insertions(+), 90 deletions(-) diff --git a/src/components/picture-upload/picture-upload.vue b/src/components/picture-upload/picture-upload.vue index 2e226b39..ee23a749 100644 --- a/src/components/picture-upload/picture-upload.vue +++ b/src/components/picture-upload/picture-upload.vue @@ -1,67 +1,196 @@ \ No newline at end of file + // 方法 + const upload = () => { + uni.chooseImage({ + count: props.limit, + sizeType: ['original', 'compressed'], + sourceType: ['camera', 'album'], + success: async ({ + tempFilePaths + }) => { + const data = { + bizScen: 'S3005' + } + const upload_map = tempFilePaths.map((file) => uploadFile(file, data)) + Promise.all(upload_map).then(res => { + fileList.push(...res) + emits('update:modelValue', fileList.map(res => res.fileId)) + console.log('res, res', res); + }).catch(() => { + + }) + + // for (file of tempFilePaths) { + // try { + // const res = await uploadFile(file, data) + // console.log('res', res); + // fileList.push(res) + // } catch (error) { + // console.error('文件上传失败', error) + // } + // } + // emits('upload_success', fileList.value) + } + }) + } + + \ No newline at end of file diff --git a/src/pages/courseDetail/components/comment.vue b/src/pages/courseDetail/components/comment.vue index bf4a901e..ff16c150 100644 --- a/src/pages/courseDetail/components/comment.vue +++ b/src/pages/courseDetail/components/comment.vue @@ -15,8 +15,9 @@ {{item.bbsContent}} - - + azf + + {{item.bbsTm.substr(0,16)}} @@ -74,7 +75,7 @@ 发布评价 + @click="common.navigateTo('/pages/courseDetail/submit?crsNum='+props.crsNum+'&imgId='+props.imgId)">发布评价 @@ -124,7 +125,8 @@ }) const props = defineProps({ - crsNum: String + crsNum: String, + imgId: String }) const click_reply = ({ userName, @@ -171,6 +173,24 @@