|
@ -17,6 +17,7 @@ Page({ |
|
|
remark: '', |
|
|
remark: '', |
|
|
return_suess: false, |
|
|
return_suess: false, |
|
|
order: {}, |
|
|
order: {}, |
|
|
|
|
|
imgIndex: 0, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -80,20 +81,43 @@ Page({ |
|
|
} else { |
|
|
} else { |
|
|
images = tempFiles; |
|
|
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({ |
|
|
that.setData({ |
|
|
srcList: images, |
|
|
srcList: resList, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
deleteAct: function (e) { |
|
|
deleteAct: function (e) { |
|
|
var index = e.currentTarget.dataset.index; |
|
|
var index = e.currentTarget.dataset.index; |
|
|
var that = this; |
|
|
var that = this; |
|
|
|
|
|
that.data.imgIndex-- |
|
|
if (that.data.srcList.length > 0) { |
|
|
if (that.data.srcList.length > 0) { |
|
|
that.data.srcList.splice(index, 1) |
|
|
that.data.srcList.splice(index, 1) |
|
|
that.setData({ |
|
|
that.setData({ |
|
|
srcList: that.data.srcList |
|
|
srcList: that.data.srcList, |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
return; |
|
|
return; |
|
@ -110,7 +134,14 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
confirmAct() { |
|
|
confirmAct() { |
|
|
var that = this |
|
|
var that = this |
|
|
if (that.data.srcList.length == 0) { |
|
|
if (!that.data.errordesc) { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请输入退款说明', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
WXAPI.returnData({ |
|
|
WXAPI.returnData({ |
|
|
accessId: app.globalData.accessId, |
|
|
accessId: app.globalData.accessId, |
|
|
storeId: 239, |
|
|
storeId: 239, |
|
@ -120,6 +151,7 @@ Page({ |
|
|
explain: that.data.remark, |
|
|
explain: that.data.remark, |
|
|
type: that.data.refund_type, |
|
|
type: that.data.refund_type, |
|
|
refund_apply_money: that.data.re_price, |
|
|
refund_apply_money: that.data.re_price, |
|
|
|
|
|
images: that.data.srcList |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
if (res.code == 200) { |
|
|
if (res.code == 200) { |
|
|
var data = res.data |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
/** |
|
|
/** |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|