添加按钮点击限制
This commit is contained in:
parent
4f1d7507ed
commit
d4682d9bae
@ -21,7 +21,7 @@
|
||||
</price-format>
|
||||
</view>
|
||||
</view>
|
||||
<button class="btn br60 white" size="md" hover-class="none" @tap="handlePrepay">
|
||||
<button class="btn br60 white" size="md" hover-class="none" @tap="$u.throttle(handlePrepay, 1000)">
|
||||
支付
|
||||
</button>
|
||||
</view>
|
||||
@ -78,6 +78,8 @@
|
||||
<button class="br60 btn" type="primary" size="md" @tap="onShowFailPopup">好的</button>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<pay-keyboard :showPay="showPay" :money="payMoney" :info="payInfo" @paySuccess="onBalancePay" @closeKeyboard="closeKeyboard"></pay-keyboard>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -108,7 +110,10 @@
|
||||
lstore_id: 0,
|
||||
info: [],
|
||||
goods_id: 0,
|
||||
goods: []
|
||||
goods: [],
|
||||
showPay: false,
|
||||
payInfo: '',
|
||||
payMoney: ''
|
||||
};
|
||||
},
|
||||
|
||||
@ -225,22 +230,18 @@
|
||||
|
||||
// 余额支付
|
||||
if (this.payway == 3) {
|
||||
localBalance({
|
||||
money: this.money,
|
||||
lid: this.lstore_id,
|
||||
user_id: this.user_id
|
||||
}).then((result) => {
|
||||
let status = 'fail'
|
||||
if (result.code == 1) {
|
||||
status = 'success'
|
||||
}
|
||||
this.handPayResult(status)
|
||||
})
|
||||
this.showPay = true
|
||||
this.payInfo = '向商家支付 ¥' + this.money
|
||||
this.payMoney = this.money
|
||||
}
|
||||
|
||||
|
||||
// 微信支付
|
||||
if (this.payway == 1) {
|
||||
uni.showLoading({
|
||||
title: '支付中',
|
||||
mask: true
|
||||
})
|
||||
localShopPayWeixin({
|
||||
money: this.money,
|
||||
lid: this.lstore_id,
|
||||
@ -257,8 +258,9 @@
|
||||
this.handleWechatPay(pay);
|
||||
}
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 微信支付
|
||||
@ -284,6 +286,8 @@
|
||||
|
||||
this.cancelPopup = true
|
||||
}
|
||||
|
||||
this.showPay = false
|
||||
},
|
||||
|
||||
onShowSuccessPopup() {
|
||||
@ -297,7 +301,28 @@
|
||||
|
||||
onShowFailPopup() {
|
||||
this.cancelPopup = !this.cancelPopup
|
||||
}
|
||||
},
|
||||
onBalancePay() {
|
||||
uni.showLoading({
|
||||
title: '支付中',
|
||||
mask: true
|
||||
})
|
||||
localBalance({
|
||||
money: this.money,
|
||||
lid: this.lstore_id,
|
||||
user_id: this.user_id
|
||||
}).then((result) => {
|
||||
let status = 'fail'
|
||||
if (result.code == 1) {
|
||||
status = 'success'
|
||||
}
|
||||
this.handPayResult(status)
|
||||
})
|
||||
uni.hideLoading()
|
||||
},
|
||||
closeKeyboard() {
|
||||
this.showPay = false
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user