var os=getApp().globalData.setting; Page({ data:{ isLoad:0, url: os.imghost, }, 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; setTimeout(()=>{ var arr = getCurrentPages(); 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(){ if(this.data.isLoad){ this.data.isLoad=0; wx.navigateBack({ delta: 1 }) //返回上一页 return false; } } });