From 345127c68c6fb9c8abe606fb52d20ca5c5535f05 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 7 Mar 2023 09:00:43 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=95=B4=E6=88=90=E7=9A=84=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=A1=B9=E4=B8=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../troubleshooting/shootingForm/index.js | 18 +++++++++--------- .../troubleshooting/shootingForm/index.wxml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/weapp/package/troubleshooting/shootingForm/index.js b/weapp/package/troubleshooting/shootingForm/index.js index aa54940..cd18784 100644 --- a/weapp/package/troubleshooting/shootingForm/index.js +++ b/weapp/package/troubleshooting/shootingForm/index.js @@ -228,15 +228,15 @@ Page({ return; } wx.chooseMedia({ - count: 20, // 基础库2.25.0前,最多可支持9个文件,2.25.0及以后最多可支持20个文件 + count: 20, // 基础库2.25.0前,最多可支持9个文件,2.25.0及以后最多可支持20个文件 mediaType: ['image'], // 文件类型 - sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 - sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 + sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认二者都有 + sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认二者都有 success: function (res) { const imgs = res.tempFiles; for (let i = 0; i < imgs.length; i++) { if (res.tempFiles[i].size > 15728640) { - wx.showToast({ title: '图片大于15M,不可上传', icon: 'none' }); + wx.showToast({ title: '图片大于15M,不可上传', icon: 'none' }); return; } const fileNameArr = res.tempFiles[i].tempFilePath.split('.'); @@ -273,7 +273,7 @@ Page({ success: (resp) => { wx.hideLoading(); success++; - let str = JSON.parse(resp.data) // 返回的结果,可能不同项目结果不一样 + let str = JSON.parse(resp.data) // 返回的结果,可能不同项目结果不一样 str = str.uploaded if (imgs.length >= 20) { return false; @@ -291,14 +291,14 @@ Page({ }, complete: () => { i++; - if (i == data.path.length) { // 当图片传完时,停止调用 + if (i == data.path.length) { // 当图片传完时,停止调用 console.log('执行完毕'); - console.log('成功:' + success + " 失败:" + fail); - } else { // 若图片还没有传完,则继续调用函数 + console.log('成功:' + success + " 失败:" + fail); + } else { // 若图片还没有传完,则继续调用函数 data.i = i; data.success = success; data.fail = fail; - that.uploadimg(data, itemName); // 递归,回调自己 + that.uploadimg(data, itemName); // 递归,回调自己 } } }); diff --git a/weapp/package/troubleshooting/shootingForm/index.wxml b/weapp/package/troubleshooting/shootingForm/index.wxml index a58ff4e..b11402e 100644 --- a/weapp/package/troubleshooting/shootingForm/index.wxml +++ b/weapp/package/troubleshooting/shootingForm/index.wxml @@ -14,7 +14,7 @@ - +