From 6e2513f71481c67607ae9b66fddde2097b6c8969 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Tue, 23 Nov 2021 14:21:43 +0800 Subject: [PATCH] 在判断默认的门店有没有取消销售 --- app.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 0c0fdaf..7d15619 100644 --- a/app.js +++ b/app.js @@ -50,8 +50,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - heigth:0, - user_id:null,//5682094, + user_id:null,//3277,// 6519901,//6453964,// 4687,// 6519870,//5682094, buy_now:null, picklist:null, //门店列表 wuliuprice: null, //物流价格表 @@ -246,7 +245,7 @@ App({ } if(this.globalData.config==undefined) this.globalData.config=null; this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.requestGet("/api/weshop/store/get/" + e.globalData.setting.stoid, { - success: function(o) { + success: function(o) { console.log('getConfig'); if(o.data.code==0){ e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); @@ -503,7 +502,8 @@ App({ data:{}, success:function (res) { th.globalData.pk_store=null; - if(res.data.code==0 && res.data.data && res.data.data.isstop==0){ + if(res.data.code==0 && res.data.data && res.data.data.isstop==0 && res.data.data.is_pos==1){ + //--门店的数量大于10个才要关心门店的分类有没有关闭-- if(res.data.data.category_id && num>10){ th.request.get( "/api/weshop/storagecategory/get/"+os.stoid+"/"+res.data.data.category_id, { @@ -514,10 +514,30 @@ App({ th.globalData.pk_store = res.data.data; func(th.globalData.pk_store); }else{ - func(null); + //看一下有没有显示的门店分类 + getApp().request.get("/api/weshop/storagecategory/page", { + data: { + store_id: os.stoid, + is_show: 1, + pageSize: 1, + }, + success: function (ee) { + if(ee.data.code==0){ + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0){ + func(null); + }else{ + th.globalData.pk_store = res.data.data; + func(th.globalData.pk_store); + } + }else{ + th.globalData.pk_store = res.data.data; + func(th.globalData.pk_store); + } + } + }) } }else{ - func(null); + func(null); } } }) -- libgit2 0.21.4