Commit d9d20c5de317d32100468d9ef507b489775a7c9d
1 parent
51f74f1a
切换的时候。判断商品的多活动情况
Showing
2 changed files
with
15 additions
and
7 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -6357,7 +6357,7 @@ Page({ |
6357 | 6357 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; |
6358 | 6358 | var req_d = { |
6359 | 6359 | "store_id": os.stoid, |
6360 | - "goods_id": this.data.gid, | |
6360 | + "goods_id": gid, | |
6361 | 6361 | "user_id": user_id, |
6362 | 6362 | } |
6363 | 6363 | await getApp().request.promiseGet(url, { | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -3444,7 +3444,7 @@ Page({ |
3444 | 3444 | else that.get_sto(); |
3445 | 3445 | |
3446 | 3446 | if (!item.whsle_id && ([1,2,4,6].indexOf(item.prom_type)==-1 || this.data.is_normal==1)) |
3447 | - that.check_is_youhui(gid, that.data.is_normal); | |
3447 | + that.check_is_youhui(gid, that.data.is_normal,1); | |
3448 | 3448 | |
3449 | 3449 | //默认门店要拿下门店库存 |
3450 | 3450 | if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1,2,4,6].indexOf(item.prom_type)==-1) { |
... | ... | @@ -7478,19 +7478,19 @@ Page({ |
7478 | 7478 | }) |
7479 | 7479 | }, |
7480 | 7480 | |
7481 | - //---检查有没有优惠活动--- | |
7482 | - check_is_youhui:async function (gid, is_nor) { | |
7481 | + //---检查有没有优惠活动--- is_nor的普通购买的时候,is_spec是切换规格的时候 | |
7482 | + check_is_youhui:async function (gid, is_nor,is_spec) { | |
7483 | 7483 | var th = this; |
7484 | 7484 | var user_id = getApp().globalData.user_id; |
7485 | 7485 | if (!user_id) user_id = 0; |
7486 | 7486 | |
7487 | 7487 | //普通购买的时候,重新算一下组合购有没有 |
7488 | - if(is_nor){ | |
7488 | + if(is_nor || is_spec){ | |
7489 | 7489 | var arr3=null; |
7490 | 7490 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; |
7491 | 7491 | var req_d = { |
7492 | 7492 | "store_id": os.stoid, |
7493 | - "goods_id": this.data.gid, | |
7493 | + "goods_id": gid, | |
7494 | 7494 | "user_id": user_id, |
7495 | 7495 | } |
7496 | 7496 | await getApp().request.promiseGet(url, { |
... | ... | @@ -7518,7 +7518,15 @@ Page({ |
7518 | 7518 | } |
7519 | 7519 | if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { |
7520 | 7520 | //-- 获取商品列表 -- |
7521 | - th.data.zh_act=e.data.data; | |
7521 | + | |
7522 | + if(is_spec){ | |
7523 | + th.setData({ | |
7524 | + zh_act:e.data.data | |
7525 | + }) | |
7526 | + }else{ | |
7527 | + th.data.zh_act=e.data.data; | |
7528 | + } | |
7529 | + | |
7522 | 7530 | th.getUserBuyPromNum(e.data.data.id) |
7523 | 7531 | } |
7524 | 7532 | } | ... | ... |