Commit e2b56ccdc1115fc1d9204c1374fd072562f2f943
1 parent
9dae48af
OA单,117504 商家希望可以根据代金券设置的使用范围,在范围内的商品商品详情才可以显示到优惠券,如果不在使用范围的不显示
Showing
5 changed files
with
137 additions
and
21 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -714,7 +714,7 @@ Page({ |
714 | 714 | data: { |
715 | 715 | store_id: os.stoid, |
716 | 716 | type: 1, |
717 | - pageSize: 3, | |
717 | + pageSize: 100, | |
718 | 718 | page: 1, |
719 | 719 | is_share: 0, |
720 | 720 | }, |
... | ... | @@ -722,7 +722,24 @@ Page({ |
722 | 722 | fir_quan = res1.data.data.pageData; |
723 | 723 | }) |
724 | 724 | } |
725 | - | |
725 | + //过滤不是本商品的单品优惠券------------------- | |
726 | + if(fir_quan.length > 0 ){ | |
727 | + let goodInfo = ee.data.data | |
728 | + for (let index = fir_quan.length-1; index >= 0; index--) { | |
729 | + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 | |
730 | + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { | |
731 | + fir_quan.splice(index,1) | |
732 | + } | |
733 | + } | |
734 | + } | |
735 | + } | |
736 | + let arr=[] | |
737 | + let length = fir_quan.length | |
738 | + if (length <= 3) { | |
739 | + arr=fir_quan | |
740 | + }else{ | |
741 | + arr=fir_quan.splice(0,3); | |
742 | + } | |
726 | 743 | //--------获取视频图片--------- |
727 | 744 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
728 | 745 | 1: 1 |
... | ... | @@ -748,7 +765,7 @@ Page({ |
748 | 765 | is_collect: is_collect, |
749 | 766 | collect_id: collect_id, |
750 | 767 | categories3: categories3, |
751 | - fir_quan: fir_quan, | |
768 | + fir_quan: arr, | |
752 | 769 | fir_comments: fir_com, |
753 | 770 | mapurl_f_img: mapurl_f_img, |
754 | 771 | mapurl: mapurl, |
... | ... | @@ -4450,7 +4467,18 @@ Page({ |
4450 | 4467 | wx.hideLoading(); |
4451 | 4468 | quan_list = res.data.data.pageData; |
4452 | 4469 | }) |
4453 | - | |
4470 | + //过滤不是本商品的单品优惠券 | |
4471 | + if (quan_list.length > 0) { | |
4472 | + let goodInfo = th.data.data | |
4473 | + for (let index = quan_list.length-1; index >= 0; index--) { | |
4474 | + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 | |
4475 | + if (quan_list[index].useobjectno != goodInfo.goods_sn) { | |
4476 | + quan_list.splice(index,1) | |
4477 | + } | |
4478 | + } | |
4479 | + } | |
4480 | + } | |
4481 | + //------------------------ | |
4454 | 4482 | if (quan_list) { |
4455 | 4483 | for (var ind in quan_list) { |
4456 | 4484 | var ep = quan_list[ind]; | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
... | ... | @@ -561,7 +561,7 @@ Page({ |
561 | 561 | data: { |
562 | 562 | store_id: os.stoid, |
563 | 563 | type: 1, |
564 | - pageSize: 3, | |
564 | + pageSize: 100, | |
565 | 565 | page: 1, |
566 | 566 | is_share: 0, |
567 | 567 | }, |
... | ... | @@ -569,7 +569,24 @@ Page({ |
569 | 569 | fir_quan = res1.data.data.pageData; |
570 | 570 | }) |
571 | 571 | } |
572 | - | |
572 | + //过滤不是本商品的单品优惠券------------------- | |
573 | + if(fir_quan.length > 0 ){ | |
574 | + let goodInfo = ee.data.data | |
575 | + for (let index = fir_quan.length-1; index >= 0; index--) { | |
576 | + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 | |
577 | + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { | |
578 | + fir_quan.splice(index,1) | |
579 | + } | |
580 | + } | |
581 | + } | |
582 | + } | |
583 | + let arr=[] | |
584 | + let length = fir_quan.length | |
585 | + if (length <= 3) { | |
586 | + arr=fir_quan | |
587 | + }else{ | |
588 | + arr=fir_quan.splice(0,3); | |
589 | + } | |
573 | 590 | //--------获取视频图片--------- |
574 | 591 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
575 | 592 | 1: 1 |
... | ... | @@ -587,7 +604,7 @@ Page({ |
587 | 604 | is_collect: is_collect, |
588 | 605 | collect_id: collect_id, |
589 | 606 | categories3: categories3, |
590 | - fir_quan: fir_quan, | |
607 | + fir_quan: arr, | |
591 | 608 | fir_comments: fir_com, |
592 | 609 | mapurl_f_img: mapurl_f_img, |
593 | 610 | mapurl: mapurl, |
... | ... | @@ -2615,7 +2632,18 @@ Page({ |
2615 | 2632 | wx.hideLoading(); |
2616 | 2633 | quan_list = res.data.data.pageData; |
2617 | 2634 | }) |
2618 | - | |
2635 | + //过滤不是本商品的单品优惠券 | |
2636 | + if (quan_list.length > 0) { | |
2637 | + let goodInfo = th.data.data | |
2638 | + for (let index = quan_list.length-1; index >= 0; index--) { | |
2639 | + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 | |
2640 | + if (quan_list[index].useobjectno != goodInfo.goods_sn) { | |
2641 | + quan_list.splice(index,1) | |
2642 | + } | |
2643 | + } | |
2644 | + } | |
2645 | + } | |
2646 | + //------------------------ | |
2619 | 2647 | if (quan_list) { |
2620 | 2648 | for (var ind in quan_list) { |
2621 | 2649 | var ep = quan_list[ind]; | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... | ... | @@ -556,7 +556,7 @@ Page({ |
556 | 556 | data: { |
557 | 557 | store_id: os.stoid, |
558 | 558 | type: 1, |
559 | - pageSize: 3, | |
559 | + pageSize: 100, | |
560 | 560 | page: 1, |
561 | 561 | is_share: 0, |
562 | 562 | }, |
... | ... | @@ -564,7 +564,25 @@ Page({ |
564 | 564 | fir_quan = res1.data.data.pageData; |
565 | 565 | }) |
566 | 566 | } |
567 | - | |
567 | + //过滤不是本商品的单品优惠券------------------- | |
568 | + if(fir_quan.length > 0 ){ | |
569 | + let goodInfo = ee.data.data | |
570 | + for (let index = fir_quan.length-1; index >= 0; index--) { | |
571 | + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 | |
572 | + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { | |
573 | + fir_quan.splice(index,1) | |
574 | + } | |
575 | + } | |
576 | + } | |
577 | + } | |
578 | + let arr=[] | |
579 | + let length = fir_quan.length | |
580 | + if (length <= 3) { | |
581 | + arr=fir_quan | |
582 | + }else{ | |
583 | + arr=fir_quan.splice(0,3); | |
584 | + } | |
585 | + //--------获取视频图片--------- | |
568 | 586 | //--------获取视频图片--------- |
569 | 587 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
570 | 588 | 1: 1 |
... | ... | @@ -580,7 +598,7 @@ Page({ |
580 | 598 | is_collect: is_collect, |
581 | 599 | collect_id: collect_id, |
582 | 600 | categories3: categories3, |
583 | - fir_quan: fir_quan, | |
601 | + fir_quan: arr, | |
584 | 602 | fir_comments: fir_com, |
585 | 603 | mapurl_f_img: mapurl_f_img, |
586 | 604 | mapurl: mapurl, |
... | ... | @@ -2578,7 +2596,18 @@ Page({ |
2578 | 2596 | wx.hideLoading(); |
2579 | 2597 | quan_list = res.data.data.pageData; |
2580 | 2598 | }) |
2581 | - | |
2599 | + //过滤不是本商品的单品优惠券 | |
2600 | + if (quan_list.length > 0) { | |
2601 | + let goodInfo = th.data.data | |
2602 | + for (let index = quan_list.length-1; index >= 0; index--) { | |
2603 | + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 | |
2604 | + if (quan_list[index].useobjectno != goodInfo.goods_sn) { | |
2605 | + quan_list.splice(index,1) | |
2606 | + } | |
2607 | + } | |
2608 | + } | |
2609 | + } | |
2610 | + //------------------------ | |
2582 | 2611 | if (quan_list) { |
2583 | 2612 | for (var ind in quan_list) { |
2584 | 2613 | var ep = quan_list[ind]; | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -417,6 +417,7 @@ Page({ |
417 | 417 | is_show_gb: 1 |
418 | 418 | }); |
419 | 419 | } |
420 | + console.log('获取系统参数'); | |
420 | 421 | console.log(e); |
421 | 422 | var json_d = JSON.parse(e.switch_list); |
422 | 423 | ee.setData({ |
... | ... | @@ -740,15 +741,33 @@ Page({ |
740 | 741 | data: { |
741 | 742 | store_id: os.stoid, |
742 | 743 | type: 1, |
743 | - pageSize: 3, | |
744 | + pageSize: 100, | |
744 | 745 | page: 1, |
745 | 746 | is_share: 0, |
746 | 747 | }, |
747 | 748 | }).then(res1 => { |
749 | + | |
748 | 750 | fir_quan = res1.data.data.pageData; |
749 | 751 | }) |
750 | 752 | } |
751 | - | |
753 | + //过滤不是本商品的单品优惠券------------------- | |
754 | + if(fir_quan.length > 0 ){ | |
755 | + let goodInfo = ee.data.data | |
756 | + for (let index = fir_quan.length-1; index >= 0; index--) { | |
757 | + if (fir_quan[index].useobjecttype==20) { //判断是单品优惠券 | |
758 | + if (fir_quan[index].useobjectno != goodInfo.goods_sn) { | |
759 | + fir_quan.splice(index,1) | |
760 | + } | |
761 | + } | |
762 | + } | |
763 | + } | |
764 | + let arr=[] | |
765 | + let length = fir_quan.length | |
766 | + if (length <= 3) { | |
767 | + arr=fir_quan | |
768 | + }else{ | |
769 | + arr=fir_quan.splice(0,3); | |
770 | + } | |
752 | 771 | //--------获取视频图片--------- |
753 | 772 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
754 | 773 | 1: 1 |
... | ... | @@ -764,7 +783,7 @@ Page({ |
764 | 783 | is_collect: is_collect, |
765 | 784 | collect_id: collect_id, |
766 | 785 | categories3: categories3, |
767 | - fir_quan: fir_quan, | |
786 | + fir_quan: arr, | |
768 | 787 | fir_comments: fir_com, |
769 | 788 | mapurl_f_img: mapurl_f_img, |
770 | 789 | mapurl: mapurl, |
... | ... | @@ -2924,7 +2943,8 @@ Page({ |
2924 | 2943 | } |
2925 | 2944 | }) |
2926 | 2945 | } |
2927 | - | |
2946 | + console.log('活动详情------------'); | |
2947 | + console.log(prom); | |
2928 | 2948 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- |
2929 | 2949 | var now = ut.gettimestamp(); |
2930 | 2950 | if (prom) { |
... | ... | @@ -3587,7 +3607,7 @@ Page({ |
3587 | 3607 | prom_end_time: prom_end_time, |
3588 | 3608 | prom_start_time: prom_start_time, |
3589 | 3609 | isshow: 1, |
3590 | - prom_act: t.data.data | |
3610 | + // prom_act: t.data.data | |
3591 | 3611 | }); |
3592 | 3612 | |
3593 | 3613 | ee.get_sto(); |
... | ... | @@ -4768,7 +4788,18 @@ Page({ |
4768 | 4788 | wx.hideLoading(); |
4769 | 4789 | quan_list = res.data.data.pageData; |
4770 | 4790 | }) |
4771 | - | |
4791 | + //过滤不是本商品的单品优惠券 | |
4792 | + if (quan_list.length > 0) { | |
4793 | + let goodInfo = th.data.data | |
4794 | + for (let index = quan_list.length-1; index >= 0; index--) { | |
4795 | + if (quan_list[index].useobjecttype==20) { //判断是单品优惠券 | |
4796 | + if (quan_list[index].useobjectno != goodInfo.goods_sn) { | |
4797 | + quan_list.splice(index,1) | |
4798 | + } | |
4799 | + } | |
4800 | + } | |
4801 | + } | |
4802 | + //------------------------ | |
4772 | 4803 | if (quan_list) { |
4773 | 4804 | for (var ind in quan_list) { |
4774 | 4805 | var ep = quan_list[ind]; | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -169,7 +169,7 @@ |
169 | 169 | {{djs.min}} |
170 | 170 | </view> |
171 | 171 | <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> |
172 | - <view class='xc-time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
172 | + <view class='xc-time-val white t-c' style="background:{{prom_st==1?'#d40022':'#0097e0'}}"> | |
173 | 173 | {{djs.sec}} |
174 | 174 | </view> |
175 | 175 | <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> |
... | ... | @@ -264,7 +264,7 @@ |
264 | 264 | ¥{{filters.toFix(data.shop_price,2)}} |
265 | 265 | </text> |
266 | 266 | </view> |
267 | - <!-- 这个是分享按钮 --> | |
267 | + <!-- 这个是分享按钮 --> | |
268 | 268 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
269 | 269 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
270 | 270 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> |
... | ... | @@ -604,7 +604,7 @@ |
604 | 604 | </block> |
605 | 605 | </block> |
606 | 606 | <!-- 许程 7.24暂时注释 --> |
607 | - <view class="bdt16" wx:if="{{prom_type!=1&& prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1}}"> | |
607 | + <view class="bdt16" wx:if="{{ prom_type!=1 && prom_act.kttype!=3&&prom_act.kttype!=2&&prom_act.kttype!=1 && is_closecoupon!=1 && sele_g.is_xz_yh !=1}}"> | |
608 | 608 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
609 | 609 | <view class="cx-sizs fs30">领券</view> |
610 | 610 | <view class="flex ai_c f1 pdh20"> | ... | ... |