diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index 3e652a1..e2e09f2 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -444,8 +444,10 @@ Component({ for (var i in goods) { var val = goods[i]; var item = {}; - var prom_id = null; - + var prom_id = null; + + item.prom_type = 0; + item.prom_id = 0; var url = "/api/weshop/activitylist/getGoodActInfo"; var req_data = { store_id: os.stoid, goodsidlist: val.goods_id, is_detail: 1, user_id: user_id @@ -469,15 +471,15 @@ Component({ item.cardprice1 = val.cardprice1; item.cardprice2 = val.cardprice2; item.cardprice3 = val.cardprice3; - item.prom_type = val.prom_type; - item.prom_id = val.prom_id; + //item.prom_type = val.prom_type; + //item.prom_id = val.prom_id; + if (val.prom_price) item.prom_price = val.prom_price; if (val.prom_integral) item.prom_integral = val.prom_integral; - prom_id = val.prom_id; + prom_id = item.prom_id; var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购 - var url = ""; switch (prom_type) { @@ -487,7 +489,7 @@ Component({ url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id; break; case 2: - url = "/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id + url = "/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id+"/"+user_id; break; case 4: url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id; diff --git a/packageA/pages/cardList/cardList.js b/packageA/pages/cardList/cardList.js index 69e7c4d..e488c9d 100644 --- a/packageA/pages/cardList/cardList.js +++ b/packageA/pages/cardList/cardList.js @@ -223,7 +223,7 @@ Page({ var req_d = { "store_id": app.globalData.setting.stoid, "goods_id": gid, - "user_id": getApp().globalData.user_id, + "user_id": getApp().globalData.user_id || 0, "goods_type":1 } var res= await getApp().request.promiseGet(rurl, {data: req_d}); diff --git a/packageA/pages/distribution/goods/goods.wxml b/packageA/pages/distribution/goods/goods.wxml index 49b2c1a..97c5478 100644 --- a/packageA/pages/distribution/goods/goods.wxml +++ b/packageA/pages/distribution/goods/goods.wxml @@ -70,6 +70,7 @@ + - + {{item.prom_integral}}积分 + diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index 02fecd0..6ac4d41 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -134,6 +134,7 @@ Page({ currentQuery: { store_id: app.globalData.setting.stoid, user_id: app.globalData.user_id, + isnewwhere:1 }, }); !this.data.is_router&&this.initData(); diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js index 2cb2e9b..185fadb 100644 --- a/packageC/pages/group_list/group_list.js +++ b/packageC/pages/group_list/group_list.js @@ -73,13 +73,16 @@ Page({ isLogin: true, }); + let user_id=getApp().globalData.user_id || 0; + let typeVal = this.data.type; let url = '/api/weshop/goods/groupBuy/page'; let data = { store_id: app.globalData.setting.stoid, is_show: 1, is_end: 0, - timetype: typeVal + timetype: typeVal, + user_id:user_id }; this.setData({ diff --git a/packageC/pages/group_list/group_list.wxml b/packageC/pages/group_list/group_list.wxml index 8e5c92e..8925dc4 100644 --- a/packageC/pages/group_list/group_list.wxml +++ b/packageC/pages/group_list/group_list.wxml @@ -46,6 +46,6 @@ - + diff --git a/packageG/pages/goods/search/search.js b/packageG/pages/goods/search/search.js index b5778d4..34574cf 100644 --- a/packageG/pages/goods/search/search.js +++ b/packageG/pages/goods/search/search.js @@ -241,7 +241,7 @@ Page({ url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id; break; case 2: - url = "/api/weshop/goods/groupBuy/getActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id + url = "/api/weshop/goods/groupBuy/getNewActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id+"/"+user_id; break; case 4: url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id; @@ -298,24 +298,24 @@ Page({ var prom = null; if (res.data.code == 0 && res.data.data) { prom = res.data.data; - - if (prom != null && prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom_type!=2 && prom.show_time && prom.show_time < now))) { - item.prom_price = res.data.data.price; - if(prom_type==4){ - item.prom_price= res.data.data.addmoney; - } - - if (res.data.data.user_price) item.prom_price = res.data.data.user_price; - var vNum = prom.virtual_num ? prom.virtual_num : 0; - var vNum1 = prom.virtualNum ? prom.virtualNum : 0; - var vNum2 = prom.virtual ? prom.virtual : 0; - item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2); - } else { - item.prom_type = 0; - item.prom_id = 0; - item.prom_price = null; + } + if (prom != null && prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom_type!=2 && prom.show_time && prom.show_time < now))) { + item.prom_price = res.data.data.price; + if(prom_type==4){ + item.prom_price= res.data.data.addmoney; } + + if (res.data.data.user_price) item.prom_price = res.data.data.user_price; + var vNum = prom.virtual_num ? prom.virtual_num : 0; + var vNum1 = prom.virtualNum ? prom.virtualNum : 0; + var vNum2 = prom.virtual ? prom.virtual : 0; + item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2); + } else { + item.prom_type = 0; + item.prom_id = 0; + item.prom_price = null; } + }) }; if (!th.data.requestData) th.data.requestData = []; diff --git a/packageG/pages/group_buy/goodsInfo/goodsInfo.js b/packageG/pages/group_buy/goodsInfo/goodsInfo.js index d44d951..b1cb093 100644 --- a/packageG/pages/group_buy/goodsInfo/goodsInfo.js +++ b/packageG/pages/group_buy/goodsInfo/goodsInfo.js @@ -2929,7 +2929,7 @@ Page({ prom_r_null: 1 }); //拿取价格并且判断时间-- - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gid + "/" + prom_id, { + getApp().request.get("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + gid + "/" + prom_id+"/"+user_id, { success: function (t) { if (t.data.code != 0) { ee.get_normal(gid); diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 0678602..da6d5b1 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1314,8 +1314,9 @@ Page({ setTimeout(() => { console.log('cccc'); console.log(th.data.prom_type); + console.log(th.data.sele_g); - }, 500) + }, 1500) @@ -3295,9 +3296,15 @@ Page({ var goodsinfo = arrdata[i], prom = null; + + if (goodsinfo.goods_id != g_id) { + goodsinfo.prom_type=0; + goodsinfo.prom_id=0; + + //要判断一下商品的活动是不是多活动,确定一下商品的prom_type var url = '/api/weshop/activitylist/listGoodActInfo2New'; var req_d = { @@ -3355,6 +3362,9 @@ Page({ }else{ + goodsinfo.prom_type=tt.data.prom_type; + goodsinfo.prom_id=tt.data.prom_id; + //只有是普通商品的时候,才要给商品赋值指定门店 if ([1, 2, 4, 6, 8, 9].indexOf(parseInt(this.data.prom_type)) <0 || is_normal) { //如果商品有设置分组 diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index a65e9c4..1d139b6 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -420,14 +420,15 @@ Page({ var prom_id=item.prom_id; var now=ut.gettimestamp(); var url = ""; + var user_id=getApp().globalData.user_id; + if(!user_id) user_id=0; + switch (prom_type){ case 1: - var user_id=getApp().globalData.user_id; - if(!user_id) user_id=0; url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id; break; case 2: - url ="/api/weshop/goods/groupBuy/getActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id + url ="/api/weshop/goods/groupBuy/getNewActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id+"/"+user_id; break; case 4: url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id;