From ed05fa97c5b9ca926a1aa050881ac9fcc4bd918a Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Sat, 20 May 2023 17:15:46 +0800 Subject: [PATCH] 物流组件,分包的优化 --- app.js | 20 +++----------------- packageF/pages/wuliu/wuliu.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ packageF/pages/wuliu/wuliu.json | 1 + packageF/pages/wuliu/wuliu.wxml | 10 ++++++++++ packageF/pages/wuliu/wuliu.wxss | 39 +++++++++++++++++++++++++++++++++++++++ pages/index/index/index.js | 4 +--- 6 files changed, 100 insertions(+), 20 deletions(-) create mode 100644 packageF/pages/wuliu/wuliu.js create mode 100644 packageF/pages/wuliu/wuliu.json create mode 100644 packageF/pages/wuliu/wuliu.wxml create mode 100644 packageF/pages/wuliu/wuliu.wxss diff --git a/app.js b/app.js index 55775a4..36d5836 100644 --- a/app.js +++ b/app.js @@ -1314,24 +1314,10 @@ App({ if(conf && conf.express_searchtype==1){ //在此通过调用api来查询微信快递服务详情 //必须用预览才能测试这个功能,无法在工具端模拟 - var res= await th.promiseGet('/api/weshop/order/getWaybillToken/'+stoid+'/'+order_id,{}); - if(res.data.code==0){ - var plugin = requirePlugin("logisticsPlugin") - plugin.openWaybillTracking({ - waybillToken: res.data.data - }); - }else{ - var msg="查询物流失败"; - if(res.data.msg) msg=res.data.msg; - wx.showToast({ - title: msg, - icon: 'none', - duration: 1000, - }); - } - }else{ - getApp().goto(url); + url="/packageF/pages/wuliu/wuliu?order_id="+order_id; } + th.goto(url); + }) } diff --git a/packageF/pages/wuliu/wuliu.js b/packageF/pages/wuliu/wuliu.js new file mode 100644 index 0000000..f002d03 --- /dev/null +++ b/packageF/pages/wuliu/wuliu.js @@ -0,0 +1,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}) + + + } + + +}); diff --git a/packageF/pages/wuliu/wuliu.json b/packageF/pages/wuliu/wuliu.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/packageF/pages/wuliu/wuliu.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/packageF/pages/wuliu/wuliu.wxml b/packageF/pages/wuliu/wuliu.wxml new file mode 100644 index 0000000..8017535 --- /dev/null +++ b/packageF/pages/wuliu/wuliu.wxml @@ -0,0 +1,10 @@ + + + 查询中 + + + + + + + diff --git a/packageF/pages/wuliu/wuliu.wxss b/packageF/pages/wuliu/wuliu.wxss new file mode 100644 index 0000000..ac71d97 --- /dev/null +++ b/packageF/pages/wuliu/wuliu.wxss @@ -0,0 +1,39 @@ +.flex{ + display: flex +} +.j_c{ justify-content: center} +.a_c{ align-items: center} + +.loading4{ + width:150px; + margin:10px auto; + text-align: center; +} +.loading4 text{ + width: 24rpx; + height: 24rpx; + border-radius: 100%; + display:inline-block; + /*background-color: #67CF22;*/ + background-color: #999; + -webkit-animation: three 1.4s infinite ease-in-out; + animation: three 1.4s infinite ease-in-out; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.loading4 .three1{ + -webkit-animation-delay: -0.30s; + animation-delay: -0.30s; +} +.loading4 .three2{ + -webkit-animation-delay: -0.15s; + animation-delay: -0.15s; +} +@-webkit-keyframes three { + 0%, 80%, 100% {-webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} +@keyframes three { + 0%, 80%, 100% {-webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} \ No newline at end of file diff --git a/pages/index/index/index.js b/pages/index/index/index.js index e7671f0..96b7c3d 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -91,9 +91,7 @@ Page({ onLoad: async function (tt) { - console.error('分享群id'); - console.error(tt); - console.error('...................................'); + wx.showShareMenu({ withShareTicket:true, menus:['shareAppMessage','shareTimeline'] -- libgit2 0.21.4