Commit c78b7584b6b0c9af369f3e85c91676179ae62b29
1 parent
87bad082
服务卡项点击要避免重复点击的优化。
Showing
4 changed files
with
39 additions
and
19 deletions
packageA/pages/details_serviceCard/details_serviceCard.js
@@ -659,7 +659,9 @@ Page({ | @@ -659,7 +659,9 @@ Page({ | ||
659 | async pay() { | 659 | async pay() { |
660 | 660 | ||
661 | if(this.data.is_summit_ing) return false; | 661 | if(this.data.is_summit_ing) return false; |
662 | - this.data.is_summit_ing=1; | 662 | + this.setData({ |
663 | + is_summit_ing:1 | ||
664 | + }) | ||
663 | 665 | ||
664 | var th=this; | 666 | var th=this; |
665 | let order_sn = this.data.details.order_sn; | 667 | let order_sn = this.data.details.order_sn; |
@@ -688,7 +690,7 @@ Page({ | @@ -688,7 +690,7 @@ Page({ | ||
688 | let the_c_key=it.pickup_keyid; | 690 | let the_c_key=it.pickup_keyid; |
689 | if (card.storageId.indexOf(the_c_key)==-1) { | 691 | if (card.storageId.indexOf(the_c_key)==-1) { |
690 | getApp().confirmBox(it.service_name + "的门店不可售"); | 692 | getApp().confirmBox(it.service_name + "的门店不可售"); |
691 | - th.setData({ paying: 0 }); | 693 | + th.setData({ is_summit_ing: 0 }); |
692 | flag = false; | 694 | flag = false; |
693 | return false; | 695 | return false; |
694 | } | 696 | } |
@@ -736,7 +738,7 @@ Page({ | @@ -736,7 +738,7 @@ Page({ | ||
736 | }) | 738 | }) |
737 | if(idx0<0){ | 739 | if(idx0<0){ |
738 | getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); | 740 | getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); |
739 | - th.setData({ paying: 0 }); | 741 | + th.setData({ is_summit_ing: 0 }); |
740 | flag = false; | 742 | flag = false; |
741 | return false; | 743 | return false; |
742 | } | 744 | } |
@@ -970,7 +972,7 @@ Page({ | @@ -970,7 +972,7 @@ Page({ | ||
970 | }) | 972 | }) |
971 | 973 | ||
972 | if(!flag) { | 974 | if(!flag) { |
973 | - th.data.ser_paying=0; | 975 | + th.setData({ is_summit_ing: 0 }); |
974 | return false; | 976 | return false; |
975 | } | 977 | } |
976 | 978 | ||
@@ -1041,7 +1043,7 @@ Page({ | @@ -1041,7 +1043,7 @@ Page({ | ||
1041 | }, 1000) | 1043 | }, 1000) |
1042 | 1044 | ||
1043 | }, function (e) { | 1045 | }, function (e) { |
1044 | - th.data.is_summit_ing = 0; | 1046 | + th.setData({ is_summit_ing: 0 }); |
1045 | wx.showToast({ | 1047 | wx.showToast({ |
1046 | title: e, | 1048 | title: e, |
1047 | icon: 'none', | 1049 | icon: 'none', |
@@ -1049,7 +1051,7 @@ Page({ | @@ -1049,7 +1051,7 @@ Page({ | ||
1049 | }); | 1051 | }); |
1050 | }) | 1052 | }) |
1051 | }else{ | 1053 | }else{ |
1052 | - this.data.is_summit_ing=0; | 1054 | + th.setData({ is_summit_ing: 0 }); |
1053 | } | 1055 | } |
1054 | 1056 | ||
1055 | }, | 1057 | }, |
packageA/pages/details_serviceCard/details_serviceCard.wxml
@@ -83,12 +83,18 @@ | @@ -83,12 +83,18 @@ | ||
83 | <!-- 待支付 --> | 83 | <!-- 待支付 --> |
84 | <block wx:if="{{details.pay_status == 0 && details.order_status==0 && details.prom_type!=6 }}"> | 84 | <block wx:if="{{details.pay_status == 0 && details.order_status==0 && details.prom_type!=6 }}"> |
85 | <text class="btn btn-border" bindtap="cancle">取消订单</text> | 85 | <text class="btn btn-border" bindtap="cancle">取消订单</text> |
86 | - <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> | 86 | + <text class="btn bg-red white mgl20" bindtap="pay"> |
87 | + <block wx:if="{{is_summit_ing}}">支付中</block> | ||
88 | + <block wx:else>立即支付</block> | ||
89 | + </text> | ||
87 | </block> | 90 | </block> |
88 | 91 | ||
89 | <block wx:if="{{details.pt_status == 0 && details.order_status<2 && details.prom_type==6 }}"> | 92 | <block wx:if="{{details.pt_status == 0 && details.order_status<2 && details.prom_type==6 }}"> |
90 | <text class="btn btn-border" bindtap="cancle">取消订单</text> | 93 | <text class="btn btn-border" bindtap="cancle">取消订单</text> |
91 | - <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> | 94 | + <text class="btn bg-red white mgl20" bindtap="pay"> |
95 | + <block wx:if="{{is_summit_ing}}">支付中</block> | ||
96 | + <block wx:else>立即支付</block> | ||
97 | + </text> | ||
92 | </block> | 98 | </block> |
93 | 99 | ||
94 | <block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}"> | 100 | <block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}"> |
pages/user/order_list/order_list.js
@@ -3142,9 +3142,13 @@ Page({ | @@ -3142,9 +3142,13 @@ Page({ | ||
3142 | let th=this; | 3142 | let th=this; |
3143 | 3143 | ||
3144 | if(th.data.ser_paying) return false; | 3144 | if(th.data.ser_paying) return false; |
3145 | - th.data.ser_paying=1; | ||
3146 | - | 3145 | + //th.data.ser_paying=1; |
3147 | let index = e.currentTarget.dataset.index; | 3146 | let index = e.currentTarget.dataset.index; |
3147 | + | ||
3148 | + //避免重复点击 | ||
3149 | + var txt="ser_paying["+index+"]"; | ||
3150 | + this.setData({[txt]:1}); | ||
3151 | + | ||
3148 | let item = this.data.cardList[index]; | 3152 | let item = this.data.cardList[index]; |
3149 | let order_sn = item.order_sn; | 3153 | let order_sn = item.order_sn; |
3150 | let order_id = item.order_id; | 3154 | let order_id = item.order_id; |
@@ -3169,7 +3173,7 @@ Page({ | @@ -3169,7 +3173,7 @@ Page({ | ||
3169 | let the_c_key=it.pickup_keyid; | 3173 | let the_c_key=it.pickup_keyid; |
3170 | if (card.storageId.indexOf(the_c_key)==-1) { | 3174 | if (card.storageId.indexOf(the_c_key)==-1) { |
3171 | getApp().confirmBox(it.service_name + "的门店不可售"); | 3175 | getApp().confirmBox(it.service_name + "的门店不可售"); |
3172 | - th.setData({ paying: 0 }); | 3176 | + th.setData({ ser_paying: 0 }); |
3173 | flag = false; | 3177 | flag = false; |
3174 | return false; | 3178 | return false; |
3175 | } | 3179 | } |
@@ -3226,7 +3230,7 @@ Page({ | @@ -3226,7 +3230,7 @@ Page({ | ||
3226 | }) | 3230 | }) |
3227 | if(idx0<0){ | 3231 | if(idx0<0){ |
3228 | getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); | 3232 | getApp().confirmBox(it.service_name + "秒杀活动的门店不可售"); |
3229 | - th.setData({ paying: 0 }); | 3233 | + th.setData({ ser_paying: 0 }); |
3230 | flag = false; | 3234 | flag = false; |
3231 | return false; | 3235 | return false; |
3232 | } | 3236 | } |
@@ -3304,7 +3308,7 @@ Page({ | @@ -3304,7 +3308,7 @@ Page({ | ||
3304 | 3308 | ||
3305 | }; | 3309 | }; |
3306 | //-- 拼团 -- | 3310 | //-- 拼团 -- |
3307 | - if (it.prom_type == 6) { | 3311 | + if (it.prom_type == 6 ) { |
3308 | let act_details = null; | 3312 | let act_details = null; |
3309 | let redis_num = 0; | 3313 | let redis_num = 0; |
3310 | let promcardbuynum = 0; | 3314 | let promcardbuynum = 0; |
@@ -3395,7 +3399,7 @@ Page({ | @@ -3395,7 +3399,7 @@ Page({ | ||
3395 | 3399 | ||
3396 | } | 3400 | } |
3397 | //-- 预售 -- | 3401 | //-- 预售 -- |
3398 | - if (it.prom_type == 8) { | 3402 | + if (it.prom_type == 8 ) { |
3399 | 3403 | ||
3400 | let act_details = null; | 3404 | let act_details = null; |
3401 | let promcardbuynum = 0; | 3405 | let promcardbuynum = 0; |
@@ -3458,7 +3462,7 @@ Page({ | @@ -3458,7 +3462,7 @@ Page({ | ||
3458 | }) | 3462 | }) |
3459 | 3463 | ||
3460 | if(!flag) { | 3464 | if(!flag) { |
3461 | - th.data.ser_paying=0; | 3465 | + th.setData({ ser_paying: 0 }); |
3462 | return false; | 3466 | return false; |
3463 | } | 3467 | } |
3464 | 3468 | ||
@@ -3523,7 +3527,7 @@ Page({ | @@ -3523,7 +3527,7 @@ Page({ | ||
3523 | 3527 | ||
3524 | 3528 | ||
3525 | }, function (e) { | 3529 | }, function (e) { |
3526 | - th.data.ser_paying=0; | 3530 | + th.setData({ ser_paying: 0 }); |
3527 | wx.showToast({ | 3531 | wx.showToast({ |
3528 | title: e, | 3532 | title: e, |
3529 | icon: 'none', | 3533 | icon: 'none', |
@@ -3553,7 +3557,7 @@ Page({ | @@ -3553,7 +3557,7 @@ Page({ | ||
3553 | // // } | 3557 | // // } |
3554 | // }); | 3558 | // }); |
3555 | }else { | 3559 | }else { |
3556 | - th.data.ser_paying=0; | 3560 | + th.setData({ ser_paying: 0 }); |
3557 | } | 3561 | } |
3558 | 3562 | ||
3559 | }, | 3563 | }, |
pages/user/order_list/order_list.wxml
@@ -480,10 +480,18 @@ | @@ -480,10 +480,18 @@ | ||
480 | </block> | 480 | </block> |
481 | 481 | ||
482 | <navigator class="commodity_To_evaluate flex-level comment_go" | 482 | <navigator class="commodity_To_evaluate flex-level comment_go" |
483 | - bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}">立即支付</navigator> | 483 | + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}"> |
484 | + <text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text> | ||
485 | + <text wx:else>立即支付</text> | ||
486 | + | ||
487 | + </navigator> | ||
484 | 488 | ||
485 | <navigator class="commodity_To_evaluate flex-level comment_go" | 489 | <navigator class="commodity_To_evaluate flex-level comment_go" |
486 | - bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> | 490 | + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}"> |
491 | + <text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text> | ||
492 | + <text wx:else>立即支付</text> | ||
493 | + | ||
494 | + </navigator> | ||
487 | 495 | ||
488 | <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" | 496 | <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" |
489 | data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | 497 | data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> |