1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| submitRefundApplyHandle(){ let formObj = deepCopy(this.refundApplyForm) formObj.reasonType = this.transf_reasonType[formObj.reasonType] this.applyRefundHandle(formObj) }, applyRefundHandle(formObj){ console.log('提交的表单:', formObj,this.fileList) const arr_temp = [] this.fileList.forEach((item,index) => { arr_temp.push({name:'image'+index,uri: item.url}) }) let requestLength = 0 const annexFileIds = [] arr_temp.forEach((ele,index) => { refundApi.uploadRefundAnnexFile(arr_temp[index], 'file').then(res => { const response = JSON.parse(res) console.log('上传照片结果:',response) if (response.code === 200) { ++requestLength annexFileIds.push(response.data) if(requestLength===arr_temp.length){ formObj.annexFileIds = annexFileIds.join() refundApi.createRefundApply(formObj).then(res => { console.log('提交申请结果:',res) if (res.code === 200) { uni.reLaunch({ url: '/pages/my/refundApply/refundResult?pageMsg=申请成功,请等待人员审核' }); } else { uni.showToast({ title: res.msg, icon: 'none', duration: 5000, }) } }) } } else {
} }) })
},
deletePic(event) { this.fileList.splice(event.index, 1) }, afterRead(event) { console.log('照片地址:', event) let lists = [].concat(event.file) let fileListLen = this.fileList.length lists.map((item) => { this.fileList.push({ ...item, status: 'uploading', message: '上传中' }) }) for (let i = 0; i < lists.length; i++) { const url = lists[i].url let item = this.fileList[fileListLen] this.fileList.splice(fileListLen, 1, Object.assign(item, { status: 'success', message: '', url: url })) fileListLen++ } },
|