Commit 76f5313a532f6b45d0b106efae64abc08227c087
1 parent
15414865
幸运购订单、幸运购商品详情修改
Showing
3 changed files
with
116 additions
and
48 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -276,6 +276,9 @@ Page({ |
276 | 276 | luckGoInfo: {}, |
277 | 277 | showDetails: false, |
278 | 278 | num_success: 0, //成团已中商品数量 |
279 | + isTimeUp: false, | |
280 | + | |
281 | + surplus: 0, | |
279 | 282 | |
280 | 283 | }, |
281 | 284 | |
... | ... | @@ -1005,6 +1008,24 @@ Page({ |
1005 | 1008 | }); |
1006 | 1009 | this.data.enterAddressPage && (this.data.enterAddressPage = !1); |
1007 | 1010 | |
1011 | + // 检查幸运购活动商品库存 | |
1012 | + getApp().request.get("/api/weshop/activitylist/getActLen/" + o.stoid + "/9/" + this.data.group_id, { | |
1013 | + success: function(res) { | |
1014 | + //console.log('当前幸运购活动的剩余库存', res.data.data); | |
1015 | + if(res.data.code == 0) { | |
1016 | + th.setData({ | |
1017 | + // 剩余库存量 | |
1018 | + surplus: res.data.data, | |
1019 | + }); | |
1020 | + }; | |
1021 | + // else { | |
1022 | + // th.setData({ | |
1023 | + // surplus: 0, | |
1024 | + // }); | |
1025 | + // } | |
1026 | + } | |
1027 | + }); | |
1028 | + | |
1008 | 1029 | |
1009 | 1030 | // 检查是否已经参团购买 |
1010 | 1031 | getApp().request.get("/api/weshop/prom/luckyOrder/getUserOrderInfo/" + o.stoid + "/" + oo.user_id + "/" + this.data.group_id, { |
... | ... | @@ -1077,18 +1098,37 @@ Page({ |
1077 | 1098 | } |
1078 | 1099 | }).then(res => { |
1079 | 1100 | if (res.data.code == 0) { |
1080 | - // console.log('成团信息=======》', res.data.data); | |
1101 | + console.log('成团信息=======》', res.data.data); | |
1102 | + if(res.data.data.pageData && res.data.data.pageData.length == 0) { | |
1103 | + let obj = { | |
1104 | + day: '00', | |
1105 | + hou: '00', | |
1106 | + min: '00', | |
1107 | + sec: '00' | |
1108 | + }; | |
1109 | + | |
1110 | + th.setData({ | |
1111 | + djs: obj, | |
1112 | + isTimeUp: true, | |
1113 | + }); | |
1114 | + } else { | |
1115 | + th.setData({ | |
1116 | + luckGoInfo: res.data.data.pageData[0], | |
1117 | + team_id: res.data.data.pageData[0].team_id, | |
1118 | + luckGoMembers: [], | |
1119 | + }); | |
1120 | + wx.setStorage({ | |
1121 | + key: 'team_id', | |
1122 | + data: th.data.team_id, | |
1123 | + }); | |
1124 | + th.countDown(th.data.luckGoInfo.end_time, 0); | |
1125 | + }; | |
1126 | + | |
1127 | + } else { | |
1081 | 1128 | th.setData({ |
1082 | - luckGoInfo: res.data.data.pageData[0], | |
1083 | - team_id: res.data.data.pageData[0].team_id, | |
1084 | - luckGoMembers: [], | |
1085 | - }); | |
1086 | - wx.setStorage({ | |
1087 | - key: 'team_id', | |
1088 | - data: th.data.team_id, | |
1129 | + isTimeUp: true, | |
1089 | 1130 | }); |
1090 | - th.countDown(th.data.luckGoInfo.end_time, 0); | |
1091 | - }; | |
1131 | + }; | |
1092 | 1132 | |
1093 | 1133 | |
1094 | 1134 | }); |
... | ... | @@ -3682,41 +3722,63 @@ Page({ |
3682 | 3722 | min: this.timeFormat(min), |
3683 | 3723 | sec: this.timeFormat(sec) |
3684 | 3724 | } |
3725 | + // console.log('cd'); | |
3685 | 3726 | } else { |
3686 | - if (th.data.prom_st == 0) { | |
3687 | - //var endTime2 = new Date(th.data.prom_end_time).getTime(); | |
3688 | - var endTime2 = th.data.prom_act.end_time; | |
3689 | - th.setData({ | |
3690 | - prom_time_text: '距结束还剩:', | |
3691 | - prom_st: 1 | |
3692 | - }) | |
3693 | - setTimeout(function () { | |
3694 | - th.countDown(endTime2) | |
3695 | - }, 1000); | |
3696 | - return false; | |
3727 | + // if (th.data.prom_st == 0) { | |
3728 | + // //var endTime2 = new Date(th.data.prom_end_time).getTime(); | |
3729 | + // var endTime2 = th.data.prom_act.end_time; | |
3730 | + // th.setData({ | |
3731 | + // prom_time_text: '距结束还剩:', | |
3732 | + // prom_st: 1 | |
3733 | + // }) | |
3734 | + // setTimeout(function () { | |
3735 | + // th.countDown(endTime2) | |
3736 | + // }, 1000); | |
3737 | + // return false; | |
3697 | 3738 | |
3698 | - } else { | |
3699 | - //活动已结束,全部设置为'00' | |
3700 | - obj = { | |
3701 | - day: '00', | |
3702 | - hou: '00', | |
3703 | - min: '00', | |
3704 | - sec: '00' | |
3705 | - } | |
3706 | - th.setData({ | |
3707 | - prom_time_text: '活动已经结束:', | |
3708 | - prom_st: 3 | |
3709 | - }) | |
3710 | - th.setData({ | |
3711 | - djs: obj | |
3712 | - }); | |
3713 | - return false; | |
3714 | - } | |
3739 | + // } else { | |
3740 | + // //活动已结束,全部设置为'00' | |
3741 | + // obj = { | |
3742 | + // day: '00', | |
3743 | + // hou: '00', | |
3744 | + // min: '00', | |
3745 | + // sec: '00' | |
3746 | + // } | |
3747 | + // th.setData({ | |
3748 | + // prom_time_text: '活动已经结束:', | |
3749 | + // prom_st: 3 | |
3750 | + // }) | |
3751 | + // th.setData({ | |
3752 | + // djs: obj | |
3753 | + // }); | |
3754 | + // return false; | |
3755 | + // } | |
3756 | + | |
3757 | + | |
3758 | + obj = { | |
3759 | + day: '00', | |
3760 | + hou: '00', | |
3761 | + min: '00', | |
3762 | + sec: '00' | |
3763 | + } | |
3764 | + | |
3765 | + th.setData({ | |
3766 | + djs: obj, | |
3767 | + isTimeUp: true, | |
3768 | + }); | |
3769 | + console.log('i am here'); | |
3770 | + return false; | |
3715 | 3771 | } |
3716 | - | |
3717 | - th.setData({ | |
3718 | - djs: obj | |
3719 | - }); | |
3772 | + | |
3773 | + // ---- | |
3774 | + | |
3775 | + | |
3776 | + | |
3777 | + | |
3778 | + th.setData({ | |
3779 | + djs: obj | |
3780 | + }); | |
3781 | + // ---- | |
3720 | 3782 | setTimeout(function () { |
3721 | 3783 | th.countDown(endTime) |
3722 | 3784 | }, 1000); | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
... | ... | @@ -920,9 +920,14 @@ |
920 | 920 | </view> |
921 | 921 | <!-- data-ind="2" --> |
922 | 922 | <!-- openSpecModel_pt --> |
923 | - <view class="btn-red f1 flex ai-center jc-center" bindtap="go" data-it="0" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{luckGoInfo.id}}&goods_id={{luckGoInfo.goods_id}}&goods_name={{data.goods_name}}&team_id={{buyInfo.team_id}}&&from=list" wx:if="{{showDetails}}">查看详情</view> | |
924 | - <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-it="0" wx:elif="{{!showDetails && (luckGoInfo.goods_num != 0)}}">立即参团</view> | |
925 | - <view class="btn-red f1 flex ai-center jc-center" wx:else>已经抢光</view> | |
923 | + <view class="xc-ash-b f1 flex ai-center jc-center white fs26" wx:if="{{isTimeUp}}">活动已经结束</view> | |
924 | + <block wx:else> | |
925 | + <view class="btn-red f1 flex ai-center jc-center" bindtap="go" data-it="0" data-url="/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?group_id={{luckGoInfo.id}}&goods_id={{luckGoInfo.goods_id}}&goods_name={{data.goods_name}}&team_id={{buyInfo.team_id}}&&from=list" wx:if="{{showDetails}}">查看详情</view> | |
926 | + <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-it="0" wx:elif="{{!showDetails && surplus != 0}}">立即参团</view> | |
927 | + <view class="f1 flex ai-center jc-center xc-ash-b fs26 white" wx:elif="{{!showDetails && surplus == 0}}">已经抢光了</view> | |
928 | + </block> | |
929 | + | |
930 | + <!-- <view class="btn-red f1 flex ai-center jc-center" wx:else>已经抢光</view> --> | |
926 | 931 | <!-- <view class="btn-red f1 flex ai-center jc-center" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">立即参团</view> --> |
927 | 932 | </view> |
928 | 933 | <!-- <view bindtap="openSpecModel" data-ind="1" class="btn-buy flex fdc jc-center"> | ... | ... |
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
... | ... | @@ -17,7 +17,8 @@ Page({ |
17 | 17 | onLoad: function(e) { |
18 | 18 | var th=this; |
19 | 19 | var r = void 0 !== e.isGoup && e.isGoup; |
20 | - | |
20 | + // console.log('e*************>>>>>>', e); | |
21 | + this.data.group_id = e.group_id; | |
21 | 22 | getApp().getConfig2(function (e) { |
22 | 23 | |
23 | 24 | th.setData({conf: e,sales_rules:e.sales_rules, userInfo: getApp().globalData.userInfo}); |
... | ... | @@ -1472,7 +1473,7 @@ Page({ |
1472 | 1473 | |
1473 | 1474 | //跳转到商品 |
1474 | 1475 | go_gd:function (e) { |
1475 | - console.log(e); | |
1476 | + // console.log(e); | |
1476 | 1477 | var gd= e.currentTarget.dataset.gd; |
1477 | 1478 | var prom_type = this.data.order.order_goods[0].prom_type; |
1478 | 1479 | // var good_url=''; |
... | ... | @@ -1482,7 +1483,7 @@ Page({ |
1482 | 1483 | // good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; |
1483 | 1484 | // }; |
1484 | 1485 | |
1485 | - var good_url="/pages/goods/goodsInfo/goodsInfo?goods_id=" + gd; | |
1486 | + var good_url="/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=" + gd + '&group_id=' + this.data.group_id; | |
1486 | 1487 | getApp().goto(good_url); |
1487 | 1488 | |
1488 | 1489 | // var url="/api/weshop/activitylist/getGoodActInfo"; | ... | ... |