fix: clear lottery category active state

This commit is contained in:
hajimi
2026-08-03 03:39:31 +08:00
parent 556d72c193
commit 1e589357fe
@@ -34,9 +34,11 @@
</view>
<text>{{ game.name }}</text>
</view>
<view class="lottery-game-chip lottery-game-chip--all" @tap="selectAllGames">
<view class="lottery-game-chip lottery-game-chip--all"
:class="{ 'lottery-game-chip--active': !selectedGameCode }" @tap="selectAllGames">
<text>全部</text>
<u-icon name="arrow-right" size="26" color="#7d8797" />
<u-icon name="arrow-right" size="26"
:color="!selectedGameCode ? '#fff' : '#7d8797'" />
</view>
</view>
</scroll-view>
@@ -315,8 +317,7 @@ const switchHallTab = (value: string) => {
}
const isGameChipActive = (game: any) => {
if (selectedGameCode.value) return selectedGameCode.value === game.code
return game.code === currentGames.value[0]?.code
return selectedGameCode.value === game.code
}
const selectAllGames = () => {
@@ -357,10 +358,17 @@ const switchGameCategory = (val: number) => {
}
const selectGame = (game: any) => {
selectedGameCode.value = game.code
selectedGameName.value = game.name
gameSelections.value[currentGameCategory.value] = { code: game.code, name: game.name }
fetchDrawList(true)
if (selectedGameCode.value === game.code) {
selectedGameCode.value = ''
selectedGameName.value = ''
drawList.value = []
delete gameSelections.value[currentGameCategory.value]
} else {
selectedGameCode.value = game.code
selectedGameName.value = game.name
gameSelections.value[currentGameCategory.value] = { code: game.code, name: game.name }
fetchDrawList(true)
}
saveSelections()
fetchLatest()
}
@@ -2336,6 +2344,12 @@ onReachBottom(() => {
color: #e6a23c;
}
.lottery-game-chip--all.lottery-game-chip--active {
background: #1468e8;
border-color: #1468e8;
color: #fff;
}
.latest-card__countdown {
font-size: 28rpx;
}