Fix:2604 【商城小程序】抽奖--双击“立即抽奖”,获得奖品两个,只弹出一个抽奖结果,应该限制快速多次点击时只抽一次奖,抽奖动画完成之前不管点多少次,都不能快速触发下一次抽奖

This commit is contained in:
linxi
2024-11-21 09:28:33 +08:00
parent 265507014e
commit 87027d9d4e
+7 -1
View File
@@ -117,7 +117,8 @@ export default {
},
imgData: [],
shareAppImg: '',
pageKeyId: Object.freeze('lotteryIndex')
pageKeyId: Object.freeze('lotteryIndex'),
isDisabled: false
}
},
computed: {
@@ -155,6 +156,8 @@ export default {
},
onSubmit() {
if(this.isDisabled) return
this.isDisabled = true
getPrize().then(res => {
if (res.success) {
this.diceResult = res.data
@@ -163,12 +166,15 @@ export default {
setTimeout(() => {
this.showDialog = true
this.showResult = true
this.isDisabled = false
this.diceImg = this.lotteryDetail.diceConfig['diceValues'][diceIndex]['diceValueImage']
setTimeout(() => {
this.init()
}, 1000)
}, 2800)
}
}).catch(() => {
this.isDisabled = false
})
},