【类 型】:factor
【原 因】:防止 重复点击按钮 【过 程】:给支付按钮加一个标记 点击之后改变按钮样式 并且标记点击过 点击过 则不继续执行pay 函数 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
5b6787aa49
commit
6abfd95c8a
@ -51,7 +51,7 @@
|
||||
})
|
||||
|
||||
} else if (name === 2) {
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: '/pages/main/index'
|
||||
})
|
||||
}
|
||||
|
@ -27,8 +27,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="pay" class="butBox fci bg-m rad8 fb fz36 flex mc p-24 m-l-24 m-r-24">确认支付</view>
|
||||
<!-- <button @click="pay" type="primary">确认支付</button> -->
|
||||
<view @click="pay" class="butBox fci bg-m rad8 fb fz36 flex mc p-24 m-l-24 m-r-24" :class="isPressed?'bg-g':'bg-m'">确认支付</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -48,6 +47,7 @@
|
||||
order_time: -1, //订单创建时间
|
||||
countdown: '', // 用于显示倒计时
|
||||
timer: null, // 存储计时器
|
||||
isPressed: false, //支付按钮是否锁定
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -113,6 +113,10 @@
|
||||
formatSeconds,
|
||||
// 支付方法
|
||||
pay() {
|
||||
if (this.isPressed) { //防止支付按钮重复点击
|
||||
return
|
||||
}
|
||||
this.isPressed = true
|
||||
uni.$u.http.post('/Api/Pay/pay', {
|
||||
order_sn: this.order_sn
|
||||
}, {
|
||||
|
Loading…
Reference in New Issue
Block a user