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'))" :src="imageUrl(getImgName('rulesBt'))"
alt="" alt=""
style="display: block; width: 25vw" style="display: block; width: 25vw"
@click="ruleShow = true" @click="openPopup('rule')"
/> />
</div> </div>
@ -512,7 +512,7 @@
:src="imageUrl(getImgName('historyBt'))" :src="imageUrl(getImgName('historyBt'))"
alt="" alt=""
style="width: 15vw; position: absolute; top: 18vw; right: 4vw" 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" src="/src/assets/icon/helpWhite.png"
alt="" alt=""
class="ruleBt" class="ruleBt"
@click="helpShow = true" @click="openPopup('help')"
/> />
<!-- 名称 --> <!-- 名称 -->
<div <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 = () => { const closedPopup = () => {
resultShow.value = false resultShow.value = false
@ -2176,7 +2195,7 @@ const sweepstakes = async (consecutive = 1) => {
} }
} }
getDrawRecords() // getDrawRecords() //
resultShow.value = true openPopup('result') //
isRolling.value = false isRolling.value = false
} catch (error) { } catch (error) {
isRolling.value = false isRolling.value = false