|
@@ -1,18 +1,26 @@
|
|
|
<template>
|
|
|
<van-tabs v-if="model" ref="tabsRef" v-model:active="active" scrollspy sticky class="monument">
|
|
|
<van-tab title="前言" :name="0">
|
|
|
- <p class="monument__title">前言</p>
|
|
|
<div class="monument__preface">
|
|
|
- <p>{{ model.preface }}</p>
|
|
|
- <img src="@/assets/images/tab_preface@2x.png" />
|
|
|
+ <p class="monument__preface__title">前言</p>
|
|
|
+ <p class="monument__preface__inner">{{ model.preface }}</p>
|
|
|
+ <img draggable="false" src="@/assets/images/diwen_beita@2x.png" />
|
|
|
</div>
|
|
|
</van-tab>
|
|
|
+
|
|
|
<van-tab v-for="item in model.list" :title="item.label" :key="item.id" :name="item.id">
|
|
|
- <p class="monument__title">{{ item.label }}</p>
|
|
|
+ <div class="monument__title gap">
|
|
|
+ <div
|
|
|
+ class="monument__title__bg"
|
|
|
+ :style="{ background: `url(${item.labelBgPath}) no-repeat center / contain` }"
|
|
|
+ />
|
|
|
+ <img class="monument__title__icon-lf" :src="item.labelIconPath + '@2x.png'" />
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
+ <img class="monument__title__icon-rg" :src="`${item.labelIconPath}_r@2x.png`" />
|
|
|
+ </div>
|
|
|
|
|
|
<div v-if="item.info" class="monument__info">
|
|
|
- <p>{{ item.info }}</p>
|
|
|
- <img src="@/assets/images/tab_part@2x.png" />
|
|
|
+ <p :style="{ color: item.infoColor }">{{ item.info }}</p>
|
|
|
</div>
|
|
|
|
|
|
<div class="monument-cards">
|
|
@@ -27,6 +35,15 @@
|
|
|
<p class="monument-card__subtitle limit-line">{{ subItem.subtitle }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div v-if="item.bgColor" class="monument__bg" :style="{ background: item.bgColor }" />
|
|
|
+ </van-tab>
|
|
|
+
|
|
|
+ <van-tab title="结语">
|
|
|
+ <div class="monument__epilogue">
|
|
|
+ <p class="monument__epilogue__title">结语</p>
|
|
|
+ <p class="monument__epilogue__inner">{{ model.epilogue }}</p>
|
|
|
+ </div>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
|
|
@@ -42,7 +59,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted, computed } from 'vue'
|
|
|
+import { ref, onMounted, onBeforeMount, computed } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import type { TabsInstance } from 'vant'
|
|
|
import useStore from '@/stores'
|
|
@@ -55,6 +72,10 @@ const { monument } = useStore()
|
|
|
const tabsRef = ref<TabsInstance>()
|
|
|
const model = computed(() => monument.data.find((item) => item.id === Number(route.params.id)))
|
|
|
|
|
|
+onBeforeMount(() => {
|
|
|
+ document.title = '运河沿线碑拓展'
|
|
|
+})
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
setTimeout(() => {
|
|
|
tabsRef.value?.scrollTo(Number(route.params.secondId))
|