ChoosePage.vue
3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!--
* @Date: 2025-12-30 13:58:55
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-31 14:43:54
* @FilePath: /mlaj/src/views/recall/ChoosePage.vue
* @Description: 文件描述
-->
<template>
<div class="choose-page w-full min-h-screen relative overflow-hidden flex flex-col items-center">
<VideoBackground />
<!-- 标题区域 -->
<div class="mt-20 flex flex-col items-center z-10 w-full px-8">
<img :src="titleImg" class="w-full max-w-[300px] mb-4 object-contain" alt="title" />
</div>
<!-- 容器靠页面底部对齐 -->
<div class="flex flex-col items-center h-full w-full px-6 pt-16 pb-8 relative mt-auto">
<div class="text-white text-center space-y-1 tracking-wider text-shadow-md mb-3">
<p class="text-lg">{{ viewOther.text }}</p>
</div>
<!-- Bottom Section -->
<div class="mt-auto w-full flex flex-col items-center text-center animate-fade-in-up delay-200">
<van-button block
class="submit-btn !rounded-lg !border-[#FFDD01] !text-[#FFF] !font-bold !text-lg !h-[48px] !max-w-xs !mb-4"
@click="handleViewOther">
立即查看
</van-button>
<van-button block
class="submit-btn !rounded-lg !border-[#FFDD01] !text-[#FFDD01] !font-bold !text-lg !h-[48px] !max-w-xs"
@click="handleViewTimeLine">
我的时光机
</van-button>
</div>
</div>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useTitle } from '@vueuse/core'
import VideoBackground from '@/components/media/VideoBackground.vue'
import { getQrcodeAPI, trackingAPI } from '@/api/recall_users'
// 导入图片
const titleImg = 'https://cdn.ipadbiz.cn/mlaj/recall/img/title007@2x.png'
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const id = $route.query.id || '';
const entry = $route.query.entry || '';
const viewOther = ref({})
const handleViewTimeLine = async () => {
// 进入台历H5登录页的埋点
await trackingAPI({
event_type: 'login_page',
entry
})
// 跳转到台历H5登录页
$router.push({
path:'/recall/login',
query: { entry }
})
}
const handleViewOther = async () => {
// 点击【查看内容】按钮埋点
await trackingAPI({
event_type: 'qrcode_redirect',
qrcode_id: id,
entry
})
if (viewOther.value.url) {
location.href = viewOther.value.url
} else {
console.error('URL is undefined')
}
}
onMounted(async () => {
// 进入这个新页面埋点
await trackingAPI({
event_type: 'qrcode_page',
qrcode_id: id,
entry
})
if (id) {
try {
const response = await getQrcodeAPI({ id })
if (response.code) {
viewOther.value = {
id: response.data.id,
text: response.data.title,
url: response.data.content_url,
}
}
} catch (error) {
console.error('Error fetching QR code:', error)
}
}
})
</script>
<style lang="less" scoped>
.choose-page {
.submit-btn {
background: linear-gradient(180deg, rgba(251, 249, 224, 0.3) 0%, rgba(41, 46, 1, 0.3) 100%) !important;
backdrop-filter: blur(4px);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
}
</style>