|
|
@ -211,6 +211,62 @@ Page({ |
|
|
this.daojishi(time); |
|
|
this.daojishi(time); |
|
|
},1000) |
|
|
},1000) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 确认收货
|
|
|
|
|
|
toConfirmPost() { |
|
|
|
|
|
let _this =this; |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title:'提示', |
|
|
|
|
|
content:"确定收货吗", |
|
|
|
|
|
success:function(res){ |
|
|
|
|
|
if(res.confirm){ |
|
|
|
|
|
commonApi.user_post("order/confirm_post",{ |
|
|
|
|
|
order_id:_this.data.info.order_id |
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '操作成功', |
|
|
|
|
|
icon:'success' |
|
|
|
|
|
}) |
|
|
|
|
|
_this.getInfo() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
getInfo () { |
|
|
|
|
|
commonApi.user_post("order/query",{ |
|
|
|
|
|
order_id:this.data.id |
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){ |
|
|
|
|
|
let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000); |
|
|
|
|
|
this.daojishi(time); |
|
|
|
|
|
} |
|
|
|
|
|
let proId = [] |
|
|
|
|
|
res.data.order_product_list.forEach(item => { |
|
|
|
|
|
proId.push(item.product_id) |
|
|
|
|
|
}) |
|
|
|
|
|
let state = ""; |
|
|
|
|
|
res.data.stateNums = {} |
|
|
|
|
|
res.data.order_product_list.map(order=>{ |
|
|
|
|
|
if(res.data.stateNums[order.state]){ |
|
|
|
|
|
res.data.stateNums[order.state]++; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
res.data.stateNums[order.state] = 1; |
|
|
|
|
|
} |
|
|
|
|
|
order.consignee_info = order.consignee_info?JSON.parse(order.consignee_info):null; |
|
|
|
|
|
state = state + order.state; |
|
|
|
|
|
order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[] |
|
|
|
|
|
}) |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
isRefund:state.indexOf("REFUND")!=-1, |
|
|
|
|
|
info:res.data, |
|
|
|
|
|
product_model:res.data.order_product_list[0].product_model, |
|
|
|
|
|
ids: proId.join(",") |
|
|
|
|
|
}) |
|
|
|
|
|
this.getCodeImg() |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
gotoDetail: function (e) { |
|
|
gotoDetail: function (e) { |
|
|
let item = e.currentTarget.dataset.item; |
|
|
let item = e.currentTarget.dataset.item; |
|
|
|