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