Commit acae08bfa2b09d7afb3c28aaee9399f0db469ae7
Merge branch 'qa' of http://git.vipzhuang.cn/wxd/MShopWeApp
Showing
2 changed files
with
34 additions
and
2 deletions
packageB/pages/user/user_coupon/user_coupon.js
| @@ -130,8 +130,23 @@ Page({ | @@ -130,8 +130,23 @@ Page({ | ||
| 130 | 130 | ||
| 131 | //获取券 | 131 | //获取券 |
| 132 | get_quan:function (e) { | 132 | get_quan:function (e) { |
| 133 | + | ||
| 134 | + console.log("get_quan_ing:"+this.data.get_quan_ing); | ||
| 135 | + | ||
| 136 | + if(this.data.get_quan_ing) return false; | ||
| 137 | + this.data.get_quan_ing=1; | ||
| 138 | + | ||
| 133 | var th=this,index=e.currentTarget.dataset.ind; | 139 | var th=this,index=e.currentTarget.dataset.ind; |
| 134 | var item = this.data.quan_list[index]; | 140 | var item = this.data.quan_list[index]; |
| 141 | + | ||
| 142 | + var txt_get="quan_list["+index+"].get_quan_ing"; | ||
| 143 | + | ||
| 144 | + | ||
| 145 | + this.setData({ | ||
| 146 | + [txt_get]:1 | ||
| 147 | + }) | ||
| 148 | + | ||
| 149 | + | ||
| 135 | var can_get = item.ObtainTimes; | 150 | var can_get = item.ObtainTimes; |
| 136 | var Obtain = item.Obtain; | 151 | var Obtain = item.Obtain; |
| 137 | var Id = item.Id; | 152 | var Id = item.Id; |
| @@ -153,8 +168,25 @@ Page({ | @@ -153,8 +168,25 @@ Page({ | ||
| 153 | obj[text] = Obtain; | 168 | obj[text] = Obtain; |
| 154 | th.setData(obj); | 169 | th.setData(obj); |
| 155 | getApp().my_warnning("您已成功领取该券",1,th); | 170 | getApp().my_warnning("您已成功领取该券",1,th); |
| 171 | + | ||
| 172 | + setTimeout(()=>{ | ||
| 173 | + th.data.get_quan_ing=0; | ||
| 174 | + th.setData({ | ||
| 175 | + [txt_get]:0 | ||
| 176 | + }) | ||
| 177 | + },1000) | ||
| 178 | + | ||
| 179 | + | ||
| 180 | + | ||
| 156 | }else{ | 181 | }else{ |
| 157 | getApp().my_warnning(e.data.msg,0,th); | 182 | getApp().my_warnning(e.data.msg,0,th); |
| 183 | + | ||
| 184 | + setTimeout(()=>{ | ||
| 185 | + th.data.get_quan_ing=0; | ||
| 186 | + th.setData({ | ||
| 187 | + [txt_get]:0 | ||
| 188 | + }) | ||
| 189 | + }) | ||
| 158 | } | 190 | } |
| 159 | } | 191 | } |
| 160 | }) | 192 | }) |
packageB/pages/user/user_coupon/user_coupon.wxml
| @@ -82,8 +82,8 @@ | @@ -82,8 +82,8 @@ | ||
| 82 | </view> | 82 | </view> |
| 83 | </view> | 83 | </view> |
| 84 | 84 | ||
| 85 | - <view class="clik-get t-c white five-level-word abs {{filter.setcolor(item.UseObjectType)}} " | ||
| 86 | - wx:if="{{item.ObtainTimes>0 || item.SecondNo==0 }}" bindtap="get_quan" data-ind="{{index}}" >立即领取</view> | 85 | + <view class="clik-get t-c white five-level-word abs {{item.get_quan_ing?'g_gray':filter.setcolor(item.UseObjectType)}} " |
| 86 | + wx:if="{{item.ObtainTimes>0 || item.SecondNo==0 }}" bindtap="get_quan" data-ind="{{index}}" > {{item.get_quan_ing?'领取中':'立即领取'}}</view> | ||
| 87 | <view class="clik-get t-c white five-level-word abs g_gray" wx:else bindtap="get_out" data-ind="{{index}}" | 87 | <view class="clik-get t-c white five-level-word abs g_gray" wx:else bindtap="get_out" data-ind="{{index}}" |
| 88 | >已领取</view> | 88 | >已领取</view> |
| 89 | 89 |