hookehuyr

feat: 添加音频列表查询功能以标记点

在页面加载时,查询音频列表并更新标记点显示状态,以支持音频功能的展示
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: 2025-03-22 21:24:53 4 + * @LastEditTime: 2025-03-22 21:33:41
5 * @FilePath: /map-demo/src/views/by/info.vue 5 * @FilePath: /map-demo/src/views/by/info.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -95,7 +95,7 @@ import { mainStore, useTitle } from '@/utils/generatePackage' ...@@ -95,7 +95,7 @@ import { mainStore, useTitle } from '@/utils/generatePackage'
95 import wx from 'weixin-js-sdk'; 95 import wx from 'weixin-js-sdk';
96 import $ from 'jquery'; 96 import $ from 'jquery';
97 97
98 -import { mapAPI } from '@/api/map.js' 98 +import { mapAPI, mapAudioAPI } from '@/api/map.js'
99 99
100 const store = mainStore(); 100 const store = mainStore();
101 const { audio_status, audio_entity, audio_list_status, audio_list_entity } = storeToRefs(store); 101 const { audio_status, audio_entity, audio_list_status, audio_list_entity } = storeToRefs(store);
...@@ -203,6 +203,11 @@ onMounted(async () => { ...@@ -203,6 +203,11 @@ onMounted(async () => {
203 page_details.value.introduction = page_details.value.introduction?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>') 203 page_details.value.introduction = page_details.value.introduction?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
204 page_details.value.story = page_details.value.story?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>') 204 page_details.value.story = page_details.value.story?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
205 page_details.value.experience = page_details.value.experience?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>') 205 page_details.value.experience = page_details.value.experience?.replace(/\<hr\>/g, '<div class="van-hairline--bottom" style="margin: 1rem 0;"></div>')
206 + // 查询是否有音频列表,打标记点是否有音频
207 + const getAudioList = await mapAudioAPI({ mid: $route.query.id, bid: marker_id });
208 + if (getAudioList.data && getAudioList.data.length) {
209 + page_details.value.show_audio = true;
210 + }
206 } 211 }
207 // 介绍栏目,图片点击事件 212 // 介绍栏目,图片点击事件
208 var imgs = $('#introduction').find('img'); 213 var imgs = $('#introduction').find('img');
......