From 26e186815d49246fa54dcd0a88dd664c8b23e53b Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Wed, 29 Apr 2020 11:39:58 +0800 Subject: [PATCH] 1. 已拼多少份, 要改成已拼多少件 2. 当会员没有默认门店的情况下调用,要判读对象是不是存在,是不是有门店pickup_id --- app.js | 7 +++++-- pages/goods/goodsInfo/goodsInfo.js | 9 ++++++--- pages/team/team_show/team_show.wxml | 2 +- pages/team/team_success/team_success.wxml | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app.js b/app.js index 9a126d6..47bb739 100644 --- a/app.js +++ b/app.js @@ -13,7 +13,7 @@ App({ config2: null, //门店配置 code: null, heigth:0, - user_id: null,// 4379287,// null,// 5682068, + user_id:null,// 3674923,// 4379287,// null,// 5682068, buy_now:null, picklist:null, //门店列表 wuliuprice: null, //物流价格表 @@ -408,7 +408,10 @@ App({ clearInterval(page.data[key]); func(); } - if(n>15) clearInterval(page.data[key]); + if(n>15){ + clearInterval(page.data[key]); + func(); + } },1000); } } diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index e8dfa5c..607f5f7 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -341,7 +341,10 @@ Page({ //获取用户的默认门店 getApp().get_user_store(function(ee) { - if(!ee) return false; + if(!ee) { + th.data.fir_def_store={}; + return false; + } var appd=getApp().globalData; var w_time = setInterval(function() { if (that.data.is_get_local_ok == 0) return false; @@ -631,7 +634,7 @@ Page({ if(that.data.sales_rules==2 && that.data.is_newsales_rules){ //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存 getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){ - if(th.data.fir_def_store){ + if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){ var lock=0,plist=null; //先读取门店的lock,采用链式写法,少用await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{ @@ -1851,7 +1854,7 @@ Page({ o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; new_list.push(o_plist[kk]); //如果找到默认门店 - if(n_item.StorageNo==th.data.fir_def_store.pickup_no){ + if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no){ th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num; if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id) th.setData({def_pick_store:th.data.fir_def_store}) diff --git a/pages/team/team_show/team_show.wxml b/pages/team/team_show/team_show.wxml index c77705e..f05f48d 100644 --- a/pages/team/team_show/team_show.wxml +++ b/pages/team/team_show/team_show.wxml @@ -24,7 +24,7 @@ - 已拼{{teamlist.buy_num}}份 + 已拼{{teamlist.buy_num}}件 diff --git a/pages/team/team_success/team_success.wxml b/pages/team/team_success/team_success.wxml index f1f043e..888145c 100644 --- a/pages/team/team_success/team_success.wxml +++ b/pages/team/team_success/team_success.wxml @@ -23,7 +23,7 @@ - 已拼{{teamlist.buy_num}}份 + 已拼{{teamlist.buy_num}}件 -- libgit2 0.21.4