Commit 24457634723a6418ee8982c742566860493fbe04

Authored by WXD-SEASON\season
2 parents 4a49c4ea 567644cf

合并fu43

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
... ... @@ -479,7 +481,6 @@ Component({
479 481 prom_id = item.prom_id;
480 482  
481 483 var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
482   -
483 484 var url = "";
484 485  
485 486 switch (prom_type) {
... ... @@ -489,7 +490,7 @@ Component({
489 490 url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id;
490 491 break;
491 492 case 2:
492   - url = "/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id
  493 + url = "/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + val.goods_id + "/" + prom_id+"/"+user_id;
493 494 break;
494 495 case 4:
495 496 url = "/api/weshop/integralbuy/get/" + os.stoid + "/" + prom_id;
... ... @@ -541,6 +542,9 @@ Component({
541 542 th.data.requestData.push(item);
542 543 })
543 544 } else {
  545 + item.prom_type = 0;
  546 + item.prom_id = 0;
  547 + item.prom_price = null;
544 548 th.data.requestData.push(item);
545 549 }
546 550 }
... ...
components/diy_serviceCard/diy_serviceCard.js
... ... @@ -508,6 +508,9 @@ Component({
508 508 case 1:
509 509 url+="&prom_type=1&prom_id="+arr[0].act_id;
510 510 break;
  511 + case 2:
  512 + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id="+gid+"&prom_id="+arr2[0].act_id;
  513 + break;
511 514 case 6:
512 515 url = `/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=${gid}&prom_type=${arr2[0].prom_type}&prom_id=${arr[0].act_id}`;
513 516 break;
... ...
packageA/pages/cardList/cardList.js
... ... @@ -57,6 +57,9 @@ Page({
57 57 let url = '/api/weshop/serviceCard/page';
58 58 let currentQuery = this.data.currentQuery;
59 59 if(app.globalData.userInfo) {
  60 +
  61 + currentQuery.user_id=app.globalData.user_id || 0;
  62 +
60 63 if(!this.data.isLogin) {
61 64 this.setData({
62 65 userInfo: app.globalData.userInfo,
... ... @@ -223,7 +226,7 @@ Page({
223 226 var req_d = {
224 227 "store_id": app.globalData.setting.stoid,
225 228 "goods_id": gid,
226   - "user_id": getApp().globalData.user_id,
  229 + "user_id": getApp().globalData.user_id || 0,
227 230 "goods_type":1
228 231 }
229 232 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();
... ...
packageA/pages/distribution/shop/shop.wxml
... ... @@ -235,7 +235,7 @@
235 235 <view class="pd20 fs26">
236 236 <view class="ellipsis-2 h68 mgb20">{{item.goods_name}}</view>
237 237 <!-- 判断是否有活动价 -->
238   - <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
  238 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0 && item.prom_type!=7 && item.prom_type!=10}}">
239 239 <view class="flex xc-wc">
240 240 <text wx:if="{{item.prom_integral}}">
241 241 <text class="fs30" style="font-weight: bold;">{{item.prom_integral}}</text>
... ...
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
... ... @@ -871,60 +871,63 @@ Page({
871 871 var boughtNum = 0;
872 872 var is_ok = 1;
873 873  
874   - // 获取redis当前可以购买的数量
875   - // 如果数量为0,设置和显示已抢光
876   - // 否则,进一步判断是否超出限购或超出库存
877   - await this.getactLen().then(async function (res) {
878   - redisNums = res;
879   - let curNum = th.data.goodsInputNum;
880   - // res: redis可购买数量
881   - console.log('当前可以购买的数量:', res);
882   - if (res <= 0) {
883   - // 可购买数量<=0, 设置和显示已抢光
884   - th.setData({
885   - prom_r_null: 1,
886   - });
887   - getApp().my_warnning('超出活动库存', 0, self);
888   - is_ok = 0;
889   - return false;
890   - } else {
891   -
892   - if(curNum>redisNums){
  874 + if(this.data.prom_type == 2) {
  875 +
  876 + // 获取redis当前可以购买的数量
  877 + // 如果数量为0,设置和显示已抢光
  878 + // 否则,进一步判断是否超出限购或超出库存
  879 + await this.getactLen().then(async function (res) {
  880 + redisNums = res;
  881 + let curNum = th.data.goodsInputNum;
  882 + // res: redis可购买数量
  883 + console.log('当前可以购买的数量:', res);
  884 + if (res <= 0) {
  885 + // 可购买数量<=0, 设置和显示已抢光
  886 + th.setData({
  887 + prom_r_null: 1,
  888 + });
893 889 getApp().my_warnning('超出活动库存', 0, self);
894 890 is_ok = 0;
895 891 return false;
896   - }
897   - // 可购买数量>0
898   - // 计算自己还可以购买的数量
899   - // 自己还可购买的数量c = 每人活动限购数量a - 自己已经购买的数量b
900   - // 如果限购数量a>redis可购买数量d,当增加数量t>d, 提示超出库存
901   - // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购
902   - let actInfo = th.data.sele_g;
903   - if(actInfo.buy_limit>0){
904   - await th.get_buy_num2().then(function (data) {
905   - let limited = actInfo.buy_limit; // 限购数量a
906   - let promcardbuynum = data.data.data.promcardbuynum;
907   - let canBuyNum = limited - promcardbuynum; // 自己还可购买的数量c
908   -
909   - limitNum = limited;
910   - boughtNum = promcardbuynum;
  892 + } else {
911 893  
912   - if (canBuyNum <= 0) {
913   - canBuyNum = 0;
914   - }
  894 + if (curNum > redisNums) {
  895 + getApp().my_warnning('超出活动库存', 0, self);
  896 + is_ok = 0;
  897 + return false;
  898 + }
  899 + // 可购买数量>0
  900 + // 计算自己还可以购买的数量
  901 + // 自己还可购买的数量c = 每人活动限购数量a - 自己已经购买的数量b
  902 + // 如果限购数量a>redis可购买数量d,当增加数量t>d, 提示超出库存
  903 + // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购
  904 + let actInfo = th.data.sele_g;
  905 + if (actInfo.buy_limit > 0) {
  906 + await th.get_buy_num2().then(function (data) {
  907 + let limited = actInfo.buy_limit; // 限购数量a
  908 + let promcardbuynum = data.data.data.promcardbuynum;
  909 + let canBuyNum = limited - promcardbuynum; // 自己还可购买的数量c
  910 +
  911 + limitNum = limited;
  912 + boughtNum = promcardbuynum;
  913 +
  914 + if (canBuyNum <= 0) {
  915 + canBuyNum = 0;
  916 + }
915 917  
916   - if (curNum > canBuyNum) {
917   - getApp().my_warnning('超出限购数量', 0, self);
918   - th.setData({
919   - goodsInputNum: canBuyNum || 1,
920   - });
921   - is_ok = 0;
922   - return false;
923   - }
924   - })
  918 + if (curNum > canBuyNum) {
  919 + getApp().my_warnning('超出限购数量', 0, self);
  920 + th.setData({
  921 + goodsInputNum: canBuyNum || 1,
  922 + });
  923 + is_ok = 0;
  924 + return false;
  925 + }
  926 + })
  927 + }
925 928 }
926   - }
927   - })
  929 + })
  930 + }
928 931  
929 932 if (!is_ok) return false;
930 933  
... ... @@ -2929,7 +2932,7 @@ Page({
2929 2932 prom_r_null: 1
2930 2933 });
2931 2934 //拿取价格并且判断时间--
2932   - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gid + "/" + prom_id, {
  2935 + getApp().request.get("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + gid + "/" + prom_id+"/"+user_id, {
2933 2936 success: function (t) {
2934 2937 if (t.data.code != 0) {
2935 2938 ee.get_normal(gid);
... ...
pages/goods/categoryList/categoryList.js
... ... @@ -1068,10 +1068,11 @@ Page({
1068 1068  
1069 1069 requestGoodsList: function (t) {
1070 1070 var that = this;
  1071 + var user=getApp().globalData.user_id || 0;
1071 1072 that.data.requestUrl = t;
1072 1073 console.error(666666);
1073   - e.get("/api/weshop/goods/page?1=1", {
1074   - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 },
  1074 + e.get("/api/weshop/goods/page?1=1&isnewwhere=1", {
  1075 + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1,user_id:user_id },
1075 1076 success: function (data) {
1076 1077 console.log(data.data.data.pageData)
1077 1078 that.setData({
... ... @@ -1173,8 +1174,9 @@ Page({
1173 1174 console.log("cid:=" + cid)
1174 1175 console.log("cid:=" + this.data.cat_id);
1175 1176 var s = this
1176   - e.get("/api/weshop/goods/page?1=1", {
1177   - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 },
  1177 + var user_id=getApp().globalData.user_id || 0;
  1178 + e.get("/api/weshop/goods/page?1=1&isnewwhere=1", {
  1179 + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1,user_id:user_id },
1178 1180 success: function (e) {
1179 1181 console.log('上拉加载。。。。。。。。。');
1180 1182 console.log(e.data.data.pageData)
... ...
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 //如果商品有设置分组
... ... @@ -4761,7 +4771,7 @@ Page({
4761 4771 prom_r_null: 1
4762 4772 });
4763 4773 //拿取价格并且判断时间--
4764   - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gid + "/" + prom_id, {
  4774 + getApp().request.get("/api/weshop/goods/groupBuy/getNewActInfo/" + os.stoid + "/" + gid + "/" + prom_id+"/"+user_id, {
4765 4775 success: function (t) {
4766 4776 if (t.data.code != 0) {
4767 4777 ee.get_normal(gid);
... ... @@ -9017,10 +9027,20 @@ Page({
9017 9027 },
9018 9028  
9019 9029 get_normal(gid) {
9020   - this.setData({
9021   - prom_type: 0,
9022   - isshow: 1,
9023   - });
  9030 +
  9031 + var set_ob={};
  9032 + if (this.data.data.pick_up_lists && this.data.data.pick_up_lists.length) {
  9033 + set_ob={
  9034 + ['data.pickup_ids']:this.data.data.pick_up_lists,
  9035 + ['sele_g.pickup_ids']:this.data.data.pick_up_lists,
  9036 + ['front_g.pickup_ids']:this.data.data.pick_up_lists,
  9037 + }
  9038 + }
  9039 + set_ob.prom_type= 0;
  9040 + set_ob.isshow=1;
  9041 + this.setData(set_ob);
  9042 +
  9043 +
9024 9044 this.get_sku(os.stoid, this.data.data, gid);
9025 9045 this.get_sto();
9026 9046 if (!this.data.data.whsle_id)
... ...
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;
... ...
pages/template/index.json
... ... @@ -27,7 +27,8 @@
27 27 "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow",
28 28 "floatingBox": "/components/diy_floatingBox/diy_floatingBox",
29 29 "div_tab_bar": "/custom-tab-bar/index",
30   - "presell": "/components/diy_pregoods/diy_pregoods"
  30 + "presell": "/components/diy_pregoods/diy_pregoods",
  31 + "serviceCard": "/components/diy_serviceCard/diy_serviceCard"
31 32 },
32 33 "enablePullDownRefresh": false,
33 34 "onReachBottomDistance":300,
... ...
pages/template/index.wxml
... ... @@ -177,6 +177,12 @@
177 177 <!-- <luckyGo object="{{item.content}}"></luckyGo> -->
178 178 <diy_public object="{{item.content}}" prom_type="9"></diy_public>
179 179 </block>
  180 +
  181 + <!-- 服务卡项 -->
  182 + <block wx:if="{{item.ename=='servicecategory'}}">
  183 + <serviceCard object="{{item.content}}" sticky="{{template_arr[0].content.is_top}}"></serviceCard>
  184 + </block>
  185 +
180 186 </view>
181 187  
182 188 </block>
... ...