Commit bd0260079188ea1b735591138ac9d879eb7d5453

Authored by yvan.ni
1 parent 8f16b951

门店选择的bug的优化

components/diy_store_select/diy_store_select.js
@@ -36,6 +36,12 @@ Component({ @@ -36,6 +36,12 @@ Component({
36 //-- 初始化顶部的门店显示 -- 36 //-- 初始化顶部的门店显示 --
37 init(){ 37 init(){
38 var th=this; 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 getApp().get_user_store(function(){ 46 getApp().get_user_store(function(){
41 var top_store=getApp().globalData.pk_store; 47 var top_store=getApp().globalData.pk_store;
@@ -83,7 +89,12 @@ Component({ @@ -83,7 +89,12 @@ Component({
83 //点击选择门店 89 //点击选择门店
84 sele_top_store(){ 90 sele_top_store(){
85 var user_id=getApp().globalData.user_id; 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 var th=this; 98 var th=this;
88 this.get_top_sto(function(){ 99 this.get_top_sto(function(){
89 th.setData({store:1}); 100 th.setData({store:1});
pages/index/index/index.js
@@ -232,6 +232,7 @@ Page({ @@ -232,6 +232,7 @@ Page({
232 getApp().getConfig2(function(e) { 232 getApp().getConfig2(function(e) {
233 var json_d = JSON.parse(e.switch_list); 233 var json_d = JSON.parse(e.switch_list);
234 th.setData({is_closecoupon: json_d.is_closecoupon}) 234 th.setData({is_closecoupon: json_d.is_closecoupon})
  235 + th.setData({is_topstore: json_d.is_show_storeselect})
235 },1) 236 },1)
236 237
237 if (typeof this.getTabBar === 'function' && this.getTabBar()) { 238 if (typeof this.getTabBar === 'function' && this.getTabBar()) {
pages/index/index/index.wxml
@@ -6,11 +6,13 @@ @@ -6,11 +6,13 @@
6 <block wx:if="{{banner}}"> 6 <block wx:if="{{banner}}">
7 <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image> 7 <image class="xc-top-img abs" src="{{url}}/miniapp/images/top-img.png"></image>
8 </block> 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 <view class="classify-frame t-c" bindtap="go_cate"> 16 <view class="classify-frame t-c" bindtap="go_cate">
15 <image class="classify-img" src="{{url}}/miniapp/images/classify.png"></image> 17 <image class="classify-img" src="{{url}}/miniapp/images/classify.png"></image>
16 <view class="fs20">分 18 <view class="fs20">分