【类 型】:fix

【主	题】:提交订单按钮 防止重复提交
【描	述】:
	[原因]:跳转页面时异步的 狂点按钮会致 添加多条订单记录
	[过程]:给按钮加状态 处于按过的状态 不再提交订单
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-06-05 19:00:42 +08:00
parent 1cb1a23327
commit b3a0c1bd0e
2 changed files with 35 additions and 2 deletions

27
pages/main/order.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<view>
<!-- topbar -->
<u-navbar title="订单查询" bgColor="#d43030" :titleStyle="{ color: '#FFF'}" :autoBack="true" placeholder>
<view class="u-nav-slot" slot="left">
<u-icon name="arrow-left" color="#fff" size="19"></u-icon>
</view>
</u-navbar>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -44,8 +44,8 @@
<text class="fz24">合计</text>
<text class="fz44">¥{{total | formatPrice}}</text>
</view>
<view class="fz32 bg-m flex column mac mc fci rad16 m-r-24" style="width:220rpx;height:100rpx;"
@click="handleCheckout">
<view class="fz32 flex column mac mc fci rad16 m-r-24" style="width:220rpx;height:100rpx;"
@click="handleCheckout" :class="isPressed?'bg-g':'bg-m'">
<view>提交订单</view>
<view>Checkout</view>
</view>
@ -64,6 +64,7 @@
export default {
data() {
return {
isPressed: false, //
remark: '' //
}
},
@ -90,6 +91,10 @@
totalPrice,
//
handleCheckout() {
if (this.isPressed) {//
return
}
this.isPressed = true
//
uni.$u.http.post('/Api/Check/checkout', {
cartList: JSON.stringify(this.cartList), //
@ -126,6 +131,7 @@
title: res.data.msg,
icon: 'error'
})
this.isPressed = false
}
})
}