申请租赁页面-补充订单提交中提示,增加遮罩防止用户重复下订单

This commit is contained in:
WindowBird 2025-09-11 16:17:45 +08:00
parent a4c2efa42a
commit 1fd14d5b2a

View File

@ -95,7 +95,7 @@
<!-- 支付区域 --> <!-- 支付区域 -->
<view class="payment-section"> <view class="payment-section">
<button :class="['pay-button']" @click="handlePayment"> <button :class="['pay-button']" @click="goTohandlePayment">
{{ `立即支付 ¥${payAmount}` }} {{ `立即支付 ¥${payAmount}` }}
</button> </button>
@ -170,6 +170,7 @@
</view> </view>
</view> </view>
</uv-popup> </uv-popup>
<uv-toast ref="toast"></uv-toast>
</view> </view>
</template> </template>
@ -390,6 +391,10 @@ export default {
toggleDetails() { toggleDetails() {
this.showDetails = !this.showDetails this.showDetails = !this.showDetails
}, },
goTohandlePayment() {
uni.$uv.debounce(this.handlePayment, 1000, true)
},
handlePayment() { handlePayment() {
this.formData.payAmount = this.payAmount this.formData.payAmount = this.payAmount
if (checkLoginStatus()) { if (checkLoginStatus()) {
@ -476,9 +481,15 @@ export default {
content: `确认支付 ¥${this.payAmount} 吗?\n\n${this.formData.quantity}${this.formData.equipment}\n周期${this.formData.period}`, content: `确认支付 ¥${this.payAmount} 吗?\n\n${this.formData.quantity}${this.formData.equipment}\n周期${this.formData.period}`,
success: async res => { success: async res => {
if (res.confirm) { if (res.confirm) {
this.$refs.toast.show({
type: 'loading',
message: '正在提交订单中...',
overlay: true, //
duration: 10000,
})
// API // API
const response = await createLeaseOrder(this.formData) const response = await createLeaseOrder(this.formData)
this.$refs.toast.hide()
if (response.code === 200) { if (response.code === 200) {
const data = response.data const data = response.data
console.log(data) console.log(data)