wuliu.js
1.11 KB
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
var os=getApp().globalData.setting;
Page({
data:{
isLoad:0,
url: os.imghost,
show:0
},
onLoad:function(t){
var th=this;
var order_id=t.order_id;
getApp().promiseGet('/api/weshop/order/getWaybillToken/'+os.stoid+'/'+order_id,{}).then(res=>{
if(res.data.code==0){
th.data.isLoad=1;
this.setData({show:0});
setTimeout(()=>{
var plugin = requirePlugin("logisticsPlugin");
plugin.openWaybillTracking({
waybillToken: res.data.data
});
},100)
}else{
var msg="查询物流失败";
if(res.data.msg) msg=res.data.msg;
wx.showToast({
title: msg,
icon: 'none',
duration: 1000,
});
}
})
},
onShow: function(){
this.setData({show:0})
if(this.data.isLoad){
this.data.isLoad=0;
wx.navigateBack({ delta: 1 }) //返回上一页
return false;
}
this.setData({show:1})
}
});