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,7 +714,7 @@ Page({ | ||
714 | data: { | 714 | data: { |
715 | store_id: os.stoid, | 715 | store_id: os.stoid, |
716 | type: 1, | 716 | type: 1, |
717 | - pageSize: 3, | 717 | + pageSize: 100, |
718 | page: 1, | 718 | page: 1, |
719 | is_share: 0, | 719 | is_share: 0, |
720 | }, | 720 | }, |
@@ -722,7 +722,24 @@ Page({ | @@ -722,7 +722,24 @@ Page({ | ||
722 | fir_quan = res1.data.data.pageData; | 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 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | 744 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
728 | 1: 1 | 745 | 1: 1 |
@@ -748,7 +765,7 @@ Page({ | @@ -748,7 +765,7 @@ Page({ | ||
748 | is_collect: is_collect, | 765 | is_collect: is_collect, |
749 | collect_id: collect_id, | 766 | collect_id: collect_id, |
750 | categories3: categories3, | 767 | categories3: categories3, |
751 | - fir_quan: fir_quan, | 768 | + fir_quan: arr, |
752 | fir_comments: fir_com, | 769 | fir_comments: fir_com, |
753 | mapurl_f_img: mapurl_f_img, | 770 | mapurl_f_img: mapurl_f_img, |
754 | mapurl: mapurl, | 771 | mapurl: mapurl, |
@@ -4450,7 +4467,18 @@ Page({ | @@ -4450,7 +4467,18 @@ Page({ | ||
4450 | wx.hideLoading(); | 4467 | wx.hideLoading(); |
4451 | quan_list = res.data.data.pageData; | 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 | if (quan_list) { | 4482 | if (quan_list) { |
4455 | for (var ind in quan_list) { | 4483 | for (var ind in quan_list) { |
4456 | var ep = quan_list[ind]; | 4484 | var ep = quan_list[ind]; |
packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -561,7 +561,7 @@ Page({ | @@ -561,7 +561,7 @@ Page({ | ||
561 | data: { | 561 | data: { |
562 | store_id: os.stoid, | 562 | store_id: os.stoid, |
563 | type: 1, | 563 | type: 1, |
564 | - pageSize: 3, | 564 | + pageSize: 100, |
565 | page: 1, | 565 | page: 1, |
566 | is_share: 0, | 566 | is_share: 0, |
567 | }, | 567 | }, |
@@ -569,7 +569,24 @@ Page({ | @@ -569,7 +569,24 @@ Page({ | ||
569 | fir_quan = res1.data.data.pageData; | 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 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | 591 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
575 | 1: 1 | 592 | 1: 1 |
@@ -587,7 +604,7 @@ Page({ | @@ -587,7 +604,7 @@ Page({ | ||
587 | is_collect: is_collect, | 604 | is_collect: is_collect, |
588 | collect_id: collect_id, | 605 | collect_id: collect_id, |
589 | categories3: categories3, | 606 | categories3: categories3, |
590 | - fir_quan: fir_quan, | 607 | + fir_quan: arr, |
591 | fir_comments: fir_com, | 608 | fir_comments: fir_com, |
592 | mapurl_f_img: mapurl_f_img, | 609 | mapurl_f_img: mapurl_f_img, |
593 | mapurl: mapurl, | 610 | mapurl: mapurl, |
@@ -2615,7 +2632,18 @@ Page({ | @@ -2615,7 +2632,18 @@ Page({ | ||
2615 | wx.hideLoading(); | 2632 | wx.hideLoading(); |
2616 | quan_list = res.data.data.pageData; | 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 | if (quan_list) { | 2647 | if (quan_list) { |
2620 | for (var ind in quan_list) { | 2648 | for (var ind in quan_list) { |
2621 | var ep = quan_list[ind]; | 2649 | var ep = quan_list[ind]; |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -556,7 +556,7 @@ Page({ | @@ -556,7 +556,7 @@ Page({ | ||
556 | data: { | 556 | data: { |
557 | store_id: os.stoid, | 557 | store_id: os.stoid, |
558 | type: 1, | 558 | type: 1, |
559 | - pageSize: 3, | 559 | + pageSize: 100, |
560 | page: 1, | 560 | page: 1, |
561 | is_share: 0, | 561 | is_share: 0, |
562 | }, | 562 | }, |
@@ -564,7 +564,25 @@ Page({ | @@ -564,7 +564,25 @@ Page({ | ||
564 | fir_quan = res1.data.data.pageData; | 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 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | 587 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
570 | 1: 1 | 588 | 1: 1 |
@@ -580,7 +598,7 @@ Page({ | @@ -580,7 +598,7 @@ Page({ | ||
580 | is_collect: is_collect, | 598 | is_collect: is_collect, |
581 | collect_id: collect_id, | 599 | collect_id: collect_id, |
582 | categories3: categories3, | 600 | categories3: categories3, |
583 | - fir_quan: fir_quan, | 601 | + fir_quan: arr, |
584 | fir_comments: fir_com, | 602 | fir_comments: fir_com, |
585 | mapurl_f_img: mapurl_f_img, | 603 | mapurl_f_img: mapurl_f_img, |
586 | mapurl: mapurl, | 604 | mapurl: mapurl, |
@@ -2578,7 +2596,18 @@ Page({ | @@ -2578,7 +2596,18 @@ Page({ | ||
2578 | wx.hideLoading(); | 2596 | wx.hideLoading(); |
2579 | quan_list = res.data.data.pageData; | 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 | if (quan_list) { | 2611 | if (quan_list) { |
2583 | for (var ind in quan_list) { | 2612 | for (var ind in quan_list) { |
2584 | var ep = quan_list[ind]; | 2613 | var ep = quan_list[ind]; |
pages/goods/goodsInfo/goodsInfo.js
@@ -417,6 +417,7 @@ Page({ | @@ -417,6 +417,7 @@ Page({ | ||
417 | is_show_gb: 1 | 417 | is_show_gb: 1 |
418 | }); | 418 | }); |
419 | } | 419 | } |
420 | + console.log('获取系统参数'); | ||
420 | console.log(e); | 421 | console.log(e); |
421 | var json_d = JSON.parse(e.switch_list); | 422 | var json_d = JSON.parse(e.switch_list); |
422 | ee.setData({ | 423 | ee.setData({ |
@@ -740,15 +741,33 @@ Page({ | @@ -740,15 +741,33 @@ Page({ | ||
740 | data: { | 741 | data: { |
741 | store_id: os.stoid, | 742 | store_id: os.stoid, |
742 | type: 1, | 743 | type: 1, |
743 | - pageSize: 3, | 744 | + pageSize: 100, |
744 | page: 1, | 745 | page: 1, |
745 | is_share: 0, | 746 | is_share: 0, |
746 | }, | 747 | }, |
747 | }).then(res1 => { | 748 | }).then(res1 => { |
749 | + | ||
748 | fir_quan = res1.data.data.pageData; | 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 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { | 772 | await getApp().request.promiseGet("/api/weshop/goodsVideos/get/" + os.stoid + "/" + ee.data.gid, { |
754 | 1: 1 | 773 | 1: 1 |
@@ -764,7 +783,7 @@ Page({ | @@ -764,7 +783,7 @@ Page({ | ||
764 | is_collect: is_collect, | 783 | is_collect: is_collect, |
765 | collect_id: collect_id, | 784 | collect_id: collect_id, |
766 | categories3: categories3, | 785 | categories3: categories3, |
767 | - fir_quan: fir_quan, | 786 | + fir_quan: arr, |
768 | fir_comments: fir_com, | 787 | fir_comments: fir_com, |
769 | mapurl_f_img: mapurl_f_img, | 788 | mapurl_f_img: mapurl_f_img, |
770 | mapurl: mapurl, | 789 | mapurl: mapurl, |
@@ -2924,7 +2943,8 @@ Page({ | @@ -2924,7 +2943,8 @@ Page({ | ||
2924 | } | 2943 | } |
2925 | }) | 2944 | }) |
2926 | } | 2945 | } |
2927 | - | 2946 | + console.log('活动详情------------'); |
2947 | + console.log(prom); | ||
2928 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- | 2948 | //----------如果有活动,并且在进行中,就不计算线下库存--------------- |
2929 | var now = ut.gettimestamp(); | 2949 | var now = ut.gettimestamp(); |
2930 | if (prom) { | 2950 | if (prom) { |
@@ -3587,7 +3607,7 @@ Page({ | @@ -3587,7 +3607,7 @@ Page({ | ||
3587 | prom_end_time: prom_end_time, | 3607 | prom_end_time: prom_end_time, |
3588 | prom_start_time: prom_start_time, | 3608 | prom_start_time: prom_start_time, |
3589 | isshow: 1, | 3609 | isshow: 1, |
3590 | - prom_act: t.data.data | 3610 | + // prom_act: t.data.data |
3591 | }); | 3611 | }); |
3592 | 3612 | ||
3593 | ee.get_sto(); | 3613 | ee.get_sto(); |
@@ -4768,7 +4788,18 @@ Page({ | @@ -4768,7 +4788,18 @@ Page({ | ||
4768 | wx.hideLoading(); | 4788 | wx.hideLoading(); |
4769 | quan_list = res.data.data.pageData; | 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 | if (quan_list) { | 4803 | if (quan_list) { |
4773 | for (var ind in quan_list) { | 4804 | for (var ind in quan_list) { |
4774 | var ep = quan_list[ind]; | 4805 | var ep = quan_list[ind]; |
pages/goods/goodsInfo/goodsInfo.wxml
@@ -169,7 +169,7 @@ | @@ -169,7 +169,7 @@ | ||
169 | {{djs.min}} | 169 | {{djs.min}} |
170 | </view> | 170 | </view> |
171 | <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> | 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 | {{djs.sec}} | 173 | {{djs.sec}} |
174 | </view> | 174 | </view> |
175 | <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> | 175 | <view class="xc-time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> |
@@ -264,7 +264,7 @@ | @@ -264,7 +264,7 @@ | ||
264 | ¥{{filters.toFix(data.shop_price,2)}} | 264 | ¥{{filters.toFix(data.shop_price,2)}} |
265 | </text> | 265 | </text> |
266 | </view> | 266 | </view> |
267 | - <!-- 这个是分享按钮 --> | 267 | + <!-- 这个是分享按钮 --> |
268 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> | 268 | <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> |
269 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> | 269 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
270 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> | 270 | <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> |
@@ -604,7 +604,7 @@ | @@ -604,7 +604,7 @@ | ||
604 | </block> | 604 | </block> |
605 | </block> | 605 | </block> |
606 | <!-- 许程 7.24暂时注释 --> | 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 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> | 608 | <view class="cx-frame flex" style="position: relative" wx:if="{{fir_quan.length>0}}"> |
609 | <view class="cx-sizs fs30">领券</view> | 609 | <view class="cx-sizs fs30">领券</view> |
610 | <view class="flex ai_c f1 pdh20"> | 610 | <view class="flex ai_c f1 pdh20"> |