From bdbbe6f6427bcd2172c1cb0088254e5d49331799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Wed, 11 Aug 2021 15:03:49 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E9=99=90=E5=88=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=87=AD=E8=AF=81=E5=9B=BE=E7=89=87=E7=9A=84?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/purchase/detail.vue | 21 +++++++++++++++++++-- supplier/pages/gonghuo/detail.vue | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/canteen/pages/purchase/detail.vue b/canteen/pages/purchase/detail.vue index 0779ab3..f3f492f 100644 --- a/canteen/pages/purchase/detail.vue +++ b/canteen/pages/purchase/detail.vue @@ -268,8 +268,25 @@ uni.chooseImage({ count: current_count, complete: result => { - this.voucher_list.push(...result.tempFilePaths); - console.log(this.voucher_list) + let tempFiles = result.tempFiles; + let voucher_list = []; + let overstep = false; + tempFiles.map(item => { + // 上传的图片需小于10MB + if(item.size < 10464788){ + voucher_list.push(item.path); + }else{ + overstep = true; + } + }) + if(overstep){ + uni.showModal({ + title: '温馨提示', + content: '您上传的图片含有超出10M大小的限制,请优化大小后再上传!', + showCancel: false + }) + } + this.voucher_list.push(...voucher_list); } }) }, diff --git a/supplier/pages/gonghuo/detail.vue b/supplier/pages/gonghuo/detail.vue index c2edd59..23f9ace 100644 --- a/supplier/pages/gonghuo/detail.vue +++ b/supplier/pages/gonghuo/detail.vue @@ -276,7 +276,25 @@ uni.chooseImage({ count: current_count, complete: result => { - this.voucher_list.push(...result.tempFilePaths); + let tempFiles = result.tempFiles; + let voucher_list = []; + let overstep = false; + tempFiles.map(item => { + // 上传的图片需小于10MB + if(item.size < 10464788){ + voucher_list.push(item.path); + }else{ + overstep = true; + } + }) + if(overstep){ + uni.showModal({ + title: '温馨提示', + content: '您上传的图片含有超出10M大小的限制,请优化大小后再上传!', + showCancel: false + }) + } + this.voucher_list.push(...voucher_list); } }) },