Commit 0577300e90d7c2d87bca88a8e90e86ec2fcdaf18

Authored by yvan.ni
1 parent 60132776

礼包,通过链接进入的,活动还没有开始,就提示活动还没开始,不能购买

pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -61,6 +61,13 @@ Page({
61 61 var that = this.data;
62 62 var th = this;
63 63 // var id = e.currentTarget.dataset.id;//活动id
  64 + //如果还没有开始的话
  65 + if(th.data.isStart!=1){
  66 + getApp().my_warnning("活动还没有开始", 0, th);
  67 + return false;
  68 + }
  69 +
  70 +
64 71 var money = e.currentTarget.dataset.money;
65 72 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
66 73 my_confirm.open(
... ... @@ -101,7 +108,7 @@ Page({
101 108 getApp().goto(url);
102 109 },
103 110 fail: function(n) {
104   - getApp().my_confirm("取消支付", 0, th);
  111 + getApp().my_warnning("取消支付", 0, th);
105 112 }
106 113 });
107 114 } else {
... ... @@ -125,6 +132,12 @@ Page({
125 132 GetBuyIntegral: function(e) {
126 133 var that = this.data;
127 134 var th = this;
  135 +
  136 + //如果还没有开始的话
  137 + if(th.data.isStart!=1){
  138 + getApp().my_warnning("活动还没有开始", 0, th);
  139 + return false;
  140 + }
128 141 // var id = e.currentTarget.dataset.id;//活动id
129 142 var my_confirm = th.selectComponent("#my_confirm"); //组件的id
130 143 my_confirm.open(
... ... @@ -260,6 +273,14 @@ Page({
260 273 })
261 274 }
262 275  
  276 + var isStart=0;
  277 + var now=ut.gettimestamp();
  278 +
  279 + var str = res.data.data.starTime.replace(/-/g,'/');
  280 + var start = Date.parse(new Date(str));
  281 + start = start / 1000;
  282 + if(start<now) isStart=1;
  283 +
263 284 _this2.setData({
264 285 giftDate: res.data.data.endTime,
265 286 giftPosPrice: res.data.data.giftPosPrice,
... ... @@ -268,7 +289,8 @@ Page({
268 289 giftPrice: res.data.data.payMoney,
269 290 giftType: res.data.data.actType,
270 291 actTitle: res.data.data.actTitle,
271   - wareCard: res.data.data.wareCard
  292 + wareCard: res.data.data.wareCard,
  293 + isStart:isStart,
272 294 })
273 295 } else {
274 296 getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2);
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -7,7 +7,8 @@
7 7 <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text>
8 8 </view>
9 9 <view class="top_time data-v-3a5b7e36">
10   - <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text>
  10 + <text class="data-v-3a5b7e36" wx:if="{{isBuy==0}}">{{"兑换截至时间:"+giftDate}}</text>
  11 + <text class="data-v-3a5b7e36" wx:else>{{"活动结束至时间:"+giftDate}}</text>
11 12 </view>
12 13 <view class="top_price data-v-3a5b7e36">
13 14 <block wx:if="{{giftPrice>0}}">
... ... @@ -102,22 +103,22 @@
102 103 <block wx:if="{{isBuy==1}}">
103 104 <view class="foot_button data-v-3a5b7e36">
104 105 <block wx:if="{{giftPrice>0&&giftIntegral>0}}">
105   - <view class="foot_button_left data-v-3a5b7e36" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
106   - <text class="data-v-3a5b7e36">立即购买</text>
  106 + <view class="foot_button_left data-v-3a5b7e36 {{isStart?'':'gray'}}" data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
  107 + <text class="data-v-3a5b7e36 ">立即购买</text>
107 108 </view>
108 109 </block>
109 110 <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
110   - <view class="foot_button_right data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}">
  111 + <view class="foot_button_right data-v-3a5b7e36 {{isStart?'':'gray'}}" bindtap="GetBuyIntegral" data-id="{{lbId}}">
111 112 <text class="data-v-3a5b7e36">立即兑换</text>
112 113 </view>
113 114 </block>
114 115 <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
115   - <view class="foot_button_buy data-v-3a5b7e36" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}">
  116 + <view class="foot_button_buy data-v-3a5b7e36 {{isStart?'':'gray'}}" data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}">
116 117 <text class="data-v-3a5b7e36">立即购买</text>
117 118 </view>
118 119 </block>
119 120 <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
120   - <view class="foot_button_intalge data-v-3a5b7e36" bindtap="GetBuyIntegral" data-id="{{lbId}}">
  121 + <view class="foot_button_intalge data-v-3a5b7e36 {{isStart?'':'gray'}}" bindtap="GetBuyIntegral" data-id="{{lbId}}">
121 122 <text class="data-v-3a5b7e36">立即兑换</text>
122 123 </view>
123 124 </block>
... ...
pages/giftpack/giftpacklist/giftpacklist.wxss
... ... @@ -197,6 +197,7 @@
197 197 font-size: 28rpx;
198 198 line-height: 70rpx;
199 199 border-radius: 40rpx;
  200 + margin-right: 20rpx;
200 201 }
201 202  
202 203 .foot_button_right.data-v-3a5b7e36 {
... ... @@ -243,3 +244,6 @@ page.data-v-3a5b7e36 {
243 244 .overdue.data-v-3a5b7e36{
244 245 background-color: rgb(153,153,153);
245 246 }
  247 +
  248 +.foot_button_left.data-v-3a5b7e36.gray{ background-color: #aaa; }
  249 +.foot_button_right.data-v-3a5b7e36.gray{ background-color: #aaa;}
... ...