Commit ba0a3d82883440063b01b672c6ca0ab55668f1c4
1 parent
1a014ac7
1.后台不启用 默认登记门店的bug优化,
2.同时 在程序重新进入的时候,默认门店不显示的bug
Showing
1 changed file
with
39 additions
and
28 deletions
app.js
... | ... | @@ -298,34 +298,45 @@ App({ |
298 | 298 | //获取会员门店 |
299 | 299 | get_user_store:function (func) |
300 | 300 | { |
301 | - var th=this; | |
302 | - //---空会员的情况--- | |
303 | - if(!th.globalData.userInfo){ | |
304 | - return func(null); | |
305 | - } | |
306 | - if(!this.globalData.pk_store){ | |
307 | - var pick_id=0; | |
308 | - //先找一个会员是否有设置默认的地址 | |
309 | - if(th.globalData.userInfo.def_pickup_id){ | |
310 | - pick_id= th.globalData.userInfo.def_pickup_id | |
311 | - } | |
312 | - //查找会员的注册的地址 | |
313 | - else if(th.globalData.userInfo.pickup_id){ | |
314 | - pick_id= th.globalData.userInfo.pickup_id | |
315 | - } | |
316 | - //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- | |
317 | - if(pick_id==0) return func(null); | |
318 | - //获取用户注册时候的门店 | |
319 | - th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+this.globalData.userInfo.pickup_id,{ | |
320 | - data:{}, | |
321 | - success:function (res) { | |
322 | - th.globalData.pk_store=res.data.data; | |
323 | - func(th.globalData.pk_store); | |
324 | - } | |
325 | - }) | |
326 | - }else{ | |
327 | - func(this.globalData.pk_store); | |
328 | - } | |
301 | + var th=this; | |
302 | + this.getConfig2(function (conf) { | |
303 | + //---空会员的情况--- | |
304 | + if(!th.globalData.userInfo){ | |
305 | + return func(null); | |
306 | + } | |
307 | + if(!th.globalData.pk_store){ | |
308 | + var pick_id=0; | |
309 | + //先找一个会员是否有设置默认的地址 | |
310 | + if(th.globalData.userInfo.def_pickup_id){ | |
311 | + pick_id= th.globalData.userInfo.def_pickup_id | |
312 | + } | |
313 | + //查找会员的注册的地址 | |
314 | + else if(th.globalData.userInfo.pickup_id){ | |
315 | + //--购买门店是否默认登记门店-- | |
316 | + if(conf.switch_list){ | |
317 | + var t_swi=JSON.parse(conf.switch_list); | |
318 | + if(t_swi.is_regstores){ | |
319 | + pick_id= th.globalData.userInfo.pickup_id | |
320 | + } | |
321 | + } | |
322 | + | |
323 | + } | |
324 | + //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- | |
325 | + if(pick_id==0) return func(null); | |
326 | + //获取用户注册时候的门店 | |
327 | + th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{ | |
328 | + data:{}, | |
329 | + success:function (res) { | |
330 | + th.globalData.pk_store=res.data.data; | |
331 | + func(th.globalData.pk_store); | |
332 | + } | |
333 | + }) | |
334 | + }else{ | |
335 | + func(th.globalData.pk_store); | |
336 | + } | |
337 | + }) | |
338 | + | |
339 | + | |
329 | 340 | }, |
330 | 341 | |
331 | 342 | //-------获取购物车数量---------- | ... | ... |