feat(新年活动): 打开弹窗统一使用同个方法,确保打开前关闭其他弹窗

This commit is contained in:
hzj 2026-01-05 16:42:54 +08:00
parent 47789db1a9
commit f1f7d04e28

View File

@ -62,7 +62,7 @@
:src="imageUrl(getImgName('rulesBt'))"
alt=""
style="display: block; width: 25vw"
@click="ruleShow = true"
@click="openPopup('rule')"
/>
</div>
@ -512,7 +512,7 @@
:src="imageUrl(getImgName('historyBt'))"
alt=""
style="width: 15vw; position: absolute; top: 18vw; right: 4vw"
@click="historyShow = true"
@click="openPopup('history')"
/>
<!-- 抽奖转盘 -->
@ -958,7 +958,7 @@
src="/src/assets/icon/helpWhite.png"
alt=""
class="ruleBt"
@click="helpShow = true"
@click="openPopup('help')"
/>
<!-- 名称 -->
<div
@ -2058,6 +2058,25 @@ const exchangeCoinBt = async () => {
}
}
//
const openPopup = (type) => {
closedPopup() //
switch (type) {
case 'result':
resultShow.value = true
break
case 'help':
helpShow.value = true
break
case 'history':
historyShow.value = true
break
case 'rule':
ruleShow.value = true
break
}
}
//
const closedPopup = () => {
resultShow.value = false
@ -2176,7 +2195,7 @@ const sweepstakes = async (consecutive = 1) => {
}
}
getDrawRecords() //
resultShow.value = true
openPopup('result') //
isRolling.value = false
} catch (error) {
isRolling.value = false