Commit 0c818e6496b1980d913691783b876cb6dc649748

Authored by yvan.ni
1 parent 6fc46e49

1. 小程序解绑后,会员的缓存会重新定义,不会一直在线,造成下单失败

2.  分销的验证的优化
... ... @@ -94,10 +94,17 @@ App({
94 94 if (user && user.user_id){
95 95 //--生成会员 --
96 96 app.promiseGet("/api/weshop/users/get/" + user.store_id + "/" + user.user_id,{}).then(res=>{
97   - if(res.data.code==0){
  97 + if(res.data.code==0){
98 98 user=res.data.data;
99   - app.globalData.userInfo=user;
100   - app.globalData.user_id= user.user_id;
  99 + //-- 小程序会员被解绑了,就要清空会员 --
  100 + if(user['is_weappuser']==0){
  101 + user=null;
  102 + app.globalData.userInfo=null;
  103 + app.globalData.user_id= 0;
  104 + }else{
  105 + app.globalData.userInfo=user;
  106 + app.globalData.user_id= user.user_id;
  107 + }
101 108 wx.setStorageSync("userinfo",user);
102 109 }
103 110 })
... ...
packageA/pages/distribution/goods/goods.json
... ... @@ -2,6 +2,6 @@
2 2 "usingComponents": {
3 3 "nodata": "/components/nodata/nodata"
4 4 },
5   - "navigationBarTitleText": "上下架商品",
  5 + "navigationBarTitleText": "",
6 6 "enablePullDownRefresh": false
7 7 }
8 8 \ No newline at end of file
... ...
pages/distribution/distribution.js
... ... @@ -256,6 +256,8 @@ Page({
256 256 let index = e.target.dataset.index;
257 257 let mobile = 0;
258 258 var th=this;
  259 + var inv=e.currentTarget.dataset.inv;
  260 + if(!this.data.inputValue) this.data.inputValue=inv;
259 261 if(this.data.inputValue) {
260 262 mobile = this.data.inputValue;
261 263 if(!pass) {
... ...
pages/distribution/distribution.wxml
... ... @@ -75,10 +75,12 @@
75 75  
76 76 <!-- 如果分销没有开启或者过期 -->
77 77 <block wx:if="{{err_word}}">
78   - <view class="t-c pd20 title">提示<text class="iconfont icon-close" bindtap="goto" data-url="/pages/user/index/index"></text></view>
79   - <view class="t-c pd20">
80   - <image src="{{imghost + 'miniapp/images/user/nodistribut.png'}}" class="img"/>
81   - <view class="fs28 pdt40">{{err_word}}</view>
  78 + <view class="popup">
  79 + <view class="t-c pd20 title">提示<text class="iconfont icon-close" bindtap="goto" data-url="/pages/user/index/index"></text></view>
  80 + <view class="t-c pd20">
  81 + <image src="{{imghost + 'miniapp/images/user/nodistribut.png'}}" class="img"/>
  82 + <view class="fs28 pdt40">{{err_word}}</view>
  83 + </view>
82 84 </view>
83 85 <!-- 遮罩 -->
84 86 <view class="mask"></view>
... ... @@ -105,7 +107,7 @@
105 107 <view class="flex ali-c">
106 108 <text wx:if="{{item.inviter}}">{{item.inviter}}</text>
107 109 <input wx:else class="bg-f0 pdh10 input" type="number" value="{{item.inviter ? item.inviter:''}}" placeholder="请输入推荐人手机号码" disabled="{{item.pass}}" bindinput="getInput"/>
108   - <view class="verify" wx:if="{{!item.pass}}" bindtap="verify" data-index="{{index}}" data-pass="{{item.pass}}">验证</view>
  110 + <view class="verify" wx:if="{{!item.pass}}" inv="{{item.inviter}}" bindtap="verify" data-index="{{index}}" data-pass="{{item.pass}}">验证</view>
109 111 </view>
110 112 </view>
111 113 <text class="iconfont {{item.pass ? 'icon-yes c-red':'icon-yuanquan c-c7'}}"></text>
... ...