hookehuyr

feat(排行榜): 添加排行榜须知提示功能

在排行榜卡片和家庭排行榜页面添加问号图标,点击显示关于步数统计规则的提示对话框
1 <!-- 1 <!--
2 * @Date: 2025-01-09 00:00:00 2 * @Date: 2025-01-09 00:00:00
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-28 14:54:31 4 + * @LastEditTime: 2025-10-09 15:57:25
5 * @FilePath: /lls_program/src/components/RankingCard.vue 5 * @FilePath: /lls_program/src/components/RankingCard.vue
6 * @Description: 排行榜卡片组件 6 * @Description: 排行榜卡片组件
7 --> 7 -->
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
42 <view class="rank-content" :class="{ 'content-switching': isContentSwitching }"> 42 <view class="rank-content" :class="{ 'content-switching': isContentSwitching }">
43 <!-- 排行榜日期 --> 43 <!-- 排行榜日期 -->
44 <view class="rank-date relative"> 44 <view class="rank-date relative">
45 - {{ currentDate }} 45 + <view class="flex items-center justify-center">{{ currentDate }} <IconFont name="ask" size="16" class="ml-2" @click="handleRankAskClick"></IconFont></view>
46 <view v-if="activeTab === 'support'" class="absolute font-bold text-white bg-orange-500 top-0 rounded-full px-4 py-1" style="right: 30rpx; font-size: 23rpx;" @tap="joinOrganization">助力码</view> 46 <view v-if="activeTab === 'support'" class="absolute font-bold text-white bg-orange-500 top-0 rounded-full px-4 py-1" style="right: 30rpx; font-size: 23rpx;" @tap="joinOrganization">助力码</view>
47 </view> 47 </view>
48 48
...@@ -129,6 +129,27 @@ ...@@ -129,6 +129,27 @@
129 </view> 129 </view>
130 </view> 130 </view>
131 </view> 131 </view>
132 +
133 + <!-- 步数排行榜须知对话框 -->
134 + <nut-dialog
135 + v-model:visible="showRankTipDialog"
136 + title="温馨提示"
137 + >
138 + <template #default>
139 + <view class="text-gray-700 leading-loose text-sm text-left">为确保公平,排行榜将根据步数被系统成功记录和收集的日期进行统计,而非用户实际行走的日期。</view>
140 + </template>
141 + <template #footer>
142 + <nut-button
143 + @click="showRankTipDialog = false"
144 + type="primary"
145 + size="normal"
146 + :color="THEME_COLORS.PRIMARY"
147 + block
148 + >
149 + 我知道了
150 + </nut-button>
151 + </template>
152 + </nut-dialog>
132 </view> 153 </view>
133 </template> 154 </template>
134 155
...@@ -142,6 +163,8 @@ const defaultAvatar = 'https://cdn.ipadbiz.cn/lls_prog/images/%E5%85%A8%E5%AE%B6 ...@@ -142,6 +163,8 @@ const defaultAvatar = 'https://cdn.ipadbiz.cn/lls_prog/images/%E5%85%A8%E5%AE%B6
142 const supportImg = 'https://cdn.ipadbiz.cn/lls_prog/images/support_img_1.png' 163 const supportImg = 'https://cdn.ipadbiz.cn/lls_prog/images/support_img_1.png'
143 // 导入接口 164 // 导入接口
144 import { getStepLeaderboardAPI } from '@/api/points' 165 import { getStepLeaderboardAPI } from '@/api/points'
166 +// 导入主题颜色
167 +import { THEME_COLORS } from '@/utils/config';
145 168
146 // 区域信息 169 // 区域信息
147 import { SHANGHAI_REGION as shanghaiRegion } from '@/utils/config' 170 import { SHANGHAI_REGION as shanghaiRegion } from '@/utils/config'
...@@ -338,7 +361,13 @@ const handleViewMore = () => { ...@@ -338,7 +361,13 @@ const handleViewMore = () => {
338 } 361 }
339 } 362 }
340 363
341 - 364 +/**
365 + * 处理排行榜须知点击事件
366 + */
367 +const showRankTipDialog = ref(false)
368 +const handleRankAskClick = () => {
369 + showRankTipDialog.value = true
370 +}
342 371
343 // 计算前三名数据 372 // 计算前三名数据
344 const topRanks = computed(() => { 373 const topRanks = computed(() => {
......
1 <!-- 1 <!--
2 * @Date: 2025-09-01 13:07:52 2 * @Date: 2025-09-01 13:07:52
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2025-09-28 16:43:09 4 + * @LastEditTime: 2025-10-09 16:00:24
5 * @FilePath: /lls_program/src/pages/FamilyRank/index.vue 5 * @FilePath: /lls_program/src/pages/FamilyRank/index.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
40 40
41 <!-- 排行榜日期 --> 41 <!-- 排行榜日期 -->
42 <view v-if="!loading" class="rank-date relative"> 42 <view v-if="!loading" class="rank-date relative">
43 - {{ currentDate }} 43 + <view class="flex items-center justify-center">{{ currentDate }} <IconFont name="ask" size="14" class="ml-2" @click="handleRankAskClick"></IconFont></view>
44 <view v-if="activeTab === 'support'" class="absolute font-bold text-white bg-orange-500 top-0 rounded-full px-4 py-1" style="right: 70rpx; font-size: 23rpx;" @tap="joinOrganization">助力码</view> 44 <view v-if="activeTab === 'support'" class="absolute font-bold text-white bg-orange-500 top-0 rounded-full px-4 py-1" style="right: 70rpx; font-size: 23rpx;" @tap="joinOrganization">助力码</view>
45 </view> 45 </view>
46 46
...@@ -160,6 +160,27 @@ ...@@ -160,6 +160,27 @@
160 </view> 160 </view>
161 </view> 161 </view>
162 162
163 + <!-- 步数排行榜须知对话框 -->
164 + <nut-dialog
165 + v-model:visible="showRankTipDialog"
166 + title="温馨提示"
167 + >
168 + <template #default>
169 + <view class="text-gray-700 leading-loose text-sm text-left">为确保公平,排行榜将根据步数被系统成功记录和收集的日期进行统计,而非用户实际行走的日期。</view>
170 + </template>
171 + <template #footer>
172 + <nut-button
173 + @click="showRankTipDialog = false"
174 + type="primary"
175 + size="normal"
176 + :color="THEME_COLORS.PRIMARY"
177 + block
178 + >
179 + 我知道了
180 + </nut-button>
181 + </template>
182 + </nut-dialog>
183 +
163 <!-- 返回顶部组件 --> 184 <!-- 返回顶部组件 -->
164 <BackToTop :distance="200" /> 185 <BackToTop :distance="200" />
165 </view> 186 </view>
...@@ -168,12 +189,15 @@ ...@@ -168,12 +189,15 @@
168 <script setup> 189 <script setup>
169 import { ref, computed, onMounted } from 'vue' 190 import { ref, computed, onMounted } from 'vue'
170 import Taro from '@tarojs/taro' 191 import Taro from '@tarojs/taro'
192 +import { IconFont } from '@nutui/icons-vue-taro';
171 import BackToTop from '@/components/BackToTop.vue' 193 import BackToTop from '@/components/BackToTop.vue'
172 // 默认头像 194 // 默认头像
173 const defaultAvatar = 'https://cdn.ipadbiz.cn/lls_prog/images/%E5%85%A8%E5%AE%B6%E7%A6%8F3_%E5%89%AF%E6%9C%AC.jpg?imageMogr2/strip/quality/60' 195 const defaultAvatar = 'https://cdn.ipadbiz.cn/lls_prog/images/%E5%85%A8%E5%AE%B6%E7%A6%8F3_%E5%89%AF%E6%9C%AC.jpg?imageMogr2/strip/quality/60'
174 const supportImg = 'https://cdn.ipadbiz.cn/lls_prog/images/support_img_1.png' 196 const supportImg = 'https://cdn.ipadbiz.cn/lls_prog/images/support_img_1.png'
175 // 导入接口 197 // 导入接口
176 import { getStepLeaderboardAPI } from '@/api/points' 198 import { getStepLeaderboardAPI } from '@/api/points'
199 +// 导入主题颜色
200 +import { THEME_COLORS } from '@/utils/config';
177 201
178 // 区域信息 202 // 区域信息
179 import { SHANGHAI_REGION as shanghaiRegion } from '@/utils/config' 203 import { SHANGHAI_REGION as shanghaiRegion } from '@/utils/config'
...@@ -209,7 +233,13 @@ const loading = ref(false) ...@@ -209,7 +233,13 @@ const loading = ref(false)
209 // 当前日期 233 // 当前日期
210 const currentDate = ref('') 234 const currentDate = ref('')
211 235
212 - 236 +/**
237 + * 处理排行榜须知点击事件
238 + */
239 +const showRankTipDialog = ref(false)
240 +const handleRankAskClick = () => {
241 + showRankTipDialog.value = true
242 +}
213 243
214 /** 244 /**
215 * 切换tab 245 * 切换tab
......