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> </view>
<text>{{ game.name }}</text> <text>{{ game.name }}</text>
</view> </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> <text>全部</text>
<u-icon name="arrow-right" size="26" color="#7d8797" /> <u-icon name="arrow-right" size="26"
:color="!selectedGameCode ? '#fff' : '#7d8797'" />
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@@ -315,8 +317,7 @@ const switchHallTab = (value: string) => {
} }
const isGameChipActive = (game: any) => { const isGameChipActive = (game: any) => {
if (selectedGameCode.value) return selectedGameCode.value === game.code return selectedGameCode.value === game.code
return game.code === currentGames.value[0]?.code
} }
const selectAllGames = () => { const selectAllGames = () => {
@@ -357,10 +358,17 @@ const switchGameCategory = (val: number) => {
} }
const selectGame = (game: any) => { const selectGame = (game: any) => {
selectedGameCode.value = game.code if (selectedGameCode.value === game.code) {
selectedGameName.value = game.name selectedGameCode.value = ''
gameSelections.value[currentGameCategory.value] = { code: game.code, name: game.name } selectedGameName.value = ''
fetchDrawList(true) 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() saveSelections()
fetchLatest() fetchLatest()
} }
@@ -2336,6 +2344,12 @@ onReachBottom(() => {
color: #e6a23c; color: #e6a23c;
} }
.lottery-game-chip--all.lottery-game-chip--active {
background: #1468e8;
border-color: #1468e8;
color: #fff;
}
.latest-card__countdown { .latest-card__countdown {
font-size: 28rpx; font-size: 28rpx;
} }