Commit 84906cf3e2093f74e62fdd04166d026396b10d95
1 parent
04fa2399
服务卡项的优化
Showing
11 changed files
with
442 additions
and
235 deletions
components/serviceCard_list/serviceCard_list.js
... | ... | @@ -153,11 +153,11 @@ Component({ |
153 | 153 | }) |
154 | 154 | }, |
155 | 155 | |
156 | - go_url:function (e) { | |
156 | + go_url:async function (e) { | |
157 | 157 | var gid = e.currentTarget.dataset.gid; |
158 | 158 | var rurl = '/api/weshop/activitylist/listGoodActInfo2New'; |
159 | 159 | var req_d = { |
160 | - "store_id": app.globalData.setting.stoid, | |
160 | + "store_id": os.stoid, | |
161 | 161 | "goods_id": gid, |
162 | 162 | "user_id": getApp().globalData.user_id, |
163 | 163 | "goods_type":1 |
... | ... | @@ -192,7 +192,7 @@ Component({ |
192 | 192 | } |
193 | 193 | |
194 | 194 | |
195 | - app.goto(url); | |
195 | + getApp().goto(url); | |
196 | 196 | } |
197 | 197 | |
198 | 198 | }, | ... | ... |
packageA/pages/activity_share/activity_share.js
... | ... | @@ -171,6 +171,12 @@ Page({ |
171 | 171 | let goods_id = item.goods_id; |
172 | 172 | let price = item.presell_money; |
173 | 173 | let url = `packageC/pages/presell/goodsInfo/goodsInfo?goods_id=${goods_id}&pre_id=${pre_id}`; |
174 | + | |
175 | + //如果是服务卡项的时候 | |
176 | + if(item.goods_type==1){ | |
177 | + url = `packageC/pages/presell/cardInfo/goodsInfo?goods_id=${goods_id}&pre_id=${pre_id}`; | |
178 | + } | |
179 | + | |
174 | 180 | let title = item.goods_name; |
175 | 181 | let img = this.data.url + item.original_img; |
176 | 182 | let ind = 9; |
... | ... | @@ -240,26 +246,41 @@ Page({ |
240 | 246 | if(item){ |
241 | 247 | var price = item.price; |
242 | 248 | if(!price) price=item.shop_price; |
249 | + item.prom_id=item.id; | |
250 | + var url=''; | |
251 | + | |
243 | 252 | switch(th.data.currentIndex){ |
244 | - case 0: item.prom_type=1;break; | |
245 | - case 1: item.prom_type=6;break; | |
246 | - case 2: | |
247 | - if(th.data.currentIndex2==1) item.prom_type = 5; | |
248 | - if(th.data.currentIndex2==2) { | |
249 | - item.prom_type = 3; | |
250 | - item.id=item.prom_id; | |
251 | - }; | |
252 | - break; | |
253 | - case 5: | |
254 | - item.prom_type = 2; | |
255 | - break; | |
256 | - } | |
253 | + case 0: | |
254 | + item.prom_type=1; | |
255 | + //服务卡项的时候 | |
256 | + if(item.goods_type>0) | |
257 | + url="/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type=1&prom_id="+item.prom_id; | |
258 | + break; | |
259 | + case 1: | |
260 | + item.prom_type=6; | |
261 | + //服务卡项的时候 | |
262 | + if(item.goods_type>0) | |
263 | + url="/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; | |
264 | + break; | |
265 | + case 2: | |
266 | + if(th.data.currentIndex2==1) item.prom_type = 5; | |
267 | + if(th.data.currentIndex2==2) { | |
268 | + item.prom_type = 3; | |
269 | + item.id=item.prom_id; | |
270 | + } | |
271 | + break; | |
272 | + case 5: | |
273 | + item.prom_type = 2; | |
274 | + //服务卡项的时候 | |
275 | + if(item.goods_type>0) | |
276 | + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_id="+item.prom_id; | |
277 | + break; | |
278 | + } | |
257 | 279 | |
258 | - item.prom_id=item.id; | |
259 | 280 | |
260 | 281 | var title= item.goods_name; |
261 | 282 | var img=this.data.url+item.original_img; |
262 | - var url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; | |
283 | + if(!url) url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id+"&prom_type="+item.prom_type+"&prom_id="+item.prom_id; | |
263 | 284 | if(getApp().globalData.user_id){ |
264 | 285 | url+="&first_leader="+getApp().globalData.user_id; |
265 | 286 | } |
... | ... | @@ -689,15 +710,53 @@ Page({ |
689 | 710 | that.setData({ |
690 | 711 | canvasHidden: false,share_hidden:1 |
691 | 712 | }) |
692 | - | |
693 | - var app = getApp(); | |
694 | - var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | |
713 | + | |
714 | + var app = getApp(); | |
715 | + var unit = that.data.screenWidth / 750 * 1.35; //基础单位, | |
695 | 716 | |
696 | 717 | var prom_type=0; |
697 | 718 | var prom_id=th.data.share_good.id; |
719 | + | |
720 | + var scene=''; | |
721 | + var goods_path='pages/goods/goodsInfo/goodsInfo'; | |
722 | + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0; | |
723 | + | |
698 | 724 | switch(th.data.currentIndex){ |
699 | - case 0: prom_type=1;break; | |
700 | - case 1: prom_type=6;break; | |
725 | + case 0: | |
726 | + prom_type=1; | |
727 | + //服务卡项的时候 | |
728 | + if(th.data.share_good.goods_type>0){ | |
729 | + | |
730 | + scene = th.data.share_good.goods_id; | |
731 | + if (user_id > 0) { | |
732 | + scene += "_" + user_id; | |
733 | + }else{ | |
734 | + scene += "_0"; | |
735 | + } | |
736 | + scene += "_0"; | |
737 | + scene += "_" + 1+"_"+prom_id; | |
738 | + | |
739 | + goods_path='packageA/pages/goodsInfo/goodsInfo'; | |
740 | + | |
741 | + } | |
742 | + break; | |
743 | + case 1: | |
744 | + prom_type=6; | |
745 | + //服务卡项的时候 | |
746 | + if(th.data.share_good.goods_type>0){ | |
747 | + | |
748 | + scene =th.data.share_good.goods_id+''; | |
749 | + if (user_id > 0) { | |
750 | + scene += "_" + user_id; | |
751 | + }else{ | |
752 | + scene += "_0"; | |
753 | + } | |
754 | + scene += "_0"; | |
755 | + scene += "_6"; | |
756 | + scene += "_"+prom_id; | |
757 | + goods_path='packageA/pages/serviceCard_pd/goodsInfo/goodsInfo'; | |
758 | + } | |
759 | + break; | |
701 | 760 | case 2: |
702 | 761 | if(th.data.currentIndex2==1) prom_type = 5; |
703 | 762 | if(th.data.currentIndex2==2){ |
... | ... | @@ -705,23 +764,43 @@ Page({ |
705 | 764 | prom_id=th.data.share_good.prom_id; |
706 | 765 | } |
707 | 766 | break; |
708 | - } | |
767 | + case 5: | |
768 | + prom_type = 2; | |
769 | + //服务卡项的时候 | |
770 | + if(th.data.share_good.goods_type>0){ | |
709 | 771 | |
772 | + scene =th.data.share_good.goods_id+''; | |
773 | + if (user_id > 0) { | |
774 | + scene += "_" + user_id; | |
775 | + }else{ | |
776 | + scene += "_0"; | |
777 | + } | |
778 | + scene += "_0"; | |
779 | + scene += "_" +prom_id; | |
780 | + | |
781 | + goods_path='packageG/pages/group_buy/goodsInfo/goodsInfo'; | |
710 | 782 | |
783 | + } | |
784 | + break | |
785 | + } | |
711 | 786 | |
712 | - var scene = th.data.share_good.goods_id+""; | |
713 | - scene+="."+prom_type+"."+prom_id; | |
714 | 787 | |
715 | - var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; | |
716 | - if(user_id>0){ | |
717 | - scene+="_"+user_id; | |
788 | + if(!scene){ | |
789 | + scene = th.data.share_good.goods_id+""+"."+prom_type+"."+prom_id; | |
790 | + if(user_id>0){ | |
791 | + scene+="_"+user_id; | |
792 | + } | |
718 | 793 | } |
719 | - | |
794 | + | |
795 | + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
796 | + os.stoid + "?sceneValue=" + scene + "&pageValue="+goods_path; | |
797 | + | |
798 | + console.log(path3); | |
799 | + | |
720 | 800 | var ind=3; |
721 | 801 | if(that.data.currentIndex==1){ |
722 | 802 | ind=4; |
723 | 803 | } |
724 | - | |
725 | 804 | //-- 价格 -- |
726 | 805 | var pri0 = th.data.share_good.shop_price; |
727 | 806 | if (th.data.share_good.price) |
... | ... | @@ -732,10 +811,6 @@ Page({ |
732 | 811 | th.insert_act_share(th.data.share_good.title,th.data.share_good.id,ind,th.data.share_good.goods_sn,pri0); //插入分享 |
733 | 812 | } |
734 | 813 | |
735 | - ///二微码 | |
736 | - var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + | |
737 | - os.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; | |
738 | - | |
739 | 814 | //读取文件成功则OK-- |
740 | 815 | wx.getImageInfo({ |
741 | 816 | src: path3, |
... | ... | @@ -1306,23 +1381,49 @@ Page({ |
1306 | 1381 | go_goods: function (e) { |
1307 | 1382 | var index = e.currentTarget.dataset.index; |
1308 | 1383 | var item = this.data.list[index]; |
1309 | - var url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
1384 | + var url=''; | |
1310 | 1385 | |
1311 | - switch(this.data.currentIndex){ | |
1312 | - case 0: item.prom_type = 1;break; | |
1313 | - case 1: item.prom_type = 6;break; | |
1386 | + switch (this.data.currentIndex) { | |
1387 | + case 0: | |
1388 | + item.prom_type = 1; | |
1389 | + break; | |
1390 | + case 1: | |
1391 | + item.prom_type = 6; | |
1392 | + break; | |
1314 | 1393 | case 2: |
1315 | - if(th.data.currentIndex2==1) item.prom_type = 5; | |
1316 | - if(th.data.currentIndex2==2) item.prom_type = 3; | |
1394 | + if (th.data.currentIndex2 == 1) item.prom_type = 5; | |
1395 | + if (th.data.currentIndex2 == 2) item.prom_type = 3; | |
1317 | 1396 | break; |
1318 | 1397 | case 5: |
1319 | - item.prom_type = 2;break; | |
1398 | + item.prom_type = 2; | |
1399 | + break; | |
1320 | 1400 | } |
1321 | 1401 | |
1322 | - item.prom_id = item.id; | |
1323 | - url+="&prom_type="+item.prom_type+"&prom_id="+item.prom_id | |
1402 | + item.prom_id = item.id; | |
1324 | 1403 | |
1325 | - getApp().goto(url); | |
1404 | + //-- 秒杀,拼单,团购,预售 -- | |
1405 | + if(item.goods_type>0){ | |
1406 | + switch (item.prom_type){ | |
1407 | + case 1: //秒杀 | |
1408 | + url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
1409 | + break; | |
1410 | + case 2: //团购 | |
1411 | + url = '/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id=' + item.goods_id; | |
1412 | + break; | |
1413 | + case 6: //拼单 | |
1414 | + url="/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=" + item.goods_id | |
1415 | + break; | |
1416 | + case 8: //预售 | |
1417 | + url = `pageValue=packageC/pages/presell/cardInfo/goodsInfo?goods_id=${item.goods_id}&pre_id=${item.id}`; | |
1418 | + break; | |
1419 | + } | |
1420 | + | |
1421 | + | |
1422 | + }else { | |
1423 | + url = "/pages/goods/goodsInfo/goodsInfo?goods_id=" + item.goods_id; | |
1424 | + } | |
1425 | + url += "&prom_type=" + item.prom_type + "&prom_id=" + item.prom_id | |
1426 | + getApp().goto(url); | |
1326 | 1427 | }, |
1327 | 1428 | |
1328 | 1429 | go_coll_good:function(e){ | ... | ... |
packageA/pages/cart2_ser/cart2_ser.js
... | ... | @@ -535,7 +535,7 @@ Page({ |
535 | 535 | return false; |
536 | 536 | } |
537 | 537 | |
538 | - if (gg.prom_type == 1 && gg.is_pd_normal == 0) { | |
538 | + if ((gg.prom_type == 1 && gg.is_pd_normal == 0) || gg.prom_type == 2) { | |
539 | 539 | // 秒杀活动购买 |
540 | 540 | var goods = { |
541 | 541 | 'card_id': gg.service_id, |
... | ... | @@ -565,7 +565,6 @@ Page({ |
565 | 565 | if(getApp().globalData.skinface_id){ |
566 | 566 | goods.skinface_id=getApp().globalData.skinface_id; |
567 | 567 | } |
568 | - | |
569 | 568 | |
570 | 569 | //--导购分享过来的id-- |
571 | 570 | if (gg.guide_id) { |
... | ... | @@ -579,10 +578,11 @@ Page({ |
579 | 578 | goods.guide_sn = res.data.data.salesman_no; |
580 | 579 | } |
581 | 580 | }) |
582 | - } | |
583 | - if (gg.groupchat_id) { | |
584 | - goods.groupchat_id=gg.groupchat_id | |
585 | - } | |
581 | + } | |
582 | + | |
583 | + if (gg.groupchat_id) { | |
584 | + goods.groupchat_id=gg.groupchat_id | |
585 | + } | |
586 | 586 | item.list.push(goods); |
587 | 587 | } |
588 | 588 | } |
... | ... | @@ -619,23 +619,23 @@ Page({ |
619 | 619 | |
620 | 620 | //--导购分享过来的id-- |
621 | 621 | if (gg.guide_id) { |
622 | - goods.guide_id = gg.guide_id; | |
623 | - goods.guide_type = gg.guide_type; | |
624 | - //调用接口判断是不是会员 | |
625 | - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then( | |
626 | - res => { | |
627 | - if (res.data.code == 0) { | |
628 | - goods.guide_name = res.data.data.salesman; | |
629 | - goods.guide_sn = res.data.data.salesman_no; | |
630 | - } | |
631 | - }) | |
632 | - } | |
633 | - | |
634 | - if(gg.groupchat_id){ | |
635 | - goods.groupchat_id=gg.groupchat_id | |
636 | - } | |
637 | - console.log('goooooooooooooooooods', goods); | |
638 | - item.list.push(goods); | |
622 | + goods.guide_id = gg.guide_id; | |
623 | + goods.guide_type = gg.guide_type; | |
624 | + //调用接口判断是不是会员 | |
625 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then( | |
626 | + res => { | |
627 | + if (res.data.code == 0) { | |
628 | + goods.guide_name = res.data.data.salesman; | |
629 | + goods.guide_sn = res.data.data.salesman_no; | |
630 | + } | |
631 | + }) | |
632 | + } | |
633 | + | |
634 | + if(gg.groupchat_id){ | |
635 | + goods.groupchat_id=gg.groupchat_id | |
636 | + } | |
637 | + console.log('goooooooooooooooooods', goods); | |
638 | + item.list.push(goods); | |
639 | 639 | } |
640 | 640 | |
641 | 641 | |
... | ... | @@ -835,4 +835,37 @@ Page({ |
835 | 835 | }, |
836 | 836 | |
837 | 837 | |
838 | + //立即购买的点击跳转 | |
839 | + go_view(){ | |
840 | + if(!this.data.postdata.prom_type) this.data.postdata.prom_type=0; | |
841 | + let url='packageA/pages/goodsInfo/goodsInfo?goods_id='+this.data.postdata.id; | |
842 | + switch(this.data.postdata.prom_type){ | |
843 | + case 1: | |
844 | + url+= '&prom_id='+this.data.postdata.prom_id+'&prom_type=1'; | |
845 | + break; | |
846 | + case 2: | |
847 | + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id="+this.data.postdata.id+"&prom_id="+this.data.postdata.prom_id; | |
848 | + break | |
849 | + } | |
850 | + getApp().goto(url); | |
851 | + }, | |
852 | + | |
853 | + //购物车购买的点击跳转 | |
854 | + go_cart_view(e){ | |
855 | + let idx = e.currentTarget.dataset.idx; | |
856 | + let pidx=e.currentTarget.dataset.pidx; | |
857 | + let item=this.data.cartlist[pidx].goods[idx]; | |
858 | + let url='packageA/pages/goodsInfo/goodsInfo?goods_id='+this.data.postdata.id; | |
859 | + switch(item.prom_type){ | |
860 | + case 1: | |
861 | + url+= '&prom_id='+item.prom_id+'&prom_type=1'; | |
862 | + break; | |
863 | + case 2: | |
864 | + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id="+item.service_id+"&prom_id="+item.prom_id; | |
865 | + break | |
866 | + } | |
867 | + getApp().goto(url); | |
868 | + | |
869 | + } | |
870 | + | |
838 | 871 | }); | ... | ... |
packageA/pages/cart2_ser/cart2_ser.wxml
... | ... | @@ -10,14 +10,14 @@ |
10 | 10 | <!-- <view>门店:{{item.pname}}</view> --> |
11 | 11 | <view>{{item.pname}}</view> |
12 | 12 | </view> |
13 | - <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> | |
13 | + <view class="order-detail" bindtap="go_cart_view" data-idx="{{idx}}" data-pidx="{{pidx}}" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> | |
14 | 14 | <!----商品图片-----> |
15 | 15 | <view class="goods-img" style="position: relative"> |
16 | 16 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
17 | 17 | <image class="wh100 bdr14" src="{{items.img_url}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].img_url'></image> |
18 | 18 | </view> |
19 | 19 | <!----商品名称规格----> |
20 | - <navigator class="order-cont" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}"> | |
20 | + <navigator class="order-cont"> | |
21 | 21 | <view class="goods-name ellipsis-2">{{items.service_name}}</view> |
22 | 22 | <!-----商品名称规格------> |
23 | 23 | <view class="order-num flex-space-between"> |
... | ... | @@ -33,12 +33,12 @@ |
33 | 33 | <block wx:else> |
34 | 34 | <view class="use-item bfff bdr_t-14 mgt20"> |
35 | 35 | <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view> |
36 | - <view class="order-detail"> | |
36 | + <view class="order-detail" bindtap="go_view"> | |
37 | 37 | <view class="goods-img"> |
38 | 38 | <image class="wh100 bdr14" src="{{bn_goods.original_img}}" |
39 | 39 | binderror='cart_set_err' data-err="bn_goods.original_img"></image> |
40 | 40 | </view> |
41 | - <navigator class="order-cont" url="/packageA/goodsInfo/goodsInfo?goods_id={{bn_goods.id}}"> | |
41 | + <navigator class="order-cont"> | |
42 | 42 | <view class="goods-name ellipsis-2">{{bn_goods.serviceName}}</view> |
43 | 43 | <!-- 商品属性 --> |
44 | 44 | <!-- <view class="flex-vertical fs28 color-gray n_guige"> --> | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -265,8 +265,13 @@ Page({ |
265 | 265 | }; |
266 | 266 | |
267 | 267 | if(gid_str.length>3 && gid_str[3] && parseInt(gid_str[3])>0) { |
268 | - prom_type=gid_str[3]; | |
269 | - prom_id=gid_str[4]; | |
268 | + prom_type= parseInt(gid_str[3]); | |
269 | + prom_id=parseInt(gid_str[4]); | |
270 | + | |
271 | + th.setData({ | |
272 | + 'options.prom_type':prom_type, | |
273 | + 'options.prom_id':prom_id | |
274 | + }) | |
270 | 275 | } |
271 | 276 | |
272 | 277 | }; | ... | ... |
packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js
... | ... | @@ -267,10 +267,12 @@ Page({ |
267 | 267 | if (gid_str.length > 2 && gid_str[2]) { |
268 | 268 | room_id = parseInt(gid_str[2]); |
269 | 269 | room_user_share = 1; |
270 | - | |
271 | 270 | that.data.options.room_id=room_id; |
271 | + } | |
272 | + if (gid_str.length > 3 && gid_str[3]){ | |
272 | 273 | that.data.options.prom_type= parseInt(gid_str[3]); |
273 | 274 | that.data.options.prom_id=parseInt(gid_str[4]); |
275 | + | |
274 | 276 | } |
275 | 277 | |
276 | 278 | this.setData({options: that.data.options}); | ... | ... |
packageE/pages/cart/cart2/zh_calculate.js
packageG/pages/group_buy/goodsInfo/goodsInfo.js
... | ... | @@ -887,39 +887,39 @@ Page({ |
887 | 887 | is_ok = 0; |
888 | 888 | return false; |
889 | 889 | } else { |
890 | + | |
891 | + if(curNum>redisNums){ | |
892 | + getApp().my_warnning('超出活动库存', 0, self); | |
893 | + is_ok = 0; | |
894 | + return false; | |
895 | + } | |
890 | 896 | // 可购买数量>0 |
891 | 897 | // 计算自己还可以购买的数量 |
892 | 898 | // 自己还可购买的数量c = 每人活动限购数量a - 自己已经购买的数量b |
893 | 899 | // 如果限购数量a>redis可购买数量d,当增加数量t>d, 提示超出库存 |
894 | 900 | // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 |
895 | 901 | let actInfo = th.data.sele_g; |
896 | - await th.get_buy_num2().then(function (data) { | |
897 | - let limited = actInfo.buy_limit == 0 ? 100000 : actInfo.buy_limit; // 限购数量a | |
898 | - let promcardbuynum = data.data.data.promcardbuynum; | |
899 | - let buyedNum = promcardbuynum; // 自己已经购买的数量b | |
900 | - let canBuyNum = limited - buyedNum; // 自己还可购买的数量c | |
901 | - limitNum = limited; | |
902 | - boughtNum = buyedNum; | |
903 | - | |
904 | - if (canBuyNum <= 0) { | |
905 | - canBuyNum = 0; | |
906 | - } | |
902 | + if(actInfo.buy_limit>0){ | |
903 | + await th.get_buy_num2().then(function (data) { | |
904 | + let limited = actInfo.buy_limit; // 限购数量a | |
905 | + let promcardbuynum = data.data.data.promcardbuynum; | |
906 | + let canBuyNum = limited - promcardbuynum; // 自己还可购买的数量c | |
907 | 907 | |
908 | - if (canBuyNum > res) { | |
909 | - if (curNum > res) { // t当前增减的数量 | |
910 | - // wx.showModal({ | |
911 | - // title: '超出活动库存', | |
912 | - // }); | |
913 | - getApp().my_warnning('超出活动库存', 0, self); | |
914 | - th.setData({ | |
915 | - goodsInputNum: res || 1 | |
916 | - }); | |
917 | - is_ok = 0; | |
918 | - return false; | |
908 | + limitNum = limited; | |
909 | + boughtNum = promcardbuynum; | |
910 | + | |
911 | + if (canBuyNum <= 0) { | |
912 | + canBuyNum = 0; | |
913 | + } | |
914 | + if (canBuyNum > res) { | |
915 | + getApp().my_warnning('超出活动库存', 0, self); | |
916 | + th.setData({ | |
917 | + goodsInputNum: res || 1 | |
918 | + }); | |
919 | + is_ok = 0; | |
920 | + return false; | |
919 | 921 | } |
920 | - } | |
921 | 922 | |
922 | - if (canBuyNum <= res) { | |
923 | 923 | if (curNum > canBuyNum) { |
924 | 924 | getApp().my_warnning('超出限购数量', 0, self); |
925 | 925 | th.setData({ |
... | ... | @@ -928,9 +928,8 @@ Page({ |
928 | 928 | is_ok = 0; |
929 | 929 | return false; |
930 | 930 | } |
931 | - } | |
932 | - }) | |
933 | - | |
931 | + }) | |
932 | + } | |
934 | 933 | } |
935 | 934 | }) |
936 | 935 | |
... | ... | @@ -986,114 +985,41 @@ Page({ |
986 | 985 | //----先看会员在购物车中是否加入了该商品----- |
987 | 986 | getApp().request.get("/api/weshop/cartService/page", { |
988 | 987 | data: { |
989 | - store_id: os.stoid, | |
990 | - user_id: oo.user_id, | |
991 | - service_id: th.data.data.id, | |
988 | + store_id: os.stoid, | |
989 | + user_id: oo.user_id, | |
990 | + service_id: th.data.data.id, | |
991 | + pick_id: th.data.sto_sele_id | |
992 | 992 | }, |
993 | 993 | success: function (re) { |
994 | 994 | //-------如果购物车中有相关的数据--------- |
995 | - if (re.data.data.total > 0) { | |
995 | + if (ut.ajax_ok(re)) { | |
996 | 996 | var item = null; |
997 | 997 | // 多门店问题 |
998 | 998 | var cartGoodsNum = 0; |
999 | 999 | const tmpObj = re.data.data.pageData; |
1000 | 1000 | for (let i = 0; i < tmpObj.length; i++) { |
1001 | - if (th.data.sto_sele_id != tmpObj[i].pick_id) { | |
1001 | + if (tmpObj[i].prom_id == th.data.prom_id && tmpObj[i].prom_type==2) { | |
1002 | 1002 | cartGoodsNum += parseInt(tmpObj[i].goods_num); |
1003 | - } else { | |
1004 | - item = tmpObj[i]; | |
1005 | 1003 | } |
1006 | 1004 | } |
1007 | - // 当前门店同类商品还没加入到购物车 但是有其他门店的同类商品 | |
1008 | - if (th.data.prom_type == 1 && !th.data.is_normal && !item) { | |
1009 | - | |
1010 | - // 秒杀购物车购买 修正数量 | |
1011 | - var snum = limitNum - boughtNum; | |
1012 | - if (snum <= 0) { | |
1013 | - // wx.showModal({ | |
1014 | - // title: '超出限购数量', | |
1015 | - // }); | |
1016 | - getApp().my_warnning('超出限购数量', 0, self); | |
1017 | - return false; | |
1018 | - } | |
1019 | - | |
1020 | - var cSnum = snum - cartGoodsNum <= 0 ? 0 : snum - cartGoodsNum; | |
1021 | - var cRedisNums = redisNums - cartGoodsNum <= 0 ? 0 : redisNums - cartGoodsNum; | |
1022 | - | |
1023 | - if (newd['goods_num'] >= redisNums) { | |
1024 | - if (redisNums > snum) { | |
1025 | - newd['goods_num'] = cSnum; | |
1026 | - } else { | |
1027 | - newd['goods_num'] = cRedisNums; | |
1028 | - } | |
1029 | - } else { | |
1030 | - if (newd['goods_num'] > snum) newd['goods_num'] = cSnum; | |
1031 | - } | |
1032 | - | |
1033 | - if (newd['goods_num'] <= 0) { | |
1034 | - getApp().my_warnning('加入购物车成功', 1, th, 450); | |
1035 | - th.closeSpecModal(); | |
1036 | - return false; | |
1037 | - } | |
1038 | - getApp().request.post("/api/weshop/cartService/save", { | |
1039 | - data: newd, | |
1040 | - success: function (t) { | |
1041 | - getApp().my_warnning('加入购物车成功', 1, th, 450); | |
1042 | - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; | |
1043 | - th.setData({ | |
1044 | - cartGoodsNum: c_num | |
1045 | - }); | |
1046 | - th.closeSpecModal(); | |
1047 | - } | |
1048 | - }); | |
1005 | + // 以下为当前门店同类商品已经加入到购物车 | |
1006 | + var totalNum = th.data.goodsInputNum + cartGoodsNum | |
1007 | + var snum = limitNum - boughtNum-totalNum; | |
1008 | + if (snum < 0 && limitNum>0 ) { | |
1009 | + getApp().my_warnning('购物车已经购买了该商品,超出活动限购数量', 0, self); | |
1049 | 1010 | return false; |
1050 | 1011 | } |
1051 | - | |
1052 | - // 以下为当前门店同类商品已经加入到购物车 | |
1053 | - var totalNum = th.data.goodsInputNum + item.goods_num; | |
1054 | - | |
1055 | - // 秒杀购物车购买 修正数量 | |
1056 | - if (th.data.prom_type == 1 && !th.data.is_normal) { | |
1057 | - var snum = limitNum - boughtNum; | |
1058 | - if (snum <= 0) { | |
1059 | - // wx.showModal({ | |
1060 | - // title: '超出限购数量', | |
1061 | - // }); | |
1062 | - getApp().my_warnning('超出限购数量', 0, self); | |
1063 | - return false; | |
1064 | - } | |
1065 | - if (totalNum >= redisNums) { | |
1066 | - if (redisNums > snum) { | |
1067 | - totalNum = snum - cartGoodsNum; | |
1068 | - } else { | |
1069 | - totalNum = redisNums - cartGoodsNum; | |
1070 | - } | |
1071 | - } else { | |
1072 | - if (totalNum > snum) | |
1073 | - totalNum = snum - cartGoodsNum; | |
1074 | - } | |
1012 | + if (totalNum >= redisNums) { | |
1013 | + getApp().my_warnning('购物车已经购买了该商品,超出活动数量', 0, self); | |
1014 | + return false; | |
1075 | 1015 | } |
1076 | - | |
1077 | 1016 | var updata = { |
1078 | 1017 | id: item.id, |
1079 | 1018 | goods_num: totalNum, |
1080 | 1019 | money: th.data.data.shop_price, |
1081 | 1020 | store_id: os.stoid, |
1082 | 1021 | }; |
1083 | - | |
1084 | - // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价 | |
1085 | - if (th.data.options.prom_type == 1) { | |
1086 | - // updata['prom_type'] = th.data.options.prom_type; | |
1087 | - // updata['prom_id'] = th.data.options.prom_id; | |
1088 | - if (th.data.openSpecModal_flash_normal) { | |
1089 | - updata['money'] = th.data.data.shop_price; | |
1090 | - updata['is_pd_normal'] = 1; | |
1091 | - } else { | |
1092 | - updata['money'] = th.data.prom_price; | |
1093 | - } | |
1094 | - ; | |
1095 | - } | |
1096 | - ; | |
1022 | + updata['money'] = th.data.prom_price; | |
1097 | 1023 | |
1098 | 1024 | if (getApp().globalData.guide_id) { |
1099 | 1025 | updata['guide_id'] = getApp().globalData.guide_id; |
... | ... | @@ -1468,7 +1394,7 @@ Page({ |
1468 | 1394 | } |
1469 | 1395 | |
1470 | 1396 | |
1471 | - var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + th.data.gid; | |
1397 | + var url = "/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id=" + th.data.gid+"&prom_id="+th.data.prom_id; | |
1472 | 1398 | if (getApp().globalData.user_id) { |
1473 | 1399 | url += "&first_leader=" + getApp().globalData.user_id; |
1474 | 1400 | } |
... | ... | @@ -3449,14 +3375,13 @@ Page({ |
3449 | 3375 | if (!user_id) scene += "_0"; |
3450 | 3376 | scene += "_0"; |
3451 | 3377 | } |
3452 | - if (this.data.prom_type) { | |
3453 | - scene += "_" + this.data.prom_type + "_" + th.data.prom_id; | |
3378 | + if (this.data.prom_id) { | |
3379 | + scene += "_" + th.data.prom_id; | |
3454 | 3380 | } |
3455 | 3381 | |
3456 | - | |
3457 | 3382 | ///二微码 |
3458 | 3383 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
3459 | - os.stoid + "?sceneValue=" + scene + "&pageValue=packageA/pages/goodsInfo/goodsInfo"; | |
3384 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageG/pages/group_buy/goodsInfo/goodsInfo"; | |
3460 | 3385 | |
3461 | 3386 | |
3462 | 3387 | console.log(path3); |
... | ... | @@ -3799,12 +3724,12 @@ Page({ |
3799 | 3724 | scene += "_0"; |
3800 | 3725 | } |
3801 | 3726 | if (this.data.prom_type) { |
3802 | - scene += "_" + this.data.prom_type + "_" + th.data.prom_id; | |
3727 | + scene += "_" + th.data.prom_id; | |
3803 | 3728 | } |
3804 | 3729 | |
3805 | 3730 | ///二微码 |
3806 | 3731 | var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" + |
3807 | - os.stoid + "?sceneValue=" + scene + "&pageValue=packageA/pages/goodsInfo/goodsInfo"; | |
3732 | + os.stoid + "?sceneValue=" + scene + "&pageValue=packageG/pages/group_buy/goodsInfo/goodsInfo"; | |
3808 | 3733 | |
3809 | 3734 | console.log(path3); |
3810 | 3735 | ... | ... |
packageG/pages/group_buy/goodsInfo/goodsInfo.wxml
... | ... | @@ -517,7 +517,7 @@ |
517 | 517 | <view class="shopping-cart cart-ico new_split pdh20"> |
518 | 518 | <navigator open-type="switchTab" url="/pages/cart/cart/cart" style="text-align: center"> |
519 | 519 | <image class="sc-img" src="{{iurl}}/miniapp/images/shopping-cart.png"></image> |
520 | - <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view> | |
520 | +<!-- <view class="cart-num ellipsis-1"> {{cartGoodsNum}} </view>--> | |
521 | 521 | <view>购物车</view> |
522 | 522 | </navigator> |
523 | 523 | </view> | ... | ... |
pages/cart/cart/cart.js
... | ... | @@ -1029,15 +1029,33 @@ Page({ |
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
1032 | - if (item.prom_type == 1) { | |
1032 | + | |
1033 | + //秒杀和团购都能加入购物车 | |
1034 | + if( [1,2].indexOf(item.prom_type)) { | |
1033 | 1035 | var prom = null; |
1034 | 1036 | var now = ut.gettimestamp(); |
1035 | - await getApp().request.promiseGet('/api/ms/flash_sale/getNew/' + os.stoid + '/' + user_id + '/' + item.prom_id, {}).then(res => { | |
1036 | - if (res.data.code == 0) { | |
1037 | - prom = res.data.data; | |
1038 | - prom.price = prom.user_price; | |
1039 | - } | |
1040 | - }); | |
1037 | + | |
1038 | + //获取秒杀 | |
1039 | + if(item.prom_type==1) { | |
1040 | + await getApp().request.promiseGet('/api/ms/flash_sale/getNew/' + os.stoid + '/' + user_id + '/' + item.prom_id, {}).then(res => { | |
1041 | + if (res.data.code == 0) { | |
1042 | + prom = res.data.data; | |
1043 | + prom.price = prom.user_price; | |
1044 | + } | |
1045 | + }); | |
1046 | + } | |
1047 | + | |
1048 | + //获取团购 | |
1049 | + if(item.prom_type==2) { | |
1050 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + item.service_id + "/" + item.prom_id, {}).then(res => { | |
1051 | + if (res.data.code == 0) { | |
1052 | + prom = res.data.data; | |
1053 | + } | |
1054 | + }); | |
1055 | + } | |
1056 | + | |
1057 | + | |
1058 | + | |
1041 | 1059 | console.log('服务的秒杀信息') |
1042 | 1060 | console.log(prom) |
1043 | 1061 | //---如果互动都已经过期,或者还未开始,或者无活动 |
... | ... | @@ -3104,9 +3122,9 @@ Page({ |
3104 | 3122 | [txt]: t.goods_num |
3105 | 3123 | }); |
3106 | 3124 | |
3107 | - // 1.秒杀活动 | |
3125 | + // 1.秒杀活动 ,团购的活动 | |
3108 | 3126 | // 2.活动开始 |
3109 | - if (t.prom_type == 1 && t.is_pd_normal == 0) { | |
3127 | + if((t.prom_type == 1 && t.is_pd_normal == 0) || t.prom_type==2) { | |
3110 | 3128 | var txt = "service_data[" + pitem + "].goods[" + item + "].goods_num"; |
3111 | 3129 | var redis_num = 0; |
3112 | 3130 | |
... | ... | @@ -3119,7 +3137,6 @@ Page({ |
3119 | 3137 | if (t.id != v.id) { |
3120 | 3138 | cartGoodsNum += parseInt(v.goods_num); |
3121 | 3139 | } |
3122 | - | |
3123 | 3140 | }); |
3124 | 3141 | } |
3125 | 3142 | }); |
... | ... | @@ -3157,15 +3174,26 @@ Page({ |
3157 | 3174 | |
3158 | 3175 | // 限购数量 |
3159 | 3176 | var buylimit = 0 |
3160 | - await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, { | |
3177 | + if(t.prom_type==1) { | |
3178 | + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + t.store_id + "/" + getApp().globalData.user_id + "/" + t.prom_id, {}).then(res => { | |
3179 | + if (res.data.code == 0) { | |
3180 | + th.data.sele_g = res.data.data; | |
3181 | + th.data.sele_g.viplimited = res.data.data.buy_limit; | |
3182 | + buylimit = !res.data.data.buy_limit ? 0 : res.data.data.buy_limit; | |
3183 | + } | |
3184 | + }); | |
3185 | + } | |
3186 | + | |
3187 | + if(t.prom_type==2) { | |
3188 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + t.goods_id + "/" + t.prom_id, {}).then(res => { | |
3189 | + if (res.data.code == 0) { | |
3190 | + th.data.sele_g = res.data.data; | |
3191 | + th.data.sele_g.viplimited = res.data.data.buy_limit; | |
3192 | + buylimit = !res.data.data.buy_limit ? 0 : res.data.data.buy_limit; | |
3193 | + } | |
3194 | + }); | |
3195 | + } | |
3161 | 3196 | |
3162 | - }).then(res => { | |
3163 | - if (res.data.code == 0) { | |
3164 | - th.data.sele_g = res.data.data; | |
3165 | - th.data.sele_g.viplimited = res.data.data.buy_limit; | |
3166 | - buylimit = !res.data.data.buy_limit ? 0 : res.data.data.buy_limit; | |
3167 | - }; | |
3168 | - }); | |
3169 | 3197 | |
3170 | 3198 | //用户已经成功付款购买的数量 |
3171 | 3199 | var gd_buy_num = 0; |
... | ... | @@ -3176,8 +3204,8 @@ Page({ |
3176 | 3204 | promcardbuynum: !tt.data.data.promcardbuynum ? 0 : tt.data.data.promcardbuynum, |
3177 | 3205 | cardbuynum: tt.data.data.cardbuynum, |
3178 | 3206 | }); |
3179 | - }; | |
3180 | - }); | |
3207 | + } | |
3208 | + }) | |
3181 | 3209 | |
3182 | 3210 | // 剩余购买数 |
3183 | 3211 | let num = buylimit - gd_buy_num; |
... | ... | @@ -4065,35 +4093,105 @@ Page({ |
4065 | 4093 | } |
4066 | 4094 | } else { |
4067 | 4095 | |
4096 | + //进行累计,秒杀和团购的购买数量 | |
4097 | + var flash_map = {}; | |
4098 | + var group_map = {}; | |
4099 | + | |
4068 | 4100 | //-- 开始服务卡的购物车购买 -- |
4069 | 4101 | for (var i = 0; i < this.data.service_data.length; i++) { |
4070 | 4102 | var i_arr = this.data.service_data[i].goods; |
4071 | 4103 | console.log(i_arr) |
4072 | 4104 | |
4073 | 4105 | for (var j = 0; j < i_arr.length; j++) { |
4074 | - await rq.promisePut("/api/weshop/cartService/update", { | |
4075 | - data: { | |
4076 | - id: i_arr[j].id, | |
4077 | - selected: i_arr[j].selected, | |
4078 | - store_id: oo.stoid | |
4106 | + await rq.promisePut("/api/weshop/cartService/update", { | |
4107 | + data: { | |
4108 | + id: i_arr[j].id, | |
4109 | + selected: i_arr[j].selected, | |
4110 | + store_id: oo.stoid | |
4111 | + } | |
4112 | + }); | |
4113 | + | |
4114 | + //判断秒杀的指定门店 | |
4115 | + if( [1,2].includes(i_arr[j].prom_type) && i_arr[j].prom && i_arr[j].prom.pick_up_lists && i_arr[j].selected){ | |
4116 | + var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){ | |
4117 | + return e.pickup_id==i_arr[j].pick_id; | |
4118 | + }) | |
4119 | + if(idx0<0){ | |
4120 | + getApp().confirmBox(i_arr[j].service_name + "秒杀活动的门店不可售"); | |
4121 | + th.clear_checkouting(); | |
4122 | + return false; | |
4123 | + } | |
4079 | 4124 | } |
4080 | - }); | |
4081 | 4125 | |
4126 | + //选中的情况下才进行计算 | |
4127 | + if(i_arr[j].selected) { | |
4128 | + //进行秒杀和团购的累计 | |
4129 | + switch (i_arr[j].prom_type) { | |
4130 | + case 1: | |
4131 | + if (!flash_map[i_arr[j].prom_id]) { | |
4132 | + flash_map[i_arr[j].prom_id] = {prom: i_arr[j].prom, num: i_arr[j].goods_num}; | |
4133 | + } else { | |
4134 | + flash_map[i_arr[j].prom_id].num += i_arr[j].goods_num; | |
4135 | + } | |
4136 | + break; | |
4137 | + case 2: | |
4138 | + if (!group_map[i_arr[j].prom_id]) { | |
4139 | + group_map[i_arr[j].prom_id] = {prom: i_arr[j].prom, num: i_arr[j].goods_num}; | |
4140 | + } else { | |
4141 | + group_map[i_arr[j].prom_id].num += i_arr[j].goods_num; | |
4142 | + } | |
4143 | + break; | |
4144 | + } | |
4145 | + } | |
4146 | + } | |
4147 | + } | |
4082 | 4148 | |
4083 | - //判断秒杀的指定门店 | |
4084 | - if(i_arr[j].prom_type==1 && i_arr[j].prom && i_arr[j].prom.pick_up_lists && i_arr[j].selected){ | |
4085 | - var idx0=i_arr[j].prom.pick_up_lists.findIndex(function (e){ | |
4086 | - return e.pickup_id==i_arr[j].pick_id; | |
4087 | - }) | |
4088 | - if(idx0<0){ | |
4089 | - getApp().confirmBox(i_arr[j].service_name + "秒杀活动的门店不可售"); | |
4149 | + //判断flash_map是不是空,同时判断flash prom.buy_limit | |
4150 | + if(Object.keys(flash_map).length>0){ | |
4151 | + for(let i in flash_map){ | |
4152 | + if(flash_map[i].num>flash_map[i].prom.buy_limit && flash_map[i].prom.buy_limit>0){ | |
4153 | + getApp().confirmBox(flash_map[i].prom.title + "秒杀活动的超出活动限购"); | |
4154 | + th.clear_checkouting(); | |
4155 | + return false; | |
4156 | + } | |
4157 | + let redis_num=0; | |
4158 | + //获取当前商品活动库存 | |
4159 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +oo.stoid + "/1/" + i, { | |
4160 | + 1: 1 | |
4161 | + }).then(res => { | |
4162 | + redis_num = res.data.data; | |
4163 | + }); | |
4164 | + if(flash_map[i].num>redis_num){ | |
4165 | + getApp().confirmBox(flash_map[i].prom.title + "秒杀活动的超出活动数量"); | |
4166 | + th.clear_checkouting(); | |
4167 | + return false; | |
4168 | + } | |
4169 | + } | |
4170 | + } | |
4171 | + //group_map,同时判断group prom.buy_limit | |
4172 | + if(Object.keys(group_map).length>0){ | |
4173 | + for(let jg in group_map){ | |
4174 | + if(group_map[jg].num>group_map[jg].prom.buy_limit && group_map[jg].prom.buy_limit>0){ | |
4175 | + getApp().confirmBox(group_map[jg].prom.title + "团购活动的超出活动限购"); | |
4176 | + th.clear_checkouting(); | |
4177 | + return false; | |
4178 | + } | |
4179 | + let redis_num=0; | |
4180 | + //获取当前商品活动库存 | |
4181 | + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +oo.stoid+ "/2/" + jg, { | |
4182 | + 1: 1 | |
4183 | + }).then(res => { | |
4184 | + redis_num = res.data.data; | |
4185 | + }); | |
4186 | + if(group_map[jg].num>redis_num){ | |
4187 | + getApp().confirmBox(group_map[jg].prom.title + "团购活动的超出活动数量"); | |
4090 | 4188 | th.clear_checkouting(); |
4091 | 4189 | return false; |
4092 | 4190 | } |
4093 | - } | |
4094 | 4191 | } |
4095 | 4192 | } |
4096 | 4193 | |
4194 | + | |
4097 | 4195 | //排除失效服务结算 |
4098 | 4196 | this.data.invalidList.map(item => { |
4099 | 4197 | if (item.selected && item.classType == 1) { |
... | ... | @@ -5662,7 +5760,51 @@ Page({ |
5662 | 5760 | |
5663 | 5761 | |
5664 | 5762 | |
5763 | + }, | |
5764 | + | |
5765 | + async go_card(e){ | |
5766 | + var gid=e.currentTarget.dataset.gid; | |
5767 | + var rurl = '/api/weshop/activitylist/listGoodActInfo2New'; | |
5768 | + var req_d = { | |
5769 | + "store_id": app.globalData.setting.stoid, | |
5770 | + "goods_id": gid, | |
5771 | + "user_id": getApp().globalData.user_id, | |
5772 | + "goods_type":1 | |
5773 | + } | |
5774 | + var res= await getApp().request.promiseGet(rurl, {data: req_d}); | |
5775 | + | |
5776 | + var url = "/packageA/pages/goodsInfo/goodsInfo?goods_id=" + gid; | |
5777 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
5778 | + var arr = res.data.data; | |
5779 | + let times = new Date().getTime(); | |
5780 | + //-- 预热也要计算 -- | |
5781 | + var arr2 = arr.filter(function (e) { | |
5782 | + return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) | |
5783 | + }) | |
5784 | + if(arr2.length==1) { | |
5785 | + switch(arr2[0].prom_type){ | |
5786 | + case 1: | |
5787 | + url+="&prom_type=1&prom_id="+arr2[0].act_id; | |
5788 | + break; | |
5789 | + case 2: | |
5790 | + url="/packageG/pages/group_buy/goodsInfo/goodsInfo?goods_id="+gid+"&prom_id="+arr2[0].act_id; | |
5791 | + break; | |
5792 | + case 6: | |
5793 | + url = `/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo?goods_id=${gid}&prom_type=${arr2[0].prom_type}&prom_id=${arr2[0].act_id}`; | |
5794 | + break; | |
5795 | + case 8: | |
5796 | + url = `/packageC/pages/presell/cardInfo/goodsInfo?goods_id=${gid}&prom_id=${arr2[0].act_id}`; | |
5797 | + break; | |
5798 | + } | |
5799 | + } | |
5800 | + | |
5801 | + } | |
5802 | + | |
5803 | + | |
5804 | + app.goto(url); | |
5805 | + | |
5665 | 5806 | } |
5666 | 5807 | |
5667 | 5808 | |
5809 | + | |
5668 | 5810 | }); |
5669 | 5811 | \ No newline at end of file | ... | ... |
pages/cart/cart/cart.wxml
... | ... | @@ -284,13 +284,13 @@ |
284 | 284 | </block> |
285 | 285 | |
286 | 286 | |
287 | - <navigator class="goods-img rel" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}"> | |
287 | + <navigator class="goods-img rel" bindtap="go_card" data-gid="{{items.service_id}}"> | |
288 | 288 | <image class="wh100" src="{{items.img_url}}" binderror="bind_bnerr2" data-errorimg="service_data[{{pidx}}].goods[{{idx}}].img_url" data-url="{{items.img_url}}"></image> |
289 | 289 | |
290 | 290 | </navigator> |
291 | 291 | <view class="goods-cont"> |
292 | 292 | <view class="goods-name"> |
293 | - <navigator class="ellipsis-2 fs30" url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{items.service_id}}">{{items.service_name}}</navigator> | |
293 | + <navigator class="ellipsis-2 fs30" bindtap="go_card" data-gid="{{items.service_id}}">{{items.service_name}}</navigator> | |
294 | 294 | <block wx:if="{{items.is_gift}}"> |
295 | 295 | <view>{{items.goods_num}}件</view> |
296 | 296 | </block> | ... | ... |