- 
Status changed to merged 
- 
mentioned in commit a44c102ad66438a4d8cca12657f80088bda3afa8 
- 
2. 当会员没有默认门店的情况下调用,要判读对象是不是存在,是不是有门店pickup_id 
Showing
9 changed files
app.js
| @@ -13,7 +13,7 @@ App({ | @@ -13,7 +13,7 @@ App({ | ||
| 13 | config2: null, //门店配置 | 13 | config2: null, //门店配置 | 
| 14 | code: null, | 14 | code: null, | 
| 15 | heigth:0, | 15 | heigth:0, | 
| 16 | - user_id: null,// 4379287,// null,// 5682068, | 16 | + user_id:null,// 3674923,// 4379287,// null,// 5682068, | 
| 17 | buy_now:null, | 17 | buy_now:null, | 
| 18 | picklist:null, //门店列表 | 18 | picklist:null, //门店列表 | 
| 19 | wuliuprice: null, //物流价格表 | 19 | wuliuprice: null, //物流价格表 | 
| @@ -408,7 +408,10 @@ App({ | @@ -408,7 +408,10 @@ App({ | ||
| 408 | clearInterval(page.data[key]); | 408 | clearInterval(page.data[key]); | 
| 409 | func(); | 409 | func(); | 
| 410 | } | 410 | } | 
| 411 | - if(n>15) clearInterval(page.data[key]); | 411 | + if(n>15){ | 
| 412 | + clearInterval(page.data[key]); | ||
| 413 | + func(); | ||
| 414 | + } | ||
| 412 | },1000); | 415 | },1000); | 
| 413 | } | 416 | } | 
| 414 | } | 417 | } | 
pages/cart/cart/cart.js
| @@ -122,16 +122,27 @@ Page({ | @@ -122,16 +122,27 @@ Page({ | ||
| 122 | store_id: oo.stoid, | 122 | store_id: oo.stoid, | 
| 123 | pageSize: 600 | 123 | pageSize: 600 | 
| 124 | }, | 124 | }, | 
| 125 | - success: function(su) { | 125 | + success:async function(su) { | 
| 126 | //按门店分类的数组 | 126 | //按门店分类的数组 | 
| 127 | var arr = new Array(), | 127 | var arr = new Array(), | 
| 128 | carr = su.data.data.pageData; | 128 | carr = su.data.data.pageData; | 
| 129 | var all_num = 0; | 129 | var all_num = 0; | 
| 130 | 130 | ||
| 131 | for (var i = 0; i < carr.length; i++) { | 131 | for (var i = 0; i < carr.length; i++) { | 
| 132 | - | ||
| 133 | - | ||
| 134 | var item = carr[i]; | 132 | var item = carr[i]; | 
| 133 | + var good=null; | ||
| 134 | + await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+item.goods_id,{}).then(res=>{ | ||
| 135 | + good=res.data.data; | ||
| 136 | + }) | ||
| 137 | + var tt=ut.gettimestamp(); | ||
| 138 | + if((good.down_time>0 && good.down_time<tt) || good.is_on_sale==0 ){ | ||
| 139 | + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | ||
| 140 | + a.delete(url, { | ||
| 141 | + success: function(t) { } | ||
| 142 | + }); | ||
| 143 | + //商品已经下架 | ||
| 144 | + continue; | ||
| 145 | + } | ||
| 135 | all_num += item.goods_num; | 146 | all_num += item.goods_num; | 
| 136 | item.original_img = oo.imghost + item.original_img; | 147 | item.original_img = oo.imghost + item.original_img; | 
| 137 | item.selected = 0; | 148 | item.selected = 0; | 
pages/giftpack/birthdaygift/birthdaygift.js
| @@ -140,7 +140,8 @@ Page({ | @@ -140,7 +140,8 @@ Page({ | ||
| 140 | "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 140 | "actType": 4, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 
| 141 | "giftBagId": th.data.giftID, //礼包Id | 141 | "giftBagId": th.data.giftID, //礼包Id | 
| 142 | "storeId": a.stoid, //商家Id | 142 | "storeId": a.stoid, //商家Id | 
| 143 | - "userId": d.user_id //用户ID | 143 | + "userId": d.user_id, //用户ID | 
| 144 | + "buyFrom": 2 | ||
| 144 | }; | 145 | }; | 
| 145 | var data = JSON.stringify(json); | 146 | var data = JSON.stringify(json); | 
| 146 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 147 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 
pages/giftpack/evaluategift/evaluategift.js
| @@ -157,7 +157,8 @@ Page({ | @@ -157,7 +157,8 @@ Page({ | ||
| 157 | "orderNumber": th.data.orderNumber, | 157 | "orderNumber": th.data.orderNumber, | 
| 158 | "orderType": th.data.orderType, | 158 | "orderType": th.data.orderType, | 
| 159 | "orderGoodsId": th.data.orderGoodsId, | 159 | "orderGoodsId": th.data.orderGoodsId, | 
| 160 | - "giftBagId": th.data.giftBagId | 160 | + "giftBagId": th.data.giftBagId, | 
| 161 | + "buyFrom": 2 | ||
| 161 | }; | 162 | }; | 
| 162 | var data = JSON.stringify(json); | 163 | var data = JSON.stringify(json); | 
| 163 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 164 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 
pages/giftpack/festival/festival.js
| @@ -147,7 +147,8 @@ Page({ | @@ -147,7 +147,8 @@ Page({ | ||
| 147 | "actType": 3, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 147 | "actType": 3, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 
| 148 | "giftBagId": th.data.giftID, //礼包Id | 148 | "giftBagId": th.data.giftID, //礼包Id | 
| 149 | "storeId": a.stoid, //商家Id | 149 | "storeId": a.stoid, //商家Id | 
| 150 | - "userId": d.user_id //用户ID | 150 | + "userId": d.user_id, //用户ID | 
| 151 | + "buyFrom": 2 | ||
| 151 | } | 152 | } | 
| 152 | var data = JSON.stringify(json); | 153 | var data = JSON.stringify(json); | 
| 153 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 154 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 
pages/giftpack/newvipgift/newvipgift.js
| @@ -139,7 +139,8 @@ Page({ | @@ -139,7 +139,8 @@ Page({ | ||
| 139 | "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 139 | "actType": 1, //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | 
| 140 | "giftBagId": th.data.giftID, //礼包Id | 140 | "giftBagId": th.data.giftID, //礼包Id | 
| 141 | "storeId": a.stoid, //商家Id | 141 | "storeId": a.stoid, //商家Id | 
| 142 | - "userId": d.user_id //用户ID | 142 | + "userId": d.user_id, //用户ID | 
| 143 | + "buyFrom": 2 | ||
| 143 | }; | 144 | }; | 
| 144 | var data = JSON.stringify(json); | 145 | var data = JSON.stringify(json); | 
| 145 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 146 | var url = th.data.url + "/api/weshop/marketing/free/receive/gift/record/insert"; | 
pages/goods/goodsInfo/goodsInfo.js
| @@ -341,7 +341,10 @@ Page({ | @@ -341,7 +341,10 @@ Page({ | ||
| 341 | 341 | ||
| 342 | //获取用户的默认门店 | 342 | //获取用户的默认门店 | 
| 343 | getApp().get_user_store(function(ee) { | 343 | getApp().get_user_store(function(ee) { | 
| 344 | - if(!ee) return false; | 344 | + if(!ee) { | 
| 345 | + th.data.fir_def_store={}; | ||
| 346 | + return false; | ||
| 347 | + } | ||
| 345 | var appd=getApp().globalData; | 348 | var appd=getApp().globalData; | 
| 346 | var w_time = setInterval(function() { | 349 | var w_time = setInterval(function() { | 
| 347 | if (that.data.is_get_local_ok == 0) return false; | 350 | if (that.data.is_get_local_ok == 0) return false; | 
| @@ -631,7 +634,7 @@ Page({ | @@ -631,7 +634,7 @@ Page({ | ||
| 631 | if(that.data.sales_rules==2 && that.data.is_newsales_rules){ | 634 | if(that.data.sales_rules==2 && that.data.is_newsales_rules){ | 
| 632 | //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存 | 635 | //--等待某个值只运行---,这里有可能因为导航的时间太久,而不能计算门店库存 | 
| 633 | getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){ | 636 | getApp().waitfor2(that,"wait_for_user_store","fir_def_store",function(){ | 
| 634 | - if(th.data.fir_def_store){ | 637 | + if(th.data.fir_def_store && th.data.fir_def_store.pickup_id ){ | 
| 635 | var lock=0,plist=null; | 638 | var lock=0,plist=null; | 
| 636 | //先读取门店的lock,采用链式写法,少用await | 639 | //先读取门店的lock,采用链式写法,少用await | 
| 637 | getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{ | 640 | getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{ | 
| @@ -1851,7 +1854,7 @@ Page({ | @@ -1851,7 +1854,7 @@ Page({ | ||
| 1851 | o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; | 1854 | o_plist[kk].CanOutQty=n_item.CanOutQty-lock_num; | 
| 1852 | new_list.push(o_plist[kk]); | 1855 | new_list.push(o_plist[kk]); | 
| 1853 | //如果找到默认门店 | 1856 | //如果找到默认门店 | 
| 1854 | - if(n_item.StorageNo==th.data.fir_def_store.pickup_no){ | 1857 | + if(th.data.fir_def_store && n_item.StorageNo==th.data.fir_def_store.pickup_no){ | 
| 1855 | th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num; | 1858 | th.data.fir_def_store.CanOutQty=n_item.CanOutQty-lock_num; | 
| 1856 | if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id) | 1859 | if(def_pick_store.pickup_id==th.data.fir_def_store.pickup_id) | 
| 1857 | th.setData({def_pick_store:th.data.fir_def_store}) | 1860 | th.setData({def_pick_store:th.data.fir_def_store}) | 
pages/team/team_show/team_show.wxml
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | </view> | 24 | </view> | 
| 25 | <view class="xc-wc fs24"> | 25 | <view class="xc-wc fs24"> | 
| 26 | <view> | 26 | <view> | 
| 27 | - <view class="">已拼{{teamlist.buy_num}}份</view> | 27 | + <view class="">已拼{{teamlist.buy_num}}件</view> | 
| 28 | <view class="flex xc-valframe t-c"> | 28 | <view class="flex xc-valframe t-c"> | 
| 29 | <view class="xc-frame-img"> | 29 | <view class="xc-frame-img"> | 
| 30 | <image class="picture"src="{{imageurl}}/miniapp/images/bai-ren.png"></image> | 30 | <image class="picture"src="{{imageurl}}/miniapp/images/bai-ren.png"></image> | 
pages/team/team_success/team_success.wxml
| @@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
| 23 | </view> | 23 | </view> | 
| 24 | <view class="xc-wc fs24"> | 24 | <view class="xc-wc fs24"> | 
| 25 | <view> | 25 | <view> | 
| 26 | - <view class="">已拼{{teamlist.buy_num}}份</view> | 26 | + <view class="">已拼{{teamlist.buy_num}}件</view> | 
| 27 | <view class="flex xc-valframe t-c"> | 27 | <view class="flex xc-valframe t-c"> | 
| 28 | <view class="xc-frame-img"> | 28 | <view class="xc-frame-img"> | 
| 29 | <image class="picture" src="{{iurl}}/miniapp/images/bai-ren.png"></image> | 29 | <image class="picture" src="{{iurl}}/miniapp/images/bai-ren.png"></image> | 
