修复缺陷

This commit is contained in:
duxp 2023-10-17 09:42:53 +08:00
parent 85f5e5625c
commit 1a83a9d0e2
2 changed files with 10 additions and 9 deletions

View File

@ -74,11 +74,5 @@
"selectedIconPath": "/asset/img/my.png" "selectedIconPath": "/asset/img/my.png"
} }
] ]
},
"plugins": {
"echarts": {
"version": "2.1.1",
"provider": "wx1db9e5ab1149ea03"
}
} }
} }

View File

@ -124,7 +124,14 @@ Page({
//上传之前 //上传之前
handleBeforeUpload(e){ handleBeforeUpload(e){
const { file, callback } = e.detail; const { file, callback } = e.detail;
if(file.url.indexOf('.jpg') > -1 || file.url.indexOf('.png') > -1 || file.url.indexOf('.pdf') > -1 || if(file.size > 52428800){
wx.showToast({
title:'文件大小不能大于50MB',
duration:2000,
icon:'none'
})
callback(false);
}else if(file.url.indexOf('.jpg') > -1 || file.url.indexOf('.png') > -1 || file.url.indexOf('.pdf') > -1 ||
file.url.indexOf('.jpg') > -1 || file.url.indexOf(".doc")>-1 || file.url.indexOf(".docx")>-1 || file.url.indexOf(".xlsx")>-1 || file.url.indexOf('.jpg') > -1 || file.url.indexOf(".doc")>-1 || file.url.indexOf(".docx")>-1 || file.url.indexOf(".xlsx")>-1 ||
file.url.indexOf(".xls")>-1){ file.url.indexOf(".xls")>-1){
callback(true); callback(true);
@ -162,13 +169,13 @@ Page({
success(res){ success(res){
let _isUpload = false; let _isUpload = false;
res.tempFiles.forEach(item => { res.tempFiles.forEach(item => {
if(item.size > 10485760){ if(item.size > 52428800){
_isUpload = true; _isUpload = true;
} }
}); });
if(_isUpload){ if(_isUpload){
wx.showToast({ wx.showToast({
title:'图片或视频不能大于10MB', title:'图片或视频不能大于50MB',
icon:'none', icon:'none',
duration:1500 duration:1500
}) })