diff --git a/pages/my/certification.vue b/pages/my/certification.vue index 5885499..f1f5a14 100644 --- a/pages/my/certification.vue +++ b/pages/my/certification.vue @@ -710,11 +710,10 @@ mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 - success: (res) => { - console.log(res) + success: (res) => { // 上传图片 - res.tempFilePaths.forEach((tmpPath) => { - this.$request.uploadFile(tmpPath).then((url) => { + res.tempFiles.forEach((fileObj) => { + this.$request.uploadFile(fileObj.tempFilePath).then((url) => { // 存入缓存 imgList.push(url); }); diff --git a/pages/my/master-occupancy.vue b/pages/my/master-occupancy.vue index 057d572..5471f8b 100644 --- a/pages/my/master-occupancy.vue +++ b/pages/my/master-occupancy.vue @@ -531,14 +531,15 @@ this.specialSkill[index].insurEndDate = e[1]; }, async chooseImage(e, imgList) { - uni.chooseImage({ - count: 1, //默认9 + uni.chooseMedia({ + count: 1, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { // 上传图片 - res.tempFilePaths.forEach((tmpPath) => { - this.$request.uploadFile(tmpPath).then((url) => { + res.tempFiles.forEach((fileObj) => { + this.$request.uploadFile(fileObj.tempFilePath).then((url) => { // 存入缓存 imgList.push(url); }); diff --git a/pages/my/new-serv.vue b/pages/my/new-serv.vue index 7c93193..5130fe6 100644 --- a/pages/my/new-serv.vue +++ b/pages/my/new-serv.vue @@ -744,13 +744,14 @@ chooseImgList(e, imgListField, cropWidth, cropHeight) { this.cropWidth = cropWidth && cropWidth > 0 ? cropWidth : this.sysInfo.windowWidth * 2; this.cropHeight = cropHeight && cropHeight > 0 ? cropHeight : this.sysInfo.windowWidth * 2 * 1.15; - uni.chooseImage({ - count: 1, //默认9 + uni.chooseMedia({ + count: 1, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { - res.tempFilePaths.forEach((tmpUrl, index) => { - this.url2Crop = tmpUrl; + res.tempFiles.forEach((fileObj, index) => { + this.url2Crop = fileObj.tempFilePath; this.curImgListField = imgListField; }); } @@ -773,8 +774,9 @@ this.url2Crop = ""; }, chooseImgNoCrop(e, imgListField) { - uni.chooseImage({ - count: 9, //默认9 + uni.chooseMedia({ + count: 9, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { @@ -782,10 +784,10 @@ title: '上传中', mask: true }); - res.tempFilePaths.forEach((tmpUrl, index) => { - this.$request.uploadFile(tmpUrl).then((url) => { + res.tempFiles.forEach((fileObj, index) => { + this.$request.uploadFile(fileObj.tempFilePath).then((url) => { this.formData[imgListField].push(url); - if (index === res.tempFilePaths.length - 1) { + if (index === res.tempFiles.length - 1) { uni.hideLoading(); } }); diff --git a/pages/my/withdraw.vue b/pages/my/withdraw.vue index fcbf6c4..54cd665 100644 --- a/pages/my/withdraw.vue +++ b/pages/my/withdraw.vue @@ -108,15 +108,20 @@ }) }, chooseImage(e) { - uni.chooseImage({ + uni.chooseMedia({ count: 9, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { + let tempFilePaths = []; + res.tempFiles.forEach((fileObj) => { + tempFilePaths.push(fileObj.tempFilePath) + }) if (this.imgList.length != 0) { - this.imgList = this.imgList.concat(res.tempFilePaths) + this.imgList = this.imgList.concat(tempFilePaths) } else { - this.imgList = res.tempFilePaths + this.imgList = tempFilePaths } } }); diff --git a/pages/order-manage/cancel-order.vue b/pages/order-manage/cancel-order.vue index 7501210..571dae0 100644 --- a/pages/order-manage/cancel-order.vue +++ b/pages/order-manage/cancel-order.vue @@ -99,15 +99,20 @@ }, methods: { chooseImgList(e) { - uni.chooseImage({ + uni.chooseMedia({ count: 9, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { + let tempFilePaths = []; + res.tempFiles.forEach((fileObj) => { + tempFilePaths.push(fileObj.tempFilePath) + }) if (this.formData.imgList.length != 0) { - this.formData.imgList = this.formData.imgList.concat(res.tempFilePaths) + this.formData.imgList = this.formData.imgList.concat(tempFilePaths) } else { - this.formData.imgList = res.tempFilePaths + this.formData.imgList = tempFilePaths } } }); diff --git a/pages/order-manage/finish-order.vue b/pages/order-manage/finish-order.vue index 62401fd..d277d29 100644 --- a/pages/order-manage/finish-order.vue +++ b/pages/order-manage/finish-order.vue @@ -96,8 +96,9 @@ this.order = orderInfo; }, chooseImgList(e, imgList) { - uni.chooseImage({ + uni.chooseMedia({ count: 12 - imgList.length, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { @@ -105,10 +106,10 @@ title: '上传中', mask: true }); - res.tempFilePaths.forEach((tmpUrl, index) => { - this.$request.uploadFile(tmpUrl).then((url) => { + res.tempFiles.forEach((fileObj, index) => { + this.$request.uploadFile(fileObj.tempFilePath).then((url) => { imgList.push(url); - if (index === res.tempFilePaths.length - 1) { + if (index === res.tempFiles.length - 1) { uni.hideLoading(); } }); diff --git a/pages/order-manage/modal/reject-after-sale.vue b/pages/order-manage/modal/reject-after-sale.vue index dc60568..f2b554e 100644 --- a/pages/order-manage/modal/reject-after-sale.vue +++ b/pages/order-manage/modal/reject-after-sale.vue @@ -91,8 +91,9 @@ this.reasonType = e.detail.value; }, chooseImgList(e, imgList) { - uni.chooseImage({ + uni.chooseMedia({ count: 3 - imgList.length, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { @@ -100,10 +101,10 @@ title: '上传中', mask: true }); - res.tempFilePaths.forEach((tmpUrl, index) => { - this.$request.uploadFile(tmpUrl).then((url) => { + res.tempFiles.forEach((fileObj, index) => { + this.$request.uploadFile(fileObj.tempFilePath).then((url) => { imgList.push(url); - if (index === res.tempFilePaths.length - 1) { + if (index === res.tempFiles.length - 1) { uni.hideLoading(); } }); diff --git a/pages/order-manage/modal/time-arrange-fail.vue b/pages/order-manage/modal/time-arrange-fail.vue index 358a3bd..a6cea29 100644 --- a/pages/order-manage/modal/time-arrange-fail.vue +++ b/pages/order-manage/modal/time-arrange-fail.vue @@ -79,15 +79,20 @@ uni.$emit(this.$globalFun.HIDE_MODAL, e); }, chooseImage(e) { - uni.chooseImage({ - count: 1, //默认9 + uni.chooseMedia({ + count: 1, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 - success: (res) => { + success: (res) => { + let tempFilePaths = []; + res.tempFiles.forEach((fileObj) => { + tempFilePaths.push(fileObj.tempFilePath) + }) if (this.imgList.length != 0) { - this.imgList = this.imgList.concat(res.tempFilePaths) + this.imgList = this.imgList.concat(tempFilePaths) } else { - this.imgList = res.tempFilePaths + this.imgList = tempFilePaths } } }); diff --git a/pages/order-manage/modal/urgent-msg.vue b/pages/order-manage/modal/urgent-msg.vue index aafd427..e24dc0a 100644 --- a/pages/order-manage/modal/urgent-msg.vue +++ b/pages/order-manage/modal/urgent-msg.vue @@ -73,15 +73,20 @@ this.toWho = toWho; }, chooseImgList(e) { - uni.chooseImage({ + uni.chooseMedia({ count: 9, //默认9 + mediaType: ['image'], sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { + let tempFilePaths = []; + res.tempFiles.forEach((fileObj) => { + tempFilePaths.push(fileObj.tempFilePath); + }) if (this.imgList.length != 0) { - this.imgList = this.imgList.concat(res.tempFilePaths) + this.imgList = this.imgList.concat(tempFilePaths) } else { - this.imgList = res.tempFilePaths + this.imgList = tempFilePaths } } });