hookehuyr

feat(components): 添加积分规则提示并优化测试用户检测逻辑

在PointsCollector和TotalPointsDisplay组件中添加积分规则提示入口
将WeRunAuth中的测试用户检测逻辑改为基于环境变量判断
移除Rewards页面中注释掉的积分攻略部分
<template>
<view class="points-collector" :style="{ height: height }">
<!-- 积分规则提示 -->
<view class="points-rule-tip" @tap="handleGoToPointsRule">
<view class="tip-icon">💡</view>
<text class="tip-text">积分规则</text>
</view>
<!-- 中心圆形显示总积分 -->
<view class="center-circle">
<view class="total-points" @tap="handleGoToRewards">
......@@ -417,6 +423,15 @@ const handleGoToRewards = () => {
})
}
/**
* 处理积分规则点击事件
*/
const handleGoToPointsRule = () => {
Taro.navigateTo({
url: '/pages/PointsList/index'
})
}
</script>
<style lang="less">
......@@ -428,6 +443,30 @@ const handleGoToRewards = () => {
overflow: hidden;
}
.points-rule-tip {
position: absolute;
background-color: white;
top: 0rpx;
right: 0rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 30;
cursor: pointer;
}
.tip-icon {
font-size: 32rpx;
margin-bottom: 4rpx;
}
.tip-text {
font-size: 20rpx;
color: #666;
line-height: 1;
}
.center-circle {
position: absolute;
left: 50%;
......
<template>
<view class="total-points-display" :style="{ height: height }">
<!-- 积分规则提示 -->
<view class="points-rule-tip" @tap="handleGoToPointsRule">
<view class="tip-icon">💡</view>
<text class="tip-text">积分规则</text>
</view>
<!-- 中心圆形显示总积分 -->
<view class="center-circle1">
<view class="total-points" @tap="handleGoToRewards">
......@@ -103,6 +109,15 @@ const handleGoToRewards = () => {
url: '/pages/RewardCategories/index',
})
}
/**
* 处理积分规则点击事件
*/
const handleGoToPointsRule = () => {
Taro.navigateTo({
url: '/pages/PointsList/index'
})
}
</script>
<style lang="less">
......@@ -115,6 +130,30 @@ const handleGoToRewards = () => {
align-items: center;
}
.points-rule-tip {
position: absolute;
background-color: white;
top: 0rpx;
right: 0rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 30;
cursor: pointer;
}
.tip-icon {
font-size: 32rpx;
margin-bottom: 4rpx;
}
.tip-text {
font-size: 20rpx;
color: #666;
line-height: 1;
}
.center-circle1 {
position: absolute;
left: 50%;
......
......@@ -125,25 +125,16 @@ const getWeRunData = async () => {
try {
isLoading.value = true
// 检查是否为测试用户(openid以h-开头),如果是则跳过步数同步
try {
const { getUserProfileAPI } = await import('@/api/user')
const profileResponse = await getUserProfileAPI()
if (profileResponse.code === 1 && profileResponse.data?.user?.openid) {
const openid = profileResponse.data.user.openid
if (openid.startsWith('h-')) {
console.log('检测到测试用户openid:', openid, '跳过步数同步')
Taro.showToast({
title: '测试用户无需同步步数',
icon: 'none',
duration: 2000
})
isLoading.value = false
return
}
}
} catch (profileError) {
console.warn('获取用户信息失败,继续执行步数同步:', profileError)
// 检查是否为测试环境下的测试用户,如果是则跳过步数同步
if (process.env.NODE_ENV === 'development') {
console.log('开发环境下跳过步数同步')
Taro.showToast({
title: '开发环境无需同步步数',
icon: 'none',
duration: 2000
})
isLoading.value = false
return
}
// 先调用 wx.login 获取 code
......
<!--
* @Date: 2025-08-27 17:47:26
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-04 21:38:56
* @LastEditTime: 2025-09-05 10:39:16
* @FilePath: /lls_program/src/pages/Rewards/index.vue
* @Description: 文件描述
-->
......@@ -19,16 +19,16 @@
</view>
<!-- Main content -->
<view class="bg-white rounded-t-3xl px-4 pt-5">
<!-- Points strategy section -->
<!-- <!~~ Points strategy section ~~>
<view v-if="!isCreator" class="mb-8 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-2xl p-5 shadow-sm border border-blue-100">
<view class="flex justify-between items-center mb-4">
<h3 class="text-lg font-medium text-gray-800">积分攻略</h3>
<view @tap="handleViewAll" class="text-blue-500 text-sm flex items-center hover:text-blue-600">
查看全部
<!-- <Right size="16" /> -->
<!~~ <Right size="16" /> ~~>
</view>
</view>
<!-- Strategy cards -->
<!~~ Strategy cards ~~>
<view v-if="isStrategyExpanded" class="space-y-3 mb-4 transition-all duration-300">
<view class="bg-white border border-gray-100 p-4 rounded-lg flex items-start shadow-sm">
<view class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3">
......@@ -64,12 +64,12 @@
</view>
</view>
</view>
<!-- Expand/Collapse button at bottom -->
<!~~ Expand/Collapse button at bottom ~~>
<view @tap="toggleStrategyExpand" class="flex justify-center items-center py-2 cursor-pointer hover:bg-blue-100 rounded-lg transition-colors">
<ArrowUp v-if="isStrategyExpanded" size="16" class="text-gray-500" />
<ArrowDown v-else size="16" class="text-gray-500" />
</view>
</view>
</view>-->
<!-- Quick exchange options -->
<!-- Search bar -->
<view class="mb-6">
......