hookehuyr

feat(checkin): 支持活动相关的URL参数传递

- 在 checkin/info 页面添加 activityId 和 discount_title 参数支持
- 在地图标记导航时传递 activityId 和 discount_title 参数
- 修复 discount_title 变量重复声明问题
- 确保 page_details 对象包含完整的 URL 参数

影响文件:
- src/views/checkin/info.vue: 在 watch 和 onMounted 中添加参数
- src/views/checkin/map.vue: 在标记点击导航时传递参数
- src/views/checkin/CLAUDE.md: 更新上下文记忆

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
......@@ -3,10 +3,13 @@
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
### Feb 9, 2026
### Feb 10, 2026
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #4119 | 2:13 PM | 🔵 | page_details data source identified in checkin info component | ~328 |
| #3978 | 11:52 AM | 🔵 | Code duplication identified in src/views directory structure | ~320 |
| #5325 | 11:20 AM | 🔄 | Removed duplicate discountTitle variable declaration in onMounted hook | ~218 |
| #5324 | 11:19 AM | 🔴 | Map marker navigation parameter handling completed for activityId and discount_title | ~322 |
| #5323 | " | 🔴 | Map marker navigation now properly passes activityId and discount_title parameters | ~305 |
| #5319 | 11:17 AM | 🔴 | Map marker navigation updated with activityId and discount_title parameters | ~313 |
| #5318 | " | 🔴 | Map marker popup navigation updated with new query parameters | ~255 |
</claude-mem-context>
\ No newline at end of file
......
......@@ -162,7 +162,16 @@ watch(
async (newInfo) => {
if (newInfo && newInfo.details && newInfo.details.length) {
// 更新page_details数据
page_details.value = { ...newInfo.details[0], position: newInfo.position, path: newInfo.path, current_lng: newInfo.current_lng, current_lat: newInfo.current_lat, openid: newInfo.openid };
page_details.value = {
...newInfo.details[0],
position: newInfo.position,
path: newInfo.path,
current_lng: newInfo.current_lng,
current_lat: newInfo.current_lat,
openid: newInfo.openid,
activityId: $route.query.activityId, // 添加 activityId 参数
discount_title: $route.query.discount_title // 添加 discount_title 参数
};
// 如果 URL 参数中有 discount_title,更新标签页默认标题
const discountTitle = $route.query.discount_title;
......@@ -256,15 +265,25 @@ onMounted(async () => {
const current_lng = $route.query.current_lng;
const current_lat = $route.query.current_lat;
const openid = $route.query.openid;
const activityId = $route.query.activityId; // 获取 activityId 参数
const discountTitle = $route.query.discount_title; // 获取 discount_title 参数
//
page_details.value = { ...current_marker.details[0], position: current_marker.position, path: current_marker.path, current_lng: current_lng, current_lat: current_lat, openid: openid };
page_details.value = {
...current_marker.details[0],
position: current_marker.position,
path: current_marker.path,
current_lng: current_lng,
current_lat: current_lat,
openid: openid,
activityId: activityId, // 添加 activityId 参数
discount_title: discountTitle // 添加 discount_title 参数
};
// 富文本转义, 分割线样式转换
page_details.value.introduction = page_details.value.introduction?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
page_details.value.story = page_details.value.story?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
page_details.value.experience = page_details.value.experience?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
// 如果 URL 参数中有 discount_title,更新标签页默认标题
const discountTitle = $route.query.discount_title;
if (discountTitle) {
tab_configs.value = updateDefaultTitleFromURL(discountTitle, tab_configs.value);
}
......
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-10-11 10:14:44
* @LastEditTime: 2026-02-10 11:23:01
* @FilePath: /map-demo/src/views/checkin/map.vue
* @Description: 公众地图主体页面
-->
......@@ -1432,6 +1432,8 @@ export default {
current_lng: this.itemInfo.current_lng,
current_lat: this.itemInfo.current_lat,
openid: this.itemInfo.openid,
activityId: this.$route.query.activityId, // 添加 activityId 参数
discount_title: this.$route.query.discount_title // 添加 discount_title 参数
}
})
} else {
......