Commit 040cc6940b1ee8e2fc6088a4c39693f7c2c15df3
1 parent
bb8b2f72
团购商品指定会员参与
Showing
10 changed files
with
51 additions
and
33 deletions
components/diy_goodsGroup/diy_goodsGroup.js
@@ -444,8 +444,10 @@ Component({ | @@ -444,8 +444,10 @@ Component({ | ||
444 | for (var i in goods) { | 444 | for (var i in goods) { |
445 | var val = goods[i]; | 445 | var val = goods[i]; |
446 | var item = {}; | 446 | var item = {}; |
447 | - var prom_id = null; | ||
448 | - | 447 | + var prom_id = null; |
448 | + | ||
449 | + item.prom_type = 0; | ||
450 | + item.prom_id = 0; | ||
449 | var url = "/api/weshop/activitylist/getGoodActInfo"; | 451 | var url = "/api/weshop/activitylist/getGoodActInfo"; |
450 | var req_data = { | 452 | var req_data = { |
451 | store_id: os.stoid, goodsidlist: val.goods_id, is_detail: 1, user_id: user_id | 453 | store_id: os.stoid, goodsidlist: val.goods_id, is_detail: 1, user_id: user_id |
@@ -469,15 +471,15 @@ Component({ | @@ -469,15 +471,15 @@ Component({ | ||
469 | item.cardprice1 = val.cardprice1; | 471 | item.cardprice1 = val.cardprice1; |
470 | item.cardprice2 = val.cardprice2; | 472 | item.cardprice2 = val.cardprice2; |
471 | item.cardprice3 = val.cardprice3; | 473 | item.cardprice3 = val.cardprice3; |
472 | - item.prom_type = val.prom_type; | ||
473 | - item.prom_id = val.prom_id; | 474 | + //item.prom_type = val.prom_type; |
475 | + //item.prom_id = val.prom_id; | ||
476 | + | ||
474 | if (val.prom_price) item.prom_price = val.prom_price; | 477 | if (val.prom_price) item.prom_price = val.prom_price; |
475 | if (val.prom_integral) item.prom_integral = val.prom_integral; | 478 | if (val.prom_integral) item.prom_integral = val.prom_integral; |
476 | 479 | ||
477 | - prom_id = val.prom_id; | 480 | + prom_id = item.prom_id; |
478 | 481 | ||
479 | var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购 | 482 | var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购 |
480 | - | ||
481 | var url = ""; | 483 | var url = ""; |
482 | 484 | ||
483 | switch (prom_type) { | 485 | switch (prom_type) { |
@@ -487,7 +489,7 @@ Component({ | @@ -487,7 +489,7 @@ Component({ | ||
487 | url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id; | 489 | url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id; |
488 | break; | 490 | break; |
489 | case 2: | 491 | case 2: |
490 | - url = "/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id | 492 | + url = "/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id+"/"+user_id; |
491 | break; | 493 | break; |
492 | case 4: | 494 | case 4: |
493 | url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id; | 495 | url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id; |
packageA/pages/cardList/cardList.js
@@ -223,7 +223,7 @@ Page({ | @@ -223,7 +223,7 @@ Page({ | ||
223 | var req_d = { | 223 | var req_d = { |
224 | "store_id": app.globalData.setting.stoid, | 224 | "store_id": app.globalData.setting.stoid, |
225 | "goods_id": gid, | 225 | "goods_id": gid, |
226 | - "user_id": getApp().globalData.user_id, | 226 | + "user_id": getApp().globalData.user_id || 0, |
227 | "goods_type":1 | 227 | "goods_type":1 |
228 | } | 228 | } |
229 | var res= await getApp().request.promiseGet(rurl, {data: req_d}); | 229 | var res= await getApp().request.promiseGet(rurl, {data: req_d}); |
packageA/pages/distribution/goods/goods.wxml
@@ -70,6 +70,7 @@ | @@ -70,6 +70,7 @@ | ||
70 | 70 | ||
71 | <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}"> | 71 | <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}"> |
72 | <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange"> | 72 | <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange"> |
73 | + | ||
73 | <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}"> | 74 | <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}"> |
74 | <!-- <label> | 75 | <!-- <label> |
75 | 76 | ||
@@ -225,7 +226,7 @@ | @@ -225,7 +226,7 @@ | ||
225 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}" /> | 226 | <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}" /> |
226 | <view> | 227 | <view> |
227 | <!-- 判断是否有活动价 --> | 228 | <!-- 判断是否有活动价 --> |
228 | - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0 }}"> | 229 | + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10 }}"> |
229 | <view class="flex xc-wc ai-center"> | 230 | <view class="flex xc-wc ai-center"> |
230 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> | 231 | <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text> |
231 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> | 232 | <text wx:if="{{item.prom_integral && item.prom_price}}">+</text> |
packageA/pages/distribution/shop/shop.js
@@ -134,6 +134,7 @@ Page({ | @@ -134,6 +134,7 @@ Page({ | ||
134 | currentQuery: { | 134 | currentQuery: { |
135 | store_id: app.globalData.setting.stoid, | 135 | store_id: app.globalData.setting.stoid, |
136 | user_id: app.globalData.user_id, | 136 | user_id: app.globalData.user_id, |
137 | + isnewwhere:1 | ||
137 | }, | 138 | }, |
138 | }); | 139 | }); |
139 | !this.data.is_router&&this.initData(); | 140 | !this.data.is_router&&this.initData(); |
packageC/pages/group_list/group_list.js
@@ -73,13 +73,16 @@ Page({ | @@ -73,13 +73,16 @@ Page({ | ||
73 | isLogin: true, | 73 | isLogin: true, |
74 | }); | 74 | }); |
75 | 75 | ||
76 | + let user_id=getApp().globalData.user_id || 0; | ||
77 | + | ||
76 | let typeVal = this.data.type; | 78 | let typeVal = this.data.type; |
77 | let url = '/api/weshop/goods/groupBuy/page'; | 79 | let url = '/api/weshop/goods/groupBuy/page'; |
78 | let data = { | 80 | let data = { |
79 | store_id: app.globalData.setting.stoid, | 81 | store_id: app.globalData.setting.stoid, |
80 | is_show: 1, | 82 | is_show: 1, |
81 | is_end: 0, | 83 | is_end: 0, |
82 | - timetype: typeVal | 84 | + timetype: typeVal, |
85 | + user_id:user_id | ||
83 | }; | 86 | }; |
84 | 87 | ||
85 | this.setData({ | 88 | this.setData({ |
packageC/pages/group_list/group_list.wxml
@@ -46,6 +46,6 @@ | @@ -46,6 +46,6 @@ | ||
46 | <view style="height:60rpx"></view> | 46 | <view style="height:60rpx"></view> |
47 | </view> | 47 | </view> |
48 | 48 | ||
49 | -<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.length >= 0 && noMore }}">—— 已经到底啦 ——</view> | 49 | +<view class="no-more" hidden="{{!noMore}}" wx:if="{{list.length > 0 && noMore }}">—— 已经到底啦 ——</view> |
50 | <nodata nodataContainer="t-c" wx:if="{{list.length == 0 && is_get}}"></nodata> | 50 | <nodata nodataContainer="t-c" wx:if="{{list.length == 0 && is_get}}"></nodata> |
51 | 51 |
packageG/pages/goods/search/search.js
@@ -241,7 +241,7 @@ Page({ | @@ -241,7 +241,7 @@ Page({ | ||
241 | url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id; | 241 | url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id; |
242 | break; | 242 | break; |
243 | case 2: | 243 | case 2: |
244 | - url = "/api/weshop/goods/groupBuy/getActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id | 244 | + url = "/api/weshop/goods/groupBuy/getNewActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id+"/"+user_id; |
245 | break; | 245 | break; |
246 | case 4: | 246 | case 4: |
247 | url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id; | 247 | url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id; |
@@ -298,24 +298,24 @@ Page({ | @@ -298,24 +298,24 @@ Page({ | ||
298 | var prom = null; | 298 | var prom = null; |
299 | if (res.data.code == 0 && res.data.data) { | 299 | if (res.data.code == 0 && res.data.data) { |
300 | prom = res.data.data; | 300 | prom = res.data.data; |
301 | - | ||
302 | - 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))) { | ||
303 | - item.prom_price = res.data.data.price; | ||
304 | - if(prom_type==4){ | ||
305 | - item.prom_price= res.data.data.addmoney; | ||
306 | - } | ||
307 | - | ||
308 | - if (res.data.data.user_price) item.prom_price = res.data.data.user_price; | ||
309 | - var vNum = prom.virtual_num ? prom.virtual_num : 0; | ||
310 | - var vNum1 = prom.virtualNum ? prom.virtualNum : 0; | ||
311 | - var vNum2 = prom.virtual ? prom.virtual : 0; | ||
312 | - item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2); | ||
313 | - } else { | ||
314 | - item.prom_type = 0; | ||
315 | - item.prom_id = 0; | ||
316 | - item.prom_price = null; | 301 | + } |
302 | + 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))) { | ||
303 | + item.prom_price = res.data.data.price; | ||
304 | + if(prom_type==4){ | ||
305 | + item.prom_price= res.data.data.addmoney; | ||
317 | } | 306 | } |
307 | + | ||
308 | + if (res.data.data.user_price) item.prom_price = res.data.data.user_price; | ||
309 | + var vNum = prom.virtual_num ? prom.virtual_num : 0; | ||
310 | + var vNum1 = prom.virtualNum ? prom.virtualNum : 0; | ||
311 | + var vNum2 = prom.virtual ? prom.virtual : 0; | ||
312 | + item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2); | ||
313 | + } else { | ||
314 | + item.prom_type = 0; | ||
315 | + item.prom_id = 0; | ||
316 | + item.prom_price = null; | ||
318 | } | 317 | } |
318 | + | ||
319 | }) | 319 | }) |
320 | }; | 320 | }; |
321 | if (!th.data.requestData) th.data.requestData = []; | 321 | if (!th.data.requestData) th.data.requestData = []; |
packageG/pages/group_buy/goodsInfo/goodsInfo.js
@@ -2929,7 +2929,7 @@ Page({ | @@ -2929,7 +2929,7 @@ Page({ | ||
2929 | prom_r_null: 1 | 2929 | prom_r_null: 1 |
2930 | }); | 2930 | }); |
2931 | //拿取价格并且判断时间-- | 2931 | //拿取价格并且判断时间-- |
2932 | - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gid + "/" + prom_id, { | 2932 | + getApp().request.get("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + gid + "/" + prom_id+"/"+user_id, { |
2933 | success: function (t) { | 2933 | success: function (t) { |
2934 | if (t.data.code != 0) { | 2934 | if (t.data.code != 0) { |
2935 | ee.get_normal(gid); | 2935 | ee.get_normal(gid); |
pages/goods/goodsInfo/goodsInfo.js
@@ -1314,8 +1314,9 @@ Page({ | @@ -1314,8 +1314,9 @@ Page({ | ||
1314 | setTimeout(() => { | 1314 | setTimeout(() => { |
1315 | console.log('cccc'); | 1315 | console.log('cccc'); |
1316 | console.log(th.data.prom_type); | 1316 | console.log(th.data.prom_type); |
1317 | + console.log(th.data.sele_g); | ||
1317 | 1318 | ||
1318 | - }, 500) | 1319 | + }, 1500) |
1319 | 1320 | ||
1320 | 1321 | ||
1321 | 1322 | ||
@@ -3295,9 +3296,15 @@ Page({ | @@ -3295,9 +3296,15 @@ Page({ | ||
3295 | var goodsinfo = arrdata[i], | 3296 | var goodsinfo = arrdata[i], |
3296 | prom = null; | 3297 | prom = null; |
3297 | 3298 | ||
3299 | + | ||
3300 | + | ||
3298 | if (goodsinfo.goods_id != g_id) { | 3301 | if (goodsinfo.goods_id != g_id) { |
3299 | 3302 | ||
3300 | 3303 | ||
3304 | + goodsinfo.prom_type=0; | ||
3305 | + goodsinfo.prom_id=0; | ||
3306 | + | ||
3307 | + | ||
3301 | //要判断一下商品的活动是不是多活动,确定一下商品的prom_type | 3308 | //要判断一下商品的活动是不是多活动,确定一下商品的prom_type |
3302 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; | 3309 | var url = '/api/weshop/activitylist/listGoodActInfo2New'; |
3303 | var req_d = { | 3310 | var req_d = { |
@@ -3355,6 +3362,9 @@ Page({ | @@ -3355,6 +3362,9 @@ Page({ | ||
3355 | 3362 | ||
3356 | }else{ | 3363 | }else{ |
3357 | 3364 | ||
3365 | + goodsinfo.prom_type=tt.data.prom_type; | ||
3366 | + goodsinfo.prom_id=tt.data.prom_id; | ||
3367 | + | ||
3358 | //只有是普通商品的时候,才要给商品赋值指定门店 | 3368 | //只有是普通商品的时候,才要给商品赋值指定门店 |
3359 | if ([1, 2, 4, 6, 8, 9].indexOf(parseInt(this.data.prom_type)) <0 || is_normal) { | 3369 | if ([1, 2, 4, 6, 8, 9].indexOf(parseInt(this.data.prom_type)) <0 || is_normal) { |
3360 | //如果商品有设置分组 | 3370 | //如果商品有设置分组 |
pages/goods/goodsList/goodsList.js
@@ -420,14 +420,15 @@ Page({ | @@ -420,14 +420,15 @@ Page({ | ||
420 | var prom_id=item.prom_id; | 420 | var prom_id=item.prom_id; |
421 | var now=ut.gettimestamp(); | 421 | var now=ut.gettimestamp(); |
422 | var url = ""; | 422 | var url = ""; |
423 | + var user_id=getApp().globalData.user_id; | ||
424 | + if(!user_id) user_id=0; | ||
425 | + | ||
423 | switch (prom_type){ | 426 | switch (prom_type){ |
424 | case 1: | 427 | case 1: |
425 | - var user_id=getApp().globalData.user_id; | ||
426 | - if(!user_id) user_id=0; | ||
427 | url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id; | 428 | url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id; |
428 | break; | 429 | break; |
429 | case 2: | 430 | case 2: |
430 | - url ="/api/weshop/goods/groupBuy/getActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id | 431 | + url ="/api/weshop/goods/groupBuy/getNewActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id+"/"+user_id; |
431 | break; | 432 | break; |
432 | case 4: | 433 | case 4: |
433 | url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id; | 434 | url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id; |