|
|
@ -17,6 +17,7 @@ Page({ |
|
|
|
remark: '', |
|
|
|
return_suess: false, |
|
|
|
order: {}, |
|
|
|
imgIndex: 0, |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@ -80,20 +81,43 @@ Page({ |
|
|
|
} else { |
|
|
|
images = tempFiles; |
|
|
|
} |
|
|
|
wx.uploadFile({ |
|
|
|
url: 'https://mall.gylservice.com/gw?api=resources.file.uploadFiles', |
|
|
|
filePath: images[that.data.imgIndex].tempFilePath, |
|
|
|
name: 'image', |
|
|
|
header: { |
|
|
|
'content-type': 'multipart/form-data' |
|
|
|
}, // 设置请求的 header
|
|
|
|
formData: { |
|
|
|
accessId: app.globalData.accessId, |
|
|
|
storeId: 239, |
|
|
|
storeType: 1, |
|
|
|
uploadType: 2, |
|
|
|
}, // HTTP 请求中其他额外的 form data
|
|
|
|
success: function (res) { |
|
|
|
that.data.imgIndex++ |
|
|
|
console.log(that.data.imgIndex) |
|
|
|
var data = JSON.parse(res.data) |
|
|
|
// console.log(data)
|
|
|
|
var resList = that.data.srcList |
|
|
|
resList.push(data.data.imgUrls[0]) |
|
|
|
that.setData({ |
|
|
|
srcList: images, |
|
|
|
srcList: resList, |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteAct: function (e) { |
|
|
|
var index = e.currentTarget.dataset.index; |
|
|
|
var that = this; |
|
|
|
that.data.imgIndex-- |
|
|
|
if (that.data.srcList.length > 0) { |
|
|
|
that.data.srcList.splice(index, 1) |
|
|
|
that.setData({ |
|
|
|
srcList: that.data.srcList |
|
|
|
srcList: that.data.srcList, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
return; |
|
|
@ -110,7 +134,14 @@ Page({ |
|
|
|
}, |
|
|
|
confirmAct() { |
|
|
|
var that = this |
|
|
|
if (that.data.srcList.length == 0) { |
|
|
|
if (!that.data.errordesc) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请输入退款说明', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
WXAPI.returnData({ |
|
|
|
accessId: app.globalData.accessId, |
|
|
|
storeId: 239, |
|
|
@ -120,6 +151,7 @@ Page({ |
|
|
|
explain: that.data.remark, |
|
|
|
type: that.data.refund_type, |
|
|
|
refund_apply_money: that.data.re_price, |
|
|
|
images: that.data.srcList |
|
|
|
}).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
var data = res.data |
|
|
@ -129,39 +161,6 @@ Page({ |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.uploadFile({ |
|
|
|
url: 'https://mall.gylservice.com/gw?api=app.order.ReturnData', |
|
|
|
filePath: that.data.srcList[0].tempFilePath, |
|
|
|
name: 'file', |
|
|
|
header: { |
|
|
|
'content-type': 'multipart/form-data' |
|
|
|
}, // 设置请求的 header
|
|
|
|
formData: { |
|
|
|
accessId: app.globalData.accessId, |
|
|
|
storeId: 239, |
|
|
|
storeType: 1, |
|
|
|
order_details_id: that.data.orderId, |
|
|
|
refund_amount: that.data.refund_price, |
|
|
|
explain: that.data.remark, |
|
|
|
type: that.data.refund_type, |
|
|
|
upload_z_num: 1, |
|
|
|
upload_num: 0, |
|
|
|
refund_apply_money: that.data.re_price, |
|
|
|
}, // HTTP 请求中其他额外的 form data
|
|
|
|
success: function (res) { |
|
|
|
var data = JSON.parse(res.data) |
|
|
|
console.log(that.data.srcList); |
|
|
|
that.setData({ |
|
|
|
return_suess: true, |
|
|
|
order: data.data, |
|
|
|
}); |
|
|
|
}, |
|
|
|
fail: function (res) { |
|
|
|
console.log(res); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|