Commit 4371071211321e676d8a0f01c07b86e6497e6987
1 parent
3a458f24
秒杀服务卡的 在普通购买的时候的bug优化
Showing
4 changed files
with
85 additions
and
77 deletions
packageA/pages/goodsInfo/buy_flash_normal.wxml
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | <!-- 选择门店模块 --> |
31 | 31 | <view class="flex-space-between address ai_end xc-width "> |
32 | 32 | |
33 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
33 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
34 | 34 | <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text> |
35 | 35 | <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}"> |
36 | 36 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} |
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | <block wx:else> |
51 | 51 | <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view> |
52 | 52 | <block wx:else> |
53 | - <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(配送不匹配)</view> | |
53 | + <view class="no_store" wx:if="{{def_pick_store.is_no_dis}}">(该店不可售)</view> | |
54 | 54 | <view wx:elif="{{def_pick_store && !def_pick_store.CanOutQty && !filters.is_virtual_gd(sele_g.is_virtual) && sales_rules==2 && prom_type==0}}">(库存不足)</view> |
55 | 55 | </block> |
56 | 56 | </block> |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | |
98 | 98 | <!-- 根本就找不到门店 --> |
99 | 99 | <block wx:if="{{def_pick_store && def_pick_store.is_no_dis}}"> |
100 | - <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | |
100 | + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">该店不可售</view> | |
101 | 101 | </block> |
102 | 102 | <block wx:else> |
103 | 103 | <!-- 根本就找不到门店 --> | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -431,53 +431,7 @@ Page({ |
431 | 431 | // gallery = g; |
432 | 432 | // }) |
433 | 433 | |
434 | - | |
435 | - // ----> 秒杀 | |
436 | - let prom_type = this.data.options.prom_type; | |
437 | - | |
438 | - let goods_id = this.data.options.goods_id; | |
439 | - if(!goods_id) goods_id = this.data.data.goods_id; | |
440 | - | |
441 | - if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 | |
442 | - let prom_id = this.data.options.prom_id; | |
443 | - // 检查活动是否开始 | |
444 | - this.check_prom(goods_id, prom_type, prom_id); | |
445 | - | |
446 | - } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 | |
447 | - getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { | |
448 | - data: { | |
449 | - store_id: os.stoid, | |
450 | - goods_id: goods_id, | |
451 | - goods_type: 1, | |
452 | - user_id: oo.user_id, | |
453 | - } | |
454 | - }).then(res => { | |
455 | - if (res.data.code == 0) { | |
456 | - let result = res.data.data; | |
457 | - let resLength = result.length; | |
458 | - if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 | |
459 | - let goods_id = this.data.options.goods_id; | |
460 | - let prom_type = result[0].prom_type; | |
461 | - let prom_id = result[0].act_id; | |
462 | - this.setData({ | |
463 | - 'options.prom_type': prom_type, | |
464 | - 'options.prom_id': prom_id, | |
465 | - }); | |
466 | - // 检查活动是否开始 | |
467 | - this.check_prom(goods_id, prom_type, prom_id); | |
468 | - } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 | |
469 | - this.setData({ | |
470 | - actList: res.data.data, | |
471 | - }); | |
472 | - }; | |
473 | - | |
474 | - }else{ | |
475 | - this.setData({ | |
476 | - actList: res.data.data, | |
477 | - }); | |
478 | - } | |
479 | - }); | |
480 | - }; | |
434 | + | |
481 | 435 | // <---- 秒杀 |
482 | 436 | |
483 | 437 | //------是否收藏---------- |
... | ... | @@ -764,11 +718,55 @@ Page({ |
764 | 718 | // mapurl: t.data.data.listServiceVideos[0].video_url, |
765 | 719 | // mapurl_f_img: t.data.data.listServiceVideos[0].video_img, |
766 | 720 | //listServiceItem: t.data.data.listServiceItem, |
767 | - 'isshow':1 | |
768 | - | |
769 | 721 | }); |
770 | 722 | |
771 | 723 | that.getTaohe(); |
724 | + // ----> 秒杀 | |
725 | + let prom_type = th.data.options.prom_type; | |
726 | + | |
727 | + let goods_id = th.data.options.goods_id; | |
728 | + if(!goods_id) goods_id = th.data.data.goods_id; | |
729 | + | |
730 | + if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 | |
731 | + let prom_id = th.data.options.prom_id; | |
732 | + // 检查活动是否开始 | |
733 | + th.check_prom(goods_id, prom_type, prom_id); | |
734 | + | |
735 | + } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 | |
736 | + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { | |
737 | + data: { | |
738 | + store_id: os.stoid, | |
739 | + goods_id: goods_id, | |
740 | + goods_type: 1, | |
741 | + user_id: oo.user_id, | |
742 | + } | |
743 | + }).then(res => { | |
744 | + if (res.data.code == 0) { | |
745 | + let result = res.data.data; | |
746 | + let resLength = result.length; | |
747 | + if(resLength == 1) { // 如果数组长度为1,则直接显示当前活动 | |
748 | + let goods_id = th.data.options.goods_id; | |
749 | + let prom_type = result[0].prom_type; | |
750 | + let prom_id = result[0].act_id; | |
751 | + th.setData({ | |
752 | + 'options.prom_type': prom_type, | |
753 | + 'options.prom_id': prom_id, | |
754 | + }); | |
755 | + // 检查活动是否开始 | |
756 | + th.check_prom(goods_id, prom_type, prom_id); | |
757 | + } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 | |
758 | + th.setData({ | |
759 | + actList: res.data.data, | |
760 | + }); | |
761 | + }; | |
762 | + | |
763 | + }else{ | |
764 | + th.setData({ | |
765 | + actList: res.data.data, | |
766 | + }); | |
767 | + } | |
768 | + }); | |
769 | + }; | |
772 | 770 | |
773 | 771 | // console.log('0xxxxx999999', t.data.data); |
774 | 772 | //-----商品详情--- |
... | ... | @@ -1604,9 +1602,9 @@ Page({ |
1604 | 1602 | if(th.data.sele_g && th.data.sele_g.share_imgurl) { |
1605 | 1603 | img = th.data.iurl + th.data.sele_g.share_imgurl; |
1606 | 1604 | ob.imageUrl = img; |
1607 | - }; | |
1608 | - }; | |
1609 | - | |
1605 | + } | |
1606 | + } | |
1607 | + | |
1610 | 1608 | return ob; |
1611 | 1609 | |
1612 | 1610 | }, |
... | ... | @@ -1631,7 +1629,19 @@ Page({ |
1631 | 1629 | |
1632 | 1630 | //---------拿出门店分类和门店------------ |
1633 | 1631 | get_sto(e) { |
1632 | + var is_normal=e; | |
1634 | 1633 | var th = this,that=this; |
1634 | + | |
1635 | + if (e == 1) { | |
1636 | + th.setData({ | |
1637 | + is_normal: 1 | |
1638 | + }) | |
1639 | + } else { | |
1640 | + th.setData({ | |
1641 | + is_normal: 0 | |
1642 | + }) | |
1643 | + } | |
1644 | + | |
1635 | 1645 | var timer_get = setInterval(function() { |
1636 | 1646 | if (th.data.is_get_local_ok == 0) return false; |
1637 | 1647 | if (!th.data.fir_def_store) return false; |
... | ... | @@ -1684,11 +1694,12 @@ Page({ |
1684 | 1694 | //删除 |
1685 | 1695 | e.data.data.pageData.splice(k--, 1); |
1686 | 1696 | } |
1687 | - } | |
1697 | + } | |
1698 | + | |
1688 | 1699 | } |
1689 | 1700 | |
1690 | 1701 | //如果有秒杀的指定门店 |
1691 | - if(th.data.prom_type==1 && th.data.prom_act && th.data.prom_act.pick_up_lists && e.data.data.pageData.length){ | |
1702 | + if(th.data.prom_type==1 && th.data.prom_act && th.data.prom_act.pick_up_lists && e.data.data.pageData.length && !is_normal){ | |
1692 | 1703 | var pick_up_lists=th.data.prom_act.pick_up_lists; |
1693 | 1704 | for (var kq = 0; kq < e.data.data.pageData.length; kq++) { |
1694 | 1705 | var it0=e.data.data.pageData[kq]; |
... | ... | @@ -1742,7 +1753,7 @@ Page({ |
1742 | 1753 | e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 |
1743 | 1754 | } |
1744 | 1755 | |
1745 | - th.setData({all_pick_list:e.data.data.pageData}); | |
1756 | + th.setData({all_pick_list:e.data.data.pageData,isshow:1}); | |
1746 | 1757 | th.deal_pickup(e); |
1747 | 1758 | } |
1748 | 1759 | else{ |
... | ... | @@ -3554,7 +3565,6 @@ Page({ |
3554 | 3565 | get_normal(gid) { |
3555 | 3566 | this.setData({ |
3556 | 3567 | prom_type: 0, |
3557 | - isshow: 1, | |
3558 | 3568 | }); |
3559 | 3569 | // this.get_sku(os.stoid, this.data.data, gid); |
3560 | 3570 | this.get_sto(); |
... | ... | @@ -3589,7 +3599,7 @@ Page({ |
3589 | 3599 | |
3590 | 3600 | if (prom_type == 1 && prom_id == 0) { |
3591 | 3601 | this.setData({ |
3592 | - prom_type: 0, isshow: 1, | |
3602 | + prom_type: 0 | |
3593 | 3603 | }); |
3594 | 3604 | |
3595 | 3605 | //获取门店 |
... | ... | @@ -3658,7 +3668,6 @@ Page({ |
3658 | 3668 | prom_act: t.data.data, |
3659 | 3669 | prom_end_time: prom_end_time, |
3660 | 3670 | prom_start_time: prom_start_time, |
3661 | - isshow: 1, | |
3662 | 3671 | }); |
3663 | 3672 | |
3664 | 3673 | ee.get_sto(); |
... | ... | @@ -3932,18 +3941,18 @@ Page({ |
3932 | 3941 | |
3933 | 3942 | // 是否授权登陆 |
3934 | 3943 | var user_info = getApp().globalData.userInfo; |
3935 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
3936 | - wx.navigateTo({ | |
3937 | - url: '/packageE/pages/togoin/togoin', | |
3938 | - }) | |
3939 | - return false; | |
3940 | - } | |
3941 | - | |
3944 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | |
3945 | + wx.navigateTo({ | |
3946 | + url: '/packageE/pages/togoin/togoin', | |
3947 | + }) | |
3948 | + return false; | |
3949 | + } | |
3942 | 3950 | this.data.g_buy_num = new Map(); |
3943 | 3951 | var th = this; |
3944 | 3952 | this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4 |
3945 | 3953 | |
3946 | - this.setData({openSpecModal_flash_normal: 1}); | |
3954 | + this.setData({openSpecModal_flash_normal: 1}); | |
3955 | + this.get_sto(1) | |
3947 | 3956 | |
3948 | 3957 | |
3949 | 3958 | // if (th.data.sku_g_pt) { |
... | ... | @@ -3961,7 +3970,7 @@ Page({ |
3961 | 3970 | }, |
3962 | 3971 | |
3963 | 3972 | closeSpecModal_flash_normal: function () { |
3964 | - this.setData({openSpecModal_flash_normal: 0}); | |
3973 | + this.setData({openSpecModal_flash_normal: 0,is_normal:0}); | |
3965 | 3974 | }, |
3966 | 3975 | |
3967 | 3976 | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxml
... | ... | @@ -172,7 +172,7 @@ |
172 | 172 | <view class="no_store" wx:if="{{only_pk && !only_pk.length}}">(未找到门店)</view> |
173 | 173 | <block wx:else> |
174 | 174 | <view class="no_store" wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(未找到门店)</view> |
175 | - <text wx:elif="{{def_pick_store.is_no_dis_act}}" class="no_store">(该店不可售)</text> | |
175 | + <text wx:elif="{{def_pick_store.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | |
176 | 176 | <block wx:else> |
177 | 177 | <view class="no_store" wx:if="{{def_pick_store && def_pick_store.is_no_dis}}">(该店不可售)</view> |
178 | 178 | </block> |
... | ... | @@ -666,7 +666,7 @@ |
666 | 666 | |
667 | 667 | <!-- 选择门店模块 --> |
668 | 668 | <view class="flex-space-between address ai_end xc-width" style="padding-top: 30rpx;"> |
669 | - <view class="flex ai_end" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
669 | + <view class="flex" wx:if="{{def_pick_store && def_pick_store.pickup_name}}"> | |
670 | 670 | <text class="fs30 xc-black3 shop_name" style="width:360rpx">{{def_pick_store.pickup_name}}</text> |
671 | 671 | <view class="distance fs24 xc-ash" wx:if="{{def_pick_store.distance!=null}}"> |
672 | 672 | 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}</view> |
... | ... | @@ -837,7 +837,7 @@ |
837 | 837 | <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
838 | 838 | <text class="no_store">(该店不可售)</text> |
839 | 839 | </block> |
840 | - <text wx:elif="{{item.is_no_dis_act}}" class="no_store">(该店不可售)</text> | |
840 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售1)</text> | |
841 | 841 | |
842 | 842 | </view> |
843 | 843 | </view> |
... | ... | @@ -869,7 +869,7 @@ |
869 | 869 | <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
870 | 870 | <text class="no_store">(该店不可售)</text> |
871 | 871 | </block> |
872 | - <text wx:elif="{{item.is_no_dis_act}}" class="no_store">(该店不可售)</text> | |
872 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | |
873 | 873 | </view> |
874 | 874 | </view> |
875 | 875 | <view> |
... | ... | @@ -902,7 +902,7 @@ |
902 | 902 | <block wx:if="{{tool.is_no_dis(data.storageId,item.keyid)}}"> |
903 | 903 | <text class="no_store">(该店不可售)</text> |
904 | 904 | </block> |
905 | - <text wx:elif="{{item.is_no_dis_act}}" class="no_store">(该店不可售)</text> | |
905 | + <text wx:elif="{{item.is_no_dis_act && !is_normal}}" class="no_store">(该店不可售)</text> | |
906 | 906 | </view> |
907 | 907 | </view> |
908 | 908 | <view> | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxss
... | ... | @@ -2417,9 +2417,7 @@ height: 90rpx; |
2417 | 2417 | margin: auto; */ |
2418 | 2418 | |
2419 | 2419 | } |
2420 | -.shop_name{ | |
2421 | 2420 | |
2422 | -} | |
2423 | 2421 | .stores-img{ |
2424 | 2422 | width: 28rpx; |
2425 | 2423 | height: 28rpx; |
... | ... | @@ -2427,6 +2425,7 @@ margin: auto; */ |
2427 | 2425 | } |
2428 | 2426 | .shop_name{ |
2429 | 2427 | margin-right: 10rpx; |
2428 | + max-width: 375rpx; | |
2430 | 2429 | } |
2431 | 2430 | .address{ |
2432 | 2431 | /* width: 100%; | ... | ... |