Commit 040cc6940b1ee8e2fc6088a4c39693f7c2c15df3

Authored by yvan.ni
1 parent bb8b2f72

团购商品指定会员参与

components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -444,8 +444,10 @@ Component({
444 444 for (var i in goods) {
445 445 var val = goods[i];
446 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 451 var url = "/api/weshop/activitylist/getGoodActInfo";
450 452 var req_data = {
451 453 store_id: os.stoid, goodsidlist: val.goods_id, is_detail: 1, user_id: user_id
... ... @@ -469,15 +471,15 @@ Component({
469 471 item.cardprice1 = val.cardprice1;
470 472 item.cardprice2 = val.cardprice2;
471 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 477 if (val.prom_price) item.prom_price = val.prom_price;
475 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 482 var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
480   -
481 483 var url = "";
482 484  
483 485 switch (prom_type) {
... ... @@ -487,7 +489,7 @@ Component({
487 489 url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id;
488 490 break;
489 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 493 break;
492 494 case 4:
493 495 url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id;
... ...
packageA/pages/cardList/cardList.js
... ... @@ -223,7 +223,7 @@ Page({
223 223 var req_d = {
224 224 "store_id": app.globalData.setting.stoid,
225 225 "goods_id": gid,
226   - "user_id": getApp().globalData.user_id,
  226 + "user_id": getApp().globalData.user_id || 0,
227 227 "goods_type":1
228 228 }
229 229 var res= await getApp().request.promiseGet(rurl, {data: req_d});
... ...
packageA/pages/distribution/goods/goods.wxml
... ... @@ -70,6 +70,7 @@
70 70  
71 71 <view class="content {{(options.index == 1 && currentTabIndex ==1) ? 'pdb0':''}}">
72 72 <checkbox-group class="fs26" wx:if="{{isShowRow}}" bindchange="checkboxChange">
  73 +
73 74 <view class="item bg-white flex ai-center pd16" wx:for="{{list.pageData}}">
74 75 <!-- <label>
75 76  
... ... @@ -225,7 +226,7 @@
225 226 <checkbox value="{{item.goods_id}}" checked="{{item.checked}}" data-name="checkbox" wx:if="{{!(options.index == 1 && currentTabIndex ==1)}}" />
226 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 230 <view class="flex xc-wc ai-center">
230 231 <text wx:if="{{item.prom_integral}}"><text class="fs30">{{item.prom_integral}}</text>积分</text>
231 232 <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
... ...
packageA/pages/distribution/shop/shop.js
... ... @@ -134,6 +134,7 @@ Page({
134 134 currentQuery: {
135 135 store_id: app.globalData.setting.stoid,
136 136 user_id: app.globalData.user_id,
  137 + isnewwhere:1
137 138 },
138 139 });
139 140 !this.data.is_router&&this.initData();
... ...
packageC/pages/group_list/group_list.js
... ... @@ -73,13 +73,16 @@ Page({
73 73 isLogin: true,
74 74 });
75 75  
  76 + let user_id=getApp().globalData.user_id || 0;
  77 +
76 78 let typeVal = this.data.type;
77 79 let url = '/api/weshop/goods/groupBuy/page';
78 80 let data = {
79 81 store_id: app.globalData.setting.stoid,
80 82 is_show: 1,
81 83 is_end: 0,
82   - timetype: typeVal
  84 + timetype: typeVal,
  85 + user_id:user_id
83 86 };
84 87  
85 88 this.setData({
... ...
packageC/pages/group_list/group_list.wxml
... ... @@ -46,6 +46,6 @@
46 46 <view style="height:60rpx"></view>
47 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 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 241 url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id;
242 242 break;
243 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 245 break;
246 246 case 4:
247 247 url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id;
... ... @@ -298,24 +298,24 @@ Page({
298 298 var prom = null;
299 299 if (res.data.code == 0 && res.data.data) {
300 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 321 if (!th.data.requestData) th.data.requestData = [];
... ...
packageG/pages/group_buy/goodsInfo/goodsInfo.js
... ... @@ -2929,7 +2929,7 @@ Page({
2929 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 2933 success: function (t) {
2934 2934 if (t.data.code != 0) {
2935 2935 ee.get_normal(gid);
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -1314,8 +1314,9 @@ Page({
1314 1314 setTimeout(() => {
1315 1315 console.log('cccc');
1316 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 3296 var goodsinfo = arrdata[i],
3296 3297 prom = null;
3297 3298  
  3299 +
  3300 +
3298 3301 if (goodsinfo.goods_id != g_id) {
3299 3302  
3300 3303  
  3304 + goodsinfo.prom_type=0;
  3305 + goodsinfo.prom_id=0;
  3306 +
  3307 +
3301 3308 //要判断一下商品的活动是不是多活动,确定一下商品的prom_type
3302 3309 var url = '/api/weshop/activitylist/listGoodActInfo2New';
3303 3310 var req_d = {
... ... @@ -3355,6 +3362,9 @@ Page({
3355 3362  
3356 3363 }else{
3357 3364  
  3365 + goodsinfo.prom_type=tt.data.prom_type;
  3366 + goodsinfo.prom_id=tt.data.prom_id;
  3367 +
3358 3368 //只有是普通商品的时候,才要给商品赋值指定门店
3359 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 420 var prom_id=item.prom_id;
421 421 var now=ut.gettimestamp();
422 422 var url = "";
  423 + var user_id=getApp().globalData.user_id;
  424 + if(!user_id) user_id=0;
  425 +
423 426 switch (prom_type){
424 427 case 1:
425   - var user_id=getApp().globalData.user_id;
426   - if(!user_id) user_id=0;
427 428 url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id;
428 429 break;
429 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 432 break;
432 433 case 4:
433 434 url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id;
... ...