优化支付防抖

This commit is contained in:
duan
2024-05-27 13:55:36 +08:00
parent af720a1bab
commit 2ea1f162b0
3 changed files with 10 additions and 5 deletions

View File

@@ -94,7 +94,7 @@
<view class="">
{{Quantity}} 已优惠{{calculateEvent(info.save) }}
</view>
<button class="btnStyle" @click="sumbitFrom">提交订单</button>
<button class="btnStyle" @click="sumbitFroms">提交订单</button>
</view>
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-show="ispws"></payPassword>
</view>
@@ -180,6 +180,10 @@
shopId_id: this.info.shopId
})
},
// 防抖
sumbitFroms(){
uni.$u.throttle(this.sumbitFrom, 500)
},
async sumbitFrom() {
let payMoney = this.info.salePrice * this.Quantity
let res = await this.api.creatGroupOrder({
@@ -198,7 +202,6 @@
} else {
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
let isVip = uni.cache.get('userInfo').isPwd
console.log(isVip,'调试1')
if (isVip == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', {
shopId_id: uni.cache.get('shopUser')