Commit bd0260079188ea1b735591138ac9d879eb7d5453
1 parent
8f16b951
门店选择的bug的优化
Showing
3 changed files
with
18 additions
and
4 deletions
components/diy_store_select/diy_store_select.js
| ... | ... | @@ -36,6 +36,12 @@ Component({ |
| 36 | 36 | //-- 初始化顶部的门店显示 -- |
| 37 | 37 | init(){ |
| 38 | 38 | var th=this; |
| 39 | + | |
| 40 | + var user_id=getApp().globalData.user_id; | |
| 41 | + if(!user_id){ | |
| 42 | + return false; | |
| 43 | + } | |
| 44 | + | |
| 39 | 45 | //获取顶部的门店 |
| 40 | 46 | getApp().get_user_store(function(){ |
| 41 | 47 | var top_store=getApp().globalData.pk_store; |
| ... | ... | @@ -83,7 +89,12 @@ Component({ |
| 83 | 89 | //点击选择门店 |
| 84 | 90 | sele_top_store(){ |
| 85 | 91 | var user_id=getApp().globalData.user_id; |
| 86 | - if(!user_id) return false; | |
| 92 | + if(!user_id){ | |
| 93 | + wx.navigateTo({ | |
| 94 | + url: '/pages/togoin/togoin', | |
| 95 | + }); | |
| 96 | + return false; | |
| 97 | + } | |
| 87 | 98 | var th=this; |
| 88 | 99 | this.get_top_sto(function(){ |
| 89 | 100 | th.setData({store:1}); | ... | ... |
pages/index/index/index.js
| ... | ... | @@ -232,6 +232,7 @@ Page({ |
| 232 | 232 | getApp().getConfig2(function(e) { |
| 233 | 233 | var json_d = JSON.parse(e.switch_list); |
| 234 | 234 | th.setData({is_closecoupon: json_d.is_closecoupon}) |
| 235 | + th.setData({is_topstore: json_d.is_show_storeselect}) | |
| 235 | 236 | },1) |
| 236 | 237 | |
| 237 | 238 | if (typeof this.getTabBar === 'function' && this.getTabBar()) { | ... | ... |
pages/index/index/index.wxml
| ... | ... | @@ -6,11 +6,13 @@ |
| 6 | 6 | <block wx:if="{{banner}}"> |
| 7 | 7 | <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> |
| 8 | 8 | </block> |
| 9 | - | |
| 10 | - <store_select></store_select> | |
| 9 | + <!-- 控制要不要显示顶部门店选择 --> | |
| 10 | + <block wx:if="{{is_topstore}}"> | |
| 11 | + <store_select></store_select> | |
| 12 | + </block> | |
| 11 | 13 | |
| 12 | 14 | <!--搜索框--> |
| 13 | - <view class="search-box {{scrollTop>10?'search-fixed':''}} flex-center white " style="top:88rpx"> | |
| 15 | + <view class="search-box {{scrollTop>10?'search-fixed':''}} flex-center white " style="top:{{is_topstore?88:0}}rpx"> | |
| 14 | 16 | <view class="classify-frame t-c" bindtap="go_cate"> |
| 15 | 17 | <image class="classify-img" src="{{url}}/miniapp/images/classify.png"></image> |
| 16 | 18 | <view class="fs20">分 | ... | ... |