|
|
@@ -15,7 +15,10 @@ Page({
|
|
|
imgs: [], //图片凭证
|
|
|
mobile: '', //手机号码
|
|
|
refundSn: '', //退款编号名称
|
|
|
+ shopId: '', //店铺id
|
|
|
senderRemarks: '', //备注信息
|
|
|
+ type:'',//编辑模式
|
|
|
+ editData:null
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -54,22 +57,25 @@ Page({
|
|
|
} else {
|
|
|
var pics = '';
|
|
|
this.data.imgs.forEach(function (item) {
|
|
|
- pics += item.path + ',';
|
|
|
+ // pics += item.path + ',';
|
|
|
+ pics += item.url + ',';
|
|
|
});
|
|
|
if (pics != '') {
|
|
|
pics = pics.substring(0, pics.length - 1)
|
|
|
}
|
|
|
var parmas = {
|
|
|
- url: "/p/orderRefund/submitExpress",
|
|
|
- method: "POST",
|
|
|
+ url:this.data.type == 'edit'?"/refund/delivery/update": "/refund/delivery/save",
|
|
|
+ method: this.data.type == 'edit'?"PUT":"POST",
|
|
|
data: {
|
|
|
- expressId: this.data.deliveryList[this.data.expressId].dvyId, //物流公司id
|
|
|
- expressName: this.data.deliveryList[this.data.expressId].dvyName, //物流公司名称
|
|
|
- expressNo: this.data.expressNo, //物流单号
|
|
|
+ shopId:this.data.shopId,
|
|
|
+ deyId: this.data.deliveryList[this.data.expressId].dvyId, //物流公司id
|
|
|
+ deyName: this.data.deliveryList[this.data.expressId].dvyName, //物流公司名称
|
|
|
+ deyNu: this.data.expressNo, //物流单号
|
|
|
imgs: pics, //图片凭证
|
|
|
- mobile: this.data.mobile, //手机号码
|
|
|
+ senderMobile: this.data.mobile, //手机号码
|
|
|
refundSn: this.data.refundSn, //退款编号名称
|
|
|
senderRemarks: this.data.senderRemarks, //备注信息
|
|
|
+ userId:wx.getStorageSync("loginResult").userId
|
|
|
},
|
|
|
callBack: (res) => {
|
|
|
wx.hideLoading();
|
|
|
@@ -147,11 +153,15 @@ Page({
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
this.setData({
|
|
|
- refundSn: options.refundSn
|
|
|
+ refundSn: options.refundSn,
|
|
|
+ shopId: options.shopId,
|
|
|
+ type:options.type,
|
|
|
});
|
|
|
this.loadDeliveryData();
|
|
|
+
|
|
|
},
|
|
|
|
|
|
+ //获取物流公司列表
|
|
|
loadDeliveryData(){
|
|
|
wx.showLoading();
|
|
|
http.request({
|
|
|
@@ -164,10 +174,43 @@ Page({
|
|
|
deliveryList:res
|
|
|
});
|
|
|
console.log(res)
|
|
|
+ if(this.data.type == 'edit'){
|
|
|
+ this.getByRefundSn()
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
console.log(this.data.deliveryList)
|
|
|
},
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 获取退货物流信息
|
|
|
+ */
|
|
|
+ getByRefundSn(){
|
|
|
+ var parmas = {
|
|
|
+ url: `/refund/delivery/getByRefundSn/${this.data.refundSn}`,
|
|
|
+ method: "GET",
|
|
|
+ data: {},
|
|
|
+ callBack: (res) => {
|
|
|
+ let imgs = res.imgs.split(',').map(i=>{
|
|
|
+ return {url:i,path:i}
|
|
|
+ })
|
|
|
+
|
|
|
+ let expressId = 0
|
|
|
+ this.data.deliveryList.forEach((i,d)=>{
|
|
|
+ if(i.dvyId == res.deyId){
|
|
|
+ expressId = d
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ expressId,
|
|
|
+ expressNo:res.deyNu,
|
|
|
+ imgs,
|
|
|
+ senderRemarks:res.senderRemarks,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ };
|
|
|
+ http.request(parmas);
|
|
|
+ },
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|