From 66aed1d17e2e4a353ad10d93e7e4a7909dce51da Mon Sep 17 00:00:00 2001 From: hajimi Date: Mon, 3 Aug 2026 03:30:36 +0800 Subject: [PATCH] feat: add lottery follow action --- .../lottery_analysis/lottery_analysis.vue | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/uniapp/src/pages/lottery_analysis/lottery_analysis.vue b/uniapp/src/pages/lottery_analysis/lottery_analysis.vue index 5aaee01..de5db41 100644 --- a/uniapp/src/pages/lottery_analysis/lottery_analysis.vue +++ b/uniapp/src/pages/lottery_analysis/lottery_analysis.vue @@ -66,7 +66,16 @@ {{ (draw.game_name || '').substring(0, 1) }} - {{ draw.game_name || draw.code }} + + {{ draw.game_name || draw.code }} + + 第{{ draw.issue }}期 已开奖 @@ -235,6 +244,22 @@ const latestUpdatedAt = ref('--:--') const gameSelections = ref>(uni.getStorageSync('lottery_selections') || {}) const selectedGameCode = ref('') const selectedGameName = ref('') +const followedGameCodes = ref(uni.getStorageSync('lottery_followed_games') || []) + +const isFollowing = (code: string) => followedGameCodes.value.includes(code) + +const toggleFollow = (draw: any) => { + const code = draw?.code + if (!code) return + if (isFollowing(code)) { + followedGameCodes.value = followedGameCodes.value.filter((item) => item !== code) + uni.showToast({ title: '已取消关注', icon: 'none' }) + } else { + followedGameCodes.value = [...followedGameCodes.value, code] + uni.showToast({ title: '已关注', icon: 'none' }) + } + uni.setStorageSync('lottery_followed_games', followedGameCodes.value) +} const saveSelections = () => { uni.setStorageSync('lottery_selections', gameSelections.value) @@ -2286,4 +2311,30 @@ onReachBottom(() => { .latest-card__action { border-radius: 12rpx; } + +.latest-card__name-row { + display: flex; + align-items: center; + gap: 10rpx; + min-width: 0; +} + +.latest-card__name-row .latest-card__name { + flex: 1; + min-width: 0; +} + +.latest-card__follow { + display: inline-flex; + align-items: center; + gap: 4rpx; + flex-shrink: 0; + color: #1468e8; + font-size: 18rpx; + line-height: 1; +} + +.latest-card__follow--active { + color: #e6a23c; +}