Commit 5c7d05503426ad07a2dc87368d4e0836bcaf7fbd
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
2 changed files
with
50 additions
and
15 deletions
pages/user/order_list/order_list.js
| ... | ... | @@ -110,29 +110,37 @@ Page({ |
| 110 | 110 | }); |
| 111 | 111 | s.init(this, "", "orderList"); |
| 112 | 112 | |
| 113 | - setTimeout(()=>{ | |
| 114 | - if(!getApp().globalData.user_id){ | |
| 115 | - getApp().goto('/packageE/pages/togoin/togoin') | |
| 116 | - return false; | |
| 117 | - } | |
| 118 | - },1500) | |
| 113 | + //先判断有没有系统缓存的信息 | |
| 114 | + this.check_user_storage(()=>{ | |
| 115 | + if(!getApp().globalData.user_id){ | |
| 116 | + th.setData({no_user:1 }) | |
| 117 | + getApp().goto('/packageE/pages/togoin/togoin') | |
| 118 | + return false; | |
| 119 | + } | |
| 120 | + }) | |
| 119 | 121 | |
| 120 | 122 | |
| 121 | 123 | }, |
| 122 | 124 | onShow: function () { |
| 123 | - | |
| 124 | 125 | wx.showLoading(); |
| 126 | + var th=this; | |
| 125 | 127 | //-- 读取会员的信息先 --,再app.js中有 |
| 126 | - setTimeout(()=> { | |
| 128 | + this.check_user_storage(()=> { | |
| 129 | + //在界面显示 | |
| 130 | + if(!getApp().globalData.user_id){ | |
| 131 | + wx.hideLoading(); | |
| 132 | + }else{ | |
| 133 | + th.setData({no_user:0}) | |
| 134 | + } | |
| 135 | + | |
| 136 | + | |
| 127 | 137 | ut.fy_back('', 0) |
| 128 | - this.setData({paying: 0}); | |
| 129 | - this.data.ser_paying = 0; | |
| 138 | + th.setData({paying: 0}); | |
| 139 | + th.data.ser_paying = 0; | |
| 130 | 140 | |
| 131 | 141 | t_pay.set_fir(); |
| 132 | 142 | t.set_fir(); |
| 133 | 143 | |
| 134 | - var th = this; | |
| 135 | - | |
| 136 | 144 | //---查看会员的等级价--- |
| 137 | 145 | getApp().getConfig2(function (e) { |
| 138 | 146 | |
| ... | ... | @@ -175,11 +183,27 @@ Page({ |
| 175 | 183 | } |
| 176 | 184 | }, 1) |
| 177 | 185 | |
| 178 | - this.resetData(), this.requestOrderList(this.data.activeCategoryId); | |
| 179 | - | |
| 180 | - this.clickTab(); | |
| 186 | + th.resetData(), th.requestOrderList(th.data.activeCategoryId); | |
| 187 | + th.clickTab(); | |
| 181 | 188 | },1500); |
| 182 | 189 | }, |
| 190 | + | |
| 191 | + onHide(){ | |
| 192 | + this.setData({no_user:0 }) | |
| 193 | + }, | |
| 194 | + | |
| 195 | + //判断有没有会员缓存 | |
| 196 | + check_user_storage(func){ | |
| 197 | + var user = wx.getStorageSync("userinfo"); | |
| 198 | + if(!user){ | |
| 199 | + func(); | |
| 200 | + }else{ | |
| 201 | + setTimeout(()=>{ | |
| 202 | + func(); | |
| 203 | + },1200); | |
| 204 | + } | |
| 205 | + }, | |
| 206 | + | |
| 183 | 207 | changeTab: function (t) { |
| 184 | 208 | if (this.data.activeCategoryId == t.currentTarget.id) return false; |
| 185 | 209 | this.resetData(), this.requestOrderList(t.currentTarget.id); |
| ... | ... | @@ -191,6 +215,9 @@ Page({ |
| 191 | 215 | |
| 192 | 216 | /*---------获取订单列表--------*/ |
| 193 | 217 | requestOrderList: function (t) { |
| 218 | + if(!getApp().globalData.user_id){ | |
| 219 | + return false; | |
| 220 | + } | |
| 194 | 221 | var rd = Math.random() * 100; |
| 195 | 222 | var e = this, th = e, r = e.data.url + "/api/weshop/order/page?rd=" + rd, a = ""; |
| 196 | 223 | switch (t) { | ... | ... |
pages/user/order_list/order_list.wxml
| ... | ... | @@ -511,5 +511,13 @@ |
| 511 | 511 | </view> |
| 512 | 512 | </view> |
| 513 | 513 | |
| 514 | +<!-- 无会员,跳转提示 --> | |
| 515 | +<view class="empty_order" wx:if="{{no_user}}"> | |
| 516 | + <view class="flex-level"> | |
| 517 | + <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> | |
| 518 | + </view> | |
| 519 | + <view class="flex-level fs30 xc-ash">会员未登陆。。</view> | |
| 520 | +</view> | |
| 521 | + | |
| 514 | 522 | <!-- 弹出框扫描 --> |
| 515 | 523 | <qr_code id="qc_com"></qr_code> | ... | ... |