From 22973097f46c46e6a2764305464270ba833e1ca7 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Mon, 30 Dec 2019 15:00:27 +0800 Subject: [PATCH] 获取用户默认门店,这个门店不能关闭,同时这个门店的分类页不能关闭 --- app.js | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index e612c7c..3df75a3 100644 --- a/app.js +++ b/app.js @@ -323,12 +323,35 @@ App({ } //---如果会员没有设置默认门店,同时也没有再注册的时候选择门店-- if(pick_id==0) return func(null); - //获取用户注册时候的门店 + //获取用户注册时候的门店,这个门店不能关闭,同时这个门店的分类不能关闭 th.request.get("/api/weshop/pickup/get/"+os.stoid+"/"+pick_id,{ data:{}, success:function (res) { - th.globalData.pk_store=res.data.data; - func(th.globalData.pk_store); + th.globalData.pk_store=null; + if(res.data.code==0 && res.data.data && res.data.data.isstop==0){ + if(res.data.data.category_id){ + th.request.get( "/api/weshop/storagecategory/get/"+os.stoid+"/"+res.data.data.category_id, { + data: {}, + success: function (ee) { + if(ee.data.code==0 && ee.data.data ){ + if(ee.data.data.is_show==1){ + th.globalData.pk_store = res.data.data; + func(th.globalData.pk_store); + }else{ + func(null); + } + }else{ + func(null); + } + } + }) + }else{ + th.globalData.pk_store = res.data.data; + func(th.globalData.pk_store); + } + }else{ + func(null); + } } }) }else{ @@ -336,7 +359,6 @@ App({ } }) - }, //-------获取购物车数量---------- -- libgit2 0.21.4