fix: 防抖

This commit is contained in:
zhangds 2024-05-31 18:31:02 +08:00
parent b6f50bcd01
commit da36cd6842
1 changed files with 8 additions and 2 deletions

View File

@ -89,8 +89,9 @@
}}</button>
<button type="button" class="ok-btn" @click="popOkBtn(state.popOkType)"
v-if="state.popOkType === 2 ? false : true">{{ state.popObj.btnOk
<button type="button" class="ok-btn" :disabled="state.popLoading"
@click="popOkBtn(state.popOkType)" v-if="state.popOkType === 2 ? false : true">{{
state.popObj.btnOk
}}</button>
</div>
</div>
@ -130,6 +131,7 @@
userPhone: "",
popOkType: 0,
popObj: {},
popLoading: false,
popObjArr: [
{
id: 1,
@ -182,6 +184,10 @@
const popOkBtn = (type = 0) => {
if (type === 0) {
state.popLoading = true;
setTimeout(() => {
state.popLoading = false;
}, 500)
req.axiosPost("/front/order/create", { prize_id: state.isChecked }).then(res => {
if (res.code === 200) {
state.popObj = state.popObjArr[1];