hookehuyr

feat(Activities): 完成活动ID参数传递并禁用mock数据

- 在Activities页面添加activityId参数处理
- ActivitiesDetail页面跳转时传递activityId
- 在ActivitiesDetail和CheckinMap页面禁用mock数据(USE_MOCK_DATA=false)
- 完善活动ID在整个导航链路中的传递

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
...@@ -108,10 +108,10 @@ const handleGoBack = () => { ...@@ -108,10 +108,10 @@ const handleGoBack = () => {
108 /** 108 /**
109 * 构建包含位置参数的URL 109 * 构建包含位置参数的URL
110 */ 110 */
111 -const buildUrlWithLocation = (lng, lat, openid, discount_title) => { 111 +const buildUrlWithLocation = (lng, lat, openid, discount_title, activityId) => {
112 if (lng && lat && baseUrl.value) { 112 if (lng && lat && baseUrl.value) {
113 const separator = baseUrl.value.includes('?') ? '&' : '?' 113 const separator = baseUrl.value.includes('?') ? '&' : '?'
114 - return `${baseUrl.value}${separator}current_lng=${lng}&current_lat=${lat}&openid=${openid}&discount_title=${discount_title}` 114 + return `${baseUrl.value}${separator}current_lng=${lng}&current_lat=${lat}&openid=${openid}&discount_title=${discount_title}&activityId=${activityId}`
115 } 115 }
116 return baseUrl.value || '' 116 return baseUrl.value || ''
117 } 117 }
...@@ -143,13 +143,19 @@ const initPageData = async () => { ...@@ -143,13 +143,19 @@ const initPageData = async () => {
143 if (code) { 143 if (code) {
144 // 获取路由参数中的经纬度信息 144 // 获取路由参数中的经纬度信息
145 const instance = Taro.getCurrentInstance() 145 const instance = Taro.getCurrentInstance()
146 - const { current_lng, current_lat, discount_title } = instance.router?.params || {} 146 + const { current_lng, current_lat, discount_title, activityId } = instance.router?.params || {}
147 147
148 - console.log('接收到的位置参数:', { current_lng, current_lat, discount_title }) 148 + console.log('接收到的位置参数:', { current_lng, current_lat, discount_title, activityId })
149 // 处理用户信息 149 // 处理用户信息
150 const openid = data?.user.openid || '' 150 const openid = data?.user.openid || ''
151 // 构建完整的URL 151 // 构建完整的URL
152 - webUrl.value = buildUrlWithLocation(current_lng, current_lat, openid, discount_title) 152 + webUrl.value = buildUrlWithLocation(
153 + current_lng,
154 + current_lat,
155 + openid,
156 + discount_title,
157 + activityId
158 + )
153 159
154 console.log('最终WebView URL:', webUrl.value) 160 console.log('最终WebView URL:', webUrl.value)
155 } 161 }
......
1 <!-- 1 <!--
2 * @Date: 2026-02-09 2 * @Date: 2026-02-09
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2026-02-10 09:58:37 4 + * @LastEditTime: 2026-02-10 10:27:35
5 * @FilePath: /lls_program/src/pages/ActivitiesDetail/index.vue 5 * @FilePath: /lls_program/src/pages/ActivitiesDetail/index.vue
6 * @Description: 活动详情页面 - 完全使用 map_activity.js 新接口,支持多活动详情展示 6 * @Description: 活动详情页面 - 完全使用 map_activity.js 新接口,支持多活动详情展示
7 --> 7 -->
...@@ -155,8 +155,8 @@ import { THEME_COLORS } from '@/utils/config' ...@@ -155,8 +155,8 @@ import { THEME_COLORS } from '@/utils/config'
155 import { mockMapActivityDetailAPI } from '@/utils/mockData' 155 import { mockMapActivityDetailAPI } from '@/utils/mockData'
156 156
157 // 环境变量:是否使用 mock 数据 157 // 环境变量:是否使用 mock 数据
158 -const USE_MOCK_DATA = process.env.NODE_ENV === 'development' 158 +// const USE_MOCK_DATA = process.env.NODE_ENV === 'development'
159 -// const USE_MOCK_DATA = false 159 +const USE_MOCK_DATA = false
160 160
161 // 默认海报图 161 // 默认海报图
162 const defaultPoster = ref( 162 const defaultPoster = ref(
...@@ -581,7 +581,7 @@ const handleJoinActivity = async () => { ...@@ -581,7 +581,7 @@ const handleJoinActivity = async () => {
581 581
582 // 跳转到Activities页面,并传递位置参数 582 // 跳转到Activities页面,并传递位置参数
583 await Taro.navigateTo({ 583 await Taro.navigateTo({
584 - url: `/pages/Activities/index?current_lng=${userLocation.value.lng}&current_lat=${userLocation.value.lat}&discount_title=${activityData.value.discount_title}`, 584 + url: `/pages/Activities/index?current_lng=${userLocation.value.lng}&current_lat=${userLocation.value.lat}&discount_title=${activityData.value.discount_title}&activityId=${activityId.value}`,
585 }) 585 })
586 } catch (error) { 586 } catch (error) {
587 console.error('参加活动失败:', error) 587 console.error('参加活动失败:', error)
...@@ -974,6 +974,7 @@ const transformApiDataToActivityData = apiData => { ...@@ -974,6 +974,7 @@ const transformApiDataToActivityData = apiData => {
974 rules: rules, 974 rules: rules,
975 rewards: rewards, 975 rewards: rewards,
976 discount_title: apiData.discount_title || '打卡点专属优惠', 976 discount_title: apiData.discount_title || '打卡点专属优惠',
977 + activityId: apiData.id || '',
977 } 978 }
978 } 979 }
979 980
......
1 <!-- 1 <!--
2 * @Date: 2026-02-05 19:48:00 2 * @Date: 2026-02-05 19:48:00
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2026-02-10 10:19:50 4 + * @LastEditTime: 2026-02-10 10:32:43
5 * @FilePath: /lls_program/src/pages/CheckinMap/index.vue 5 * @FilePath: /lls_program/src/pages/CheckinMap/index.vue
6 * @Description: 便民地图列表页 6 * @Description: 便民地图列表页
7 --> 7 -->
...@@ -42,8 +42,8 @@ import { mockMapActivityListAPI } from '@/utils/mockData' ...@@ -42,8 +42,8 @@ import { mockMapActivityListAPI } from '@/utils/mockData'
42 import { useLoad } from '@tarojs/taro' 42 import { useLoad } from '@tarojs/taro'
43 43
44 // ⚠️ MOCK 数据开关 - 开发环境使用 mock 数据,生产环境使用真实 API 44 // ⚠️ MOCK 数据开关 - 开发环境使用 mock 数据,生产环境使用真实 API
45 -const USE_MOCK_DATA = process.env.NODE_ENV === 'development' 45 +// const USE_MOCK_DATA = process.env.NODE_ENV === 'development'
46 -// const USE_MOCK_DATA = false 46 +const USE_MOCK_DATA = false
47 47
48 // 默认封面图 48 // 默认封面图
49 const DEFAULT_COVER = 49 const DEFAULT_COVER =
......