hookehuyr

详情页数据查询后显示调整

1 <!-- 1 <!--
2 * @Date: 2024-09-15 22:08:49 2 * @Date: 2024-09-15 22:08:49
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-09-21 13:20:20 4 + * @LastEditTime: 2024-09-22 13:30:28
5 * @FilePath: /map-demo/src/views/bieyuan/info.vue 5 * @FilePath: /map-demo/src/views/bieyuan/info.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
8 <template> 8 <template>
9 <div class="info-page"> 9 <div class="info-page">
10 - <div style="position: relative;"> 10 + <div class="info-header-wrapper">
11 <van-config-provider :theme-vars="themeVars"> 11 <van-config-provider :theme-vars="themeVars">
12 <van-swipe class="my-swipe" indicator-color="#DD7850" lazy-render :autoplay="5000"> 12 <van-swipe class="my-swipe" indicator-color="#DD7850" lazy-render :autoplay="5000">
13 <van-swipe-item v-for="image in images" :key="image"> 13 <van-swipe-item v-for="image in images" :key="image">
...@@ -17,90 +17,89 @@ ...@@ -17,90 +17,89 @@
17 </van-config-provider> 17 </van-config-provider>
18 <div class="header-z"></div> 18 <div class="header-z"></div>
19 </div> 19 </div>
20 - <!-- <div style="position: absolute; top: 12.5rem;"> --> 20 + <div class="info-content-wrapper">
21 - <div> 21 + <div class="info-header">
22 - <div class="info-content-wrapper"> 22 + <div>
23 - <div class="info-header"> 23 + <p class="info-title">{{ page_details.name }}</p>
24 - <div> 24 + <p class="info-sub-title">{{ page_details.note }}</p>
25 - <p class="info-title">选佛场</p>
26 - <p class="info-sub-title">南楼2层</p>
27 - </div>
28 - <div @click="goTo()" class="info-btn">前往</div>
29 </div> 25 </div>
30 - <div class="van-hairline--bottom"> 26 + <div @click="goTo()" class="info-btn">前往</div>
31 - <van-tabs ref="tabsRef" v-model:active="active" @click-tab="clickTab" color="#DD7850" title-active-color="#DD7850" sticky animated> 27 + </div>
32 - <van-tab title="介 绍"> 28 + <div class="van-hairline--bottom">
33 - <div class="info-content"> 29 + <van-tabs ref="tabsRef" v-model:active="active" @click-tab="clickTab" color="#DD7850" title-active-color="#DD7850" sticky animated>
34 - <p style="line-height: 1.75; padding: 0 0.85rem; color: #47525F;">选佛场是一个宗教活动场所,集禅堂与讲堂功能于一体。其设计仿制古代石窟样式,把古代人修行的场所“石窟”搬进室内。禅堂内的释迦牟尼佛像,仿麦积山石窟第44号特窟“东方的微笑”的造型。禅堂设计自然古朴,匠心独运,星光、烛光、月光三光辉映,营造出“一个人不孤单,一千人不喧闹”的宁静祥和的氛围。禅堂可容纳千人,开展讲经、禅修、法会等多种活动,提供礼佛、供灯、静坐等体验。</p> 30 + <van-tab title="介 绍">
35 - <div class="van-hairline--bottom" style="margin: 1rem 0;"></div> 31 + <div class="info-content">
36 - <div style="padding: 1rem;"> 32 + <!-- <p style="line-height: 1.75; padding: 0 0.85rem; color: #47525F;">选佛场是一个宗教活动场所,集禅堂与讲堂功能于一体。其设计仿制古代石窟样式,把古代人修行的场所“石窟”搬进室内。禅堂内的释迦牟尼佛像,仿麦积山石窟第44号特窟“东方的微笑”的造型。禅堂设计自然古朴,匠心独运,星光、烛光、月光三光辉映,营造出“一个人不孤单,一千人不喧闹”的宁静祥和的氛围。禅堂可容纳千人,开展讲经、禅修、法会等多种活动,提供礼佛、供灯、静坐等体验。</p>
37 - <div style="color: #DD7850;">•&nbsp;五方塔</div> 33 + <div class="van-hairline--bottom" style="margin: 1rem 0;"></div>
38 - <div style="color: #47525F; margin-top: 1rem; line-height: 1.75;">禅堂外的草坪,安立着大小不一五座佛塔。信众可绕塔或悬挂风铃祝愿祈福,在肃静庄严的氛围中得到佛力加持,自净其意,心想事成。</div> 34 + <div style="padding: 1rem;">
39 - </div> 35 + <div style="color: #DD7850;">•&nbsp;五方塔</div>
36 + <div style="color: #47525F; margin-top: 1rem; line-height: 1.75;">禅堂外的草坪,安立着大小不一五座佛塔。信众可绕塔或悬挂风铃祝愿祈福,在肃静庄严的氛围中得到佛力加持,自净其意,心想事成。</div>
37 + </div> -->
38 + <div v-html="page_details.introduction"></div>
39 + </div>
40 + </van-tab>
41 + <van-tab title="故 事">
42 + <!-- <div style="padding: 0 1rem;">
43 + <div style="padding: 1rem;">
44 + <div style="color: #DD7850;">•&nbsp;选官何如选佛</div>
40 </div> 45 </div>
41 - </van-tab>
42 - <van-tab title="故 事">
43 <div style="padding: 0 1rem;"> 46 <div style="padding: 0 1rem;">
44 - <div style="padding: 1rem;"> 47 + <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20230612_201951.png" />
45 - <div style="color: #DD7850;">•&nbsp;选官何如选佛</div>
46 - </div>
47 - <div style="padding: 0 1rem;">
48 - <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20230612_201951.png" />
49 - </div>
50 - <div style="padding: 1rem;">
51 - <p style="color: #47525F; line-height: 1.75;">过去把禅堂叫作选佛场,意思是选择作佛的场所。这个典故与丹霞禅师有关。 <br />他原本是一个秀才,赴京赶考的途中遇到一位禅师,这位禅师跟他讲,选官何如选佛?考官还不如成佛利益更大。世间功名如过眼云烟,即便追求得到也是暂时利益,执著于此就会烦恼重重,甚至不断造业。而学佛修行,考佛就是要成佛,成就生命永恒的福祉。这是永久的利益,尽未来际的利益。每个生命原本具备觉悟的潜质,具有无尽的功德宝藏,取之不尽用之不竭。成佛,可以断除一切迷惑烦恼,可以彻底地开发我们生命的潜质,全然觉醒,这个利益无量无边。丹霞禅师深具慧根,一经点拨,马上出家。</p>
52 - </div>
53 - <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
54 </div> 48 </div>
55 - <div style="padding: 0 1rem;"> 49 + <div style="padding: 1rem;">
56 - <div style="padding: 1rem;"> 50 + <p style="color: #47525F; line-height: 1.75;">过去把禅堂叫作选佛场,意思是选择作佛的场所。这个典故与丹霞禅师有关。 <br />他原本是一个秀才,赴京赶考的途中遇到一位禅师,这位禅师跟他讲,选官何如选佛?考官还不如成佛利益更大。世间功名如过眼云烟,即便追求得到也是暂时利益,执著于此就会烦恼重重,甚至不断造业。而学佛修行,考佛就是要成佛,成就生命永恒的福祉。这是永久的利益,尽未来际的利益。每个生命原本具备觉悟的潜质,具有无尽的功德宝藏,取之不尽用之不竭。成佛,可以断除一切迷惑烦恼,可以彻底地开发我们生命的潜质,全然觉醒,这个利益无量无边。丹霞禅师深具慧根,一经点拨,马上出家。</p>
57 - <div style="color: #DD7850;">•&nbsp;把洞窟搬进讲堂</div> 51 + </div>
58 - </div> 52 + <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
59 - <div style="padding: 0 1rem;"> 53 + </div>
60 - <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20240815_211927.png" /> 54 + <div style="padding: 0 1rem;">
61 - </div> 55 + <div style="padding: 1rem;">
62 - <div style="padding: 1rem;"> 56 + <div style="color: #DD7850;">•&nbsp;把洞窟搬进讲堂</div>
63 - <p style="color: #47525F; line-height: 1.75;">洞窟,是传统的佛教建筑形式,最早在印度盛行,古代僧人喜欢在崇山峻岭的幽僻处开凿洞窟,遁世修行。选佛场集禅堂与讲堂的功能于一体,把洞窟搬进讲堂,既有回归佛教本怀的宁静温暖,又体现出融入泰宁岩穴文化的祥和之气。</p>
64 - </div>
65 - <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
66 </div> 57 </div>
67 - </van-tab>
68 - <van-tab title="体 验" id="tab-3">
69 <div style="padding: 0 1rem;"> 58 <div style="padding: 0 1rem;">
70 - <div style="padding: 1rem;"> 59 + <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20240815_211927.png" />
71 - <div style="color: #DD7850;">•&nbsp;供灯</div> 60 + </div>
72 - <div style="color: #47525F; margin-top: 1rem; line-height: 1.75;">禅堂内自助供灯。</div> 61 + <div style="padding: 1rem;">
73 - </div> 62 + <p style="color: #47525F; line-height: 1.75;">洞窟,是传统的佛教建筑形式,最早在印度盛行,古代僧人喜欢在崇山峻岭的幽僻处开凿洞窟,遁世修行。选佛场集禅堂与讲堂的功能于一体,把洞窟搬进讲堂,既有回归佛教本怀的宁静温暖,又体现出融入泰宁岩穴文化的祥和之气。</p>
74 - <div style="padding: 0 1rem;">
75 - <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20240815_211927.png" />
76 - </div>
77 - <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
78 </div> 63 </div>
79 - <div class="audio-wrapper"> 64 + <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
80 - <div :class="['audio-item', play_audio_index === index ? 'click' : '']" v-for="(item, index) in audioList" :key="index"> 65 + </div> -->
81 - <div>{{ item.text }}</div> 66 + <div class="info-content">
82 - <!-- <div :class="['audio-icon', play_audio_index === index ? 'click' : '']"></div> --> 67 + <div v-html="page_details.story"></div>
83 - <van-icon @click="stopAudio(item, index)" v-if="item.play" size="2rem" name="stop-circle-o" color="#DD7850" /> 68 + </div>
84 - <van-icon v-else @click="playAudio(item, index)" size="2rem" name="https://cdn.ipadbiz.cn/bieyuan/map/icon/audio_icon.png" /> 69 + </van-tab>
85 - </div> 70 + <van-tab title="体 验" id="tab-3">
71 + <!-- <div style="padding: 0 1rem;">
72 + <div style="padding: 1rem;">
73 + <div style="color: #DD7850;">•&nbsp;供灯</div>
74 + <div style="color: #47525F; margin-top: 1rem; line-height: 1.75;">禅堂内自助供灯。</div>
86 </div> 75 </div>
87 <div style="padding: 0 1rem;"> 76 <div style="padding: 0 1rem;">
88 - <img src="https://cdn.ipadbiz.cn/bieyuan/map/xcx.png" style="width: 100%;"> 77 + <van-image width="100%" height="11rem" fit="cover" src="https://cdn.ipadbiz.cn/bieyuan/map/Mix_20240815_211927.png" />
89 </div> 78 </div>
90 - </van-tab> 79 + <div class="van-hairline--bottom" style="margin: 0 1rem;"></div>
91 - </van-tabs> 80 + </div> -->
92 - </div> 81 + <div class="info-content">
93 - </div> 82 + <div v-html="page_details.experience"></div>
94 - <div style="display: flex; justify-content: center; margin: 3rem;"> 83 + </div>
95 - <van-image 84 + <div class="audio-wrapper">
96 - width="3rem" 85 + <div :class="['audio-item', play_audio_index === index ? 'click' : '']" v-for="(item, index) in audioList" :key="index">
97 - height="3rem" 86 + <div>{{ item.text }}</div>
98 - fit="contain" 87 + <!-- <div :class="['audio-icon', play_audio_index === index ? 'click' : '']"></div> -->
99 - src="https://cdn.ipadbiz.cn/bieyuan/map/icon/scan_logo.png" 88 + <van-icon @click="stopAudio(item, index)" v-if="item.play" size="2rem" name="stop-circle-o" color="#DD7850" />
100 - /> 89 + <van-icon v-else @click="playAudio(item, index)" size="2rem" name="https://cdn.ipadbiz.cn/bieyuan/map/icon/audio_icon.png" />
90 + </div>
91 + </div>
92 + <!-- <div style="padding: 0 1rem;">
93 + <img src="https://cdn.ipadbiz.cn/bieyuan/map/xcx.png" style="width: 100%;">
94 + </div> -->
95 + </van-tab>
96 + </van-tabs>
101 </div> 97 </div>
102 </div> 98 </div>
103 - </div> 99 + <div class="info-logo">
100 + <van-image width="3rem" height="3rem" fit="contain" src="https://cdn.ipadbiz.cn/bieyuan/map/icon/scan_logo.png" />
101 + </div>
102 + </div>
104 </template> 103 </template>
105 104
106 <script setup> 105 <script setup>
...@@ -112,6 +111,8 @@ import { mainStore } from '@/store'; ...@@ -112,6 +111,8 @@ import { mainStore } from '@/store';
112 111
113 import $ from 'jquery'; 112 import $ from 'jquery';
114 113
114 +import { mapAPI } from '@/api/map.js'
115 +
115 const store = mainStore(); 116 const store = mainStore();
116 const { audio_status, audio_entity } = storeToRefs(store); 117 const { audio_status, audio_entity } = storeToRefs(store);
117 118
...@@ -123,6 +124,22 @@ const themeVars = ref({ ...@@ -123,6 +124,22 @@ const themeVars = ref({
123 swipeIndicatorMargin: '1.5rem' 124 swipeIndicatorMargin: '1.5rem'
124 }); 125 });
125 126
127 +const props = defineProps({
128 + info: Object,
129 +});
130 +
131 +const page_details = ref({});
132 +
133 +watch(
134 + () => props.info,
135 + (v) => {
136 + // TODO:获取标记点详情进行后续处理
137 + if (v.details.length) {
138 + page_details.value = { ...v.details[0], position: v.position };
139 + }
140 + }
141 +)
142 +
126 const images = ref([ 143 const images = ref([
127 'https://cdn.ipadbiz.cn/bieyuan/map/swiper_img.png', 144 'https://cdn.ipadbiz.cn/bieyuan/map/swiper_img.png',
128 'https://cdn.ipadbiz.cn/bieyuan/map/Mix_20230612_201951.png', 145 'https://cdn.ipadbiz.cn/bieyuan/map/Mix_20230612_201951.png',
...@@ -178,8 +195,19 @@ const stopAudio = (item, index) => { ...@@ -178,8 +195,19 @@ const stopAudio = (item, index) => {
178 195
179 const audio = ref(new Audio()); 196 const audio = ref(new Audio());
180 197
181 -onMounted(() => { 198 +onMounted(async () => {
182 -}) 199 + // 通过ID查询到标记点详情
200 + if (!props.info) {
201 + let id = $route.query.id;
202 + const { data } = await mapAPI({ i: id });
203 + const raw_list = data.list[0].list; // 获取标记点列表
204 + const marker_id = $route.query.marker_id;
205 + const current_marker = raw_list.filter(item => item.id == marker_id)[0];
206 + //
207 + page_details.value = { ...current_marker.details[0], position: current_marker.position };
208 + console.log("🚀 ~ file: info.vue:201 ~ onMounted ~ page_details.value:", page_details.value);
209 + }
210 +});
183 211
184 onUnmounted(() => { // 离开页面时关闭音频播放 212 onUnmounted(() => { // 离开页面时关闭音频播放
185 audio.value.pause(); 213 audio.value.pause();
...@@ -244,17 +272,20 @@ defineExpose({ ...@@ -244,17 +272,20 @@ defineExpose({
244 height: 100vh; 272 height: 100vh;
245 overflow: scroll; 273 overflow: scroll;
246 position: relative; 274 position: relative;
247 - .header-z { 275 + .info-header-wrapper {
248 - position: absolute; 276 + position: relative;
249 - bottom: 0; 277 + .header-z {
250 - left: 0; 278 + position: absolute;
251 - right: 0; 279 + bottom: 0;
252 - height: 1rem; 280 + left: 0;
253 - box-shadow: rgba(241, 242, 248, 0.8) 0px -3px 20px 12px; 281 + right: 0;
254 - background-color: #f7f7f7; 282 + height: 1rem;
255 - margin: 0 1rem; 283 + box-shadow: rgba(241, 242, 248, 0.8) 0px -3px 20px 12px;
256 - border-top-left-radius: 0.5rem; 284 + background-color: #f7f7f7;
257 - border-top-right-radius: 0.5rem; 285 + margin: 0 1rem;
286 + border-top-left-radius: 0.5rem;
287 + border-top-right-radius: 0.5rem;
288 + }
258 } 289 }
259 .info-content-wrapper { 290 .info-content-wrapper {
260 box-shadow: 0px -3px 6px 0 rgba(241, 242, 248, 0.8); 291 box-shadow: 0px -3px 6px 0 rgba(241, 242, 248, 0.8);
...@@ -290,6 +321,14 @@ defineExpose({ ...@@ -290,6 +321,14 @@ defineExpose({
290 } 321 }
291 .info-content { 322 .info-content {
292 padding: 1rem; 323 padding: 1rem;
324 + p {
325 + line-height: 1.75;
326 + padding: 0 0.85rem;
327 + text-align: justify;
328 + img {
329 + width: 100%;
330 + }
331 + }
293 } 332 }
294 .audio-wrapper { 333 .audio-wrapper {
295 padding: 1rem; 334 padding: 1rem;
...@@ -330,5 +369,10 @@ defineExpose({ ...@@ -330,5 +369,10 @@ defineExpose({
330 } 369 }
331 } 370 }
332 } 371 }
372 + .info-logo {
373 + display: flex;
374 + justify-content: center;
375 + margin: 3rem;
376 + }
333 } 377 }
334 </style> 378 </style>
......
1 <!-- 1 <!--
2 * @Date: 2023-05-19 14:54:27 2 * @Date: 2023-05-19 14:54:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-09-21 12:03:00 4 + * @LastEditTime: 2024-09-22 13:43:45
5 * @FilePath: /map-demo/src/views/bieyuan/map.vue 5 * @FilePath: /map-demo/src/views/bieyuan/map.vue
6 * @Description: 公众地图主体页面 6 * @Description: 公众地图主体页面
7 --> 7 -->
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
42 <button @click="show = false">关闭</button> 42 <button @click="show = false">关闭</button>
43 </div> 43 </div>
44 </template> --> 44 </template> -->
45 - <page-info ref="pageInfo" @close-float="onCloseFloat" @route="onRoute"></page-info> 45 + <page-info ref="pageInfo" :info="itemInfo" @close-float="onCloseFloat" @route="onRoute"></page-info>
46 <!-- <div v-if="showClose" @click="closeFloatPanel" class="close-float-panel"> 46 <!-- <div v-if="showClose" @click="closeFloatPanel" class="close-float-panel">
47 <van-icon name="arrow-left" color="#FFF" size="1.5rem" /> 47 <van-icon name="arrow-left" color="#FFF" size="1.5rem" />
48 </div> --> 48 </div> -->
...@@ -72,6 +72,12 @@ ...@@ -72,6 +72,12 @@
72 </div> 72 </div>
73 </div> 73 </div>
74 </div> 74 </div>
75 +
76 + <van-toast v-model:show="show_toast" style="padding: 0">
77 + <template #message>
78 + <p style="padding: 0.5rem 1rem;">{{ toast_text }}</p>
79 + </template>
80 + </van-toast>
75 </div> 81 </div>
76 </template> 82 </template>
77 83
...@@ -217,6 +223,8 @@ export default { ...@@ -217,6 +223,8 @@ export default {
217 route_safe_marker: [], 223 route_safe_marker: [],
218 show_walk_route: true, 224 show_walk_route: true,
219 open_current_location: true, 225 open_current_location: true,
226 + show_toast: false,
227 + toast_text: '',
220 } 228 }
221 }, 229 },
222 async mounted() { 230 async mounted() {
...@@ -358,6 +366,14 @@ export default { ...@@ -358,6 +366,14 @@ export default {
358 // console.warn(e); 366 // console.warn(e);
359 this.itemInfo = entity_info[i]; 367 this.itemInfo = entity_info[i];
360 368
369 + // 详情为空提示
370 + if (!this.itemInfo.details.length) {
371 + this.show_toast = true;
372 + this.toast_text = '该景点暂无详情'
373 + return;
374 + }
375 +
376 +
361 // 打开浮动面板 377 // 打开浮动面板
362 this.info_height = (0.45 * window.innerHeight); 378 this.info_height = (0.45 * window.innerHeight);
363 // 浮动面板样式 379 // 浮动面板样式
...@@ -368,8 +384,8 @@ export default { ...@@ -368,8 +384,8 @@ export default {
368 this.map.setZoomAndCenter(this.zoom, this.itemInfo.position); 384 this.map.setZoomAndCenter(this.zoom, this.itemInfo.position);
369 }) 385 })
370 } 386 }
387 + // TODO: ID问题看看实际名称叫什么
371 // 导航路径 388 // 导航路径
372 - console.warn(entity_info[i]);
373 let marker_id = this.$route.query.marker_id; 389 let marker_id = this.$route.query.marker_id;
374 if (marker_id) { 390 if (marker_id) {
375 this.$nextTick(() => { 391 this.$nextTick(() => {
...@@ -615,7 +631,7 @@ export default { ...@@ -615,7 +631,7 @@ export default {
615 // 还原样式 631 // 还原样式
616 this.resetMarkStyle();*/ 632 this.resetMarkStyle();*/
617 }, 633 },
618 - scanQrcode() { 634 + scanQrcode() { // 扫码跳转详情页
619 wx.scanQRCode({ 635 wx.scanQRCode({
620 needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, 636 needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
621 scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有 637 scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码,默认二者都有
...@@ -648,6 +664,7 @@ export default { ...@@ -648,6 +664,7 @@ export default {
648 path: '/bieyuan/info', 664 path: '/bieyuan/info',
649 query: { 665 query: {
650 id: this.$route.query.id, 666 id: this.$route.query.id,
667 + marker_id: this.itemInfo.id
651 } 668 }
652 }) 669 })
653 } else { 670 } else {
...@@ -777,6 +794,8 @@ export default { ...@@ -777,6 +794,8 @@ export default {
777 console.warn(marker_id); 794 console.warn(marker_id);
778 // 模拟新增路线 795 // 模拟新增路线
779 this.addSafeRoute(this.data_path_list[0]); 796 this.addSafeRoute(this.data_path_list[0]);
797 + // 定位到当前位置中心
798 + this.map.setZoomAndCenter(this.zoom, this.data_center);
780 }, 799 },
781 handleLocation(status) { // 打开/关闭 当前定位 800 handleLocation(status) { // 打开/关闭 当前定位
782 if (status) { 801 if (status) {
......