hookehuyr

fix: 修复标签页标题显示问题并添加模拟文本

将硬编码的标签页标题改为动态绑定,并添加模拟文本字段
修复故事标签页的标题判断逻辑
<!--
* @Date: 2024-09-15 22:08:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-17 18:52:39
* @LastEditTime: 2025-09-17 19:50:14
* @FilePath: /map-demo/src/views/checkin/info.vue
* @Description: 文件描述
-->
......@@ -41,17 +41,17 @@
<div id="tab-wrapper" style="margin-top: 0.5rem;">
<van-config-provider :theme-vars="themeVars">
<van-tabs ref="tabsRef" v-model:active="active" @click-tab="clickTab" color="#DD7850" title-active-color="#DD7850" title-inactive-color="#DD7850" :shrink="show_shrink" sticky animated>
<van-tab title="敬老月优惠" v-if="page_details.introduction">
<van-tab :title="page_details.introduction_text" v-if="page_details.introduction">
<div class="info-content">
<div id="introduction" v-html="page_details.introduction" style="padding: 0 1rem;"></div>
</div>
</van-tab>
<van-tab title="百联繁花里" v-if="page_details.story">
<van-tab :title="page_details.story_text" v-if="page_details.story">
<div class="info-content">
<div id="story" v-html="page_details.story" style="padding: 0 1rem;"></div>
</div>
</van-tab>
<van-tab title="体 验" v-if="page_details.experience">
<van-tab :title="page_details.experience_text" v-if="page_details.experience">
<div class="info-content">
<div id="experience" v-html="page_details.experience" style="padding: 0 1rem;"></div>
</div>
......@@ -127,6 +127,10 @@ watch(
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 };
// TODO: 模拟假的tab文字
page_details.value.introduction_text = '敬老月优惠';
page_details.value.story_text = '百联繁花里';
page_details.value.experience_text = '体 验';
// 获取浏览器可视范围的高度
$('.info-page').height(props.height + 'px');
// 检查打卡状态
......@@ -216,6 +220,10 @@ onMounted(async () => {
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>')
// TODO: 模拟假的tab文字
page_details.value.introduction_text = '敬老月优惠';
page_details.value.story_text = '百联繁花里';
page_details.value.experience_text = '体 验';
// 定位
if (current_lng && current_lat) {
page_details.value.current_lng = current_lng;
......@@ -390,7 +398,7 @@ const clickTab = (evt) => { // 标签切换
if (evt.title === '敬老月优惠') { // 介绍
var imgs = $('#introduction').find('img');
}
if (evt.title === '故 事') { // 故事
if (evt.title === '百联繁花里') { // 故事
var imgs = $('#story').find('img');
}
if (evt.title === '体 验') { // 体验
......