|
@@ -0,0 +1,204 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="relic-detail-for-hotspot">
|
|
|
|
+ <img
|
|
|
|
+ class="relic-deco"
|
|
|
|
+ src="@/assets/images/relic-detail-deco.png"
|
|
|
|
+ alt=""
|
|
|
|
+ draggable="false"
|
|
|
|
+ >
|
|
|
|
+ <button
|
|
|
|
+ class="return"
|
|
|
|
+ @click="emit('close')"
|
|
|
|
+ />
|
|
|
|
+ <h1>{{ props.relicInfo.hotspotTitle }}</h1>
|
|
|
|
+ <!-- <div class="age">
|
|
|
|
+ 年份 {{ props.relicInfo['年份'] }}
|
|
|
|
+ </div> -->
|
|
|
|
+ <div
|
|
|
|
+ class="detail"
|
|
|
|
+ v-html="props.relicInfo.imageTextInfo.text"
|
|
|
|
+ />
|
|
|
|
+ <div
|
|
|
|
+ class="swiper-root"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-viewer
|
|
|
|
+ class="swiper-wrapper"
|
|
|
|
+ >
|
|
|
|
+ <img
|
|
|
|
+ v-for="(item, index) in relicImgUrlList"
|
|
|
|
+ :key="index"
|
|
|
|
+ class="swiper-slide"
|
|
|
|
+ :src="item"
|
|
|
|
+ alt=""
|
|
|
|
+ draggable="false"
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <!-- <div class="swiper-button-prev" />
|
|
|
|
+ <div class="swiper-button-next" /> -->
|
|
|
|
+ <div class="swiper-pagination" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup>
|
|
|
|
+import { ref, computed, watch, onMounted, nextTick } from "vue"
|
|
|
|
+import { useRoute, useRouter } from "vue-router"
|
|
|
|
+import { useStore } from "vuex"
|
|
|
|
+import Swiper from 'swiper/bundle'
|
|
|
|
+import 'swiper/css/bundle'
|
|
|
|
+
|
|
|
|
+const route = useRoute()
|
|
|
|
+const router = useRouter()
|
|
|
|
+const store = useStore()
|
|
|
|
+
|
|
|
|
+const emit = defineEmits(['close'])
|
|
|
|
+
|
|
|
|
+const props = defineProps(['relicInfo'])
|
|
|
|
+
|
|
|
|
+console.log('relicInfo: ', props.relicInfo)
|
|
|
|
+
|
|
|
|
+const relicImgUrlList = computed(() => {
|
|
|
|
+ return props.relicInfo.imageTextInfo.imageList.map((item) => {
|
|
|
|
+ return item.ossPath
|
|
|
|
+ })
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * swiper 相关
|
|
|
|
+ */
|
|
|
|
+let swiper = null
|
|
|
|
+// const activeSwiperItemIndex = ref(0)
|
|
|
|
+function initSwiper() {
|
|
|
|
+ swiper = new Swiper('.swiper-root', {
|
|
|
|
+ pagination: {
|
|
|
|
+ el: '.swiper-pagination',
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // Navigation arrows
|
|
|
|
+ navigation: {
|
|
|
|
+ nextEl: '.swiper-button-next',
|
|
|
|
+ prevEl: '.swiper-button-prev',
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ on: {
|
|
|
|
+ // afterInit: function (e) {
|
|
|
|
+ // activeSwiperItemIndex.value = e.activeIndex
|
|
|
|
+ // },
|
|
|
|
+ // slideChange: function(e) {
|
|
|
|
+ // activeSwiperItemIndex.value = e.activeIndex
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+onMounted(() => {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ initSwiper()
|
|
|
|
+ })
|
|
|
|
+})
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+@page-height-design-px: 970;
|
|
|
|
+@page-width-design-px: 1920;
|
|
|
|
+.relic-detail-for-hotspot{
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ background-image: url(@/assets/images/relic-detail-bg.jpg);
|
|
|
|
+ background-size: cover;
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
+ background-position: center center;
|
|
|
|
+ z-index: 10;
|
|
|
|
+ >img.relic-deco{
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: calc(597 / @page-height-design-px * 100vh);
|
|
|
|
+ left: calc(544 / @page-width-design-px * 100vw);
|
|
|
|
+ width: calc(1172 / @page-width-design-px * 100vw);
|
|
|
|
+ height: calc(325 / @page-height-design-px * 100vh);
|
|
|
|
+ object-fit: contain;
|
|
|
|
+ }
|
|
|
|
+ >button.return{
|
|
|
|
+ position: absolute;
|
|
|
|
+ width: 58px;
|
|
|
|
+ height: 58px;
|
|
|
|
+ left: 42px;
|
|
|
|
+ top: 68px;
|
|
|
|
+ background-image: url(@/assets/images/btn-return.png);
|
|
|
|
+ background-size: contain;
|
|
|
|
+ background-repeat: no-repeat;
|
|
|
|
+ background-position: center center;
|
|
|
|
+ }
|
|
|
|
+ >h1{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: calc(182 / @page-width-design-px * 100vw);
|
|
|
|
+ top: calc(115 / @page-height-design-px * 100vh);
|
|
|
|
+ writing-mode: vertical-lr;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ font-family: Source Han Serif CN, Source Han Serif CN;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ color: #43310E;
|
|
|
|
+ line-height: 28px;
|
|
|
|
+ letter-spacing: 2px;
|
|
|
|
+ }
|
|
|
|
+ >.age{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: calc(275 / @page-width-design-px * 100vw);
|
|
|
|
+ top: calc(180 / @page-height-design-px * 100vh);
|
|
|
|
+ writing-mode: vertical-lr;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ font-family: Source Han Sans CN, Source Han Sans CN;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ color: #281D0C;
|
|
|
|
+ line-height: 28px;
|
|
|
|
+ }
|
|
|
|
+ >.detail{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: calc(383 / @page-width-design-px * 100vw);
|
|
|
|
+ top: calc(184 / @page-height-design-px * 100vh);
|
|
|
|
+ width: calc(528 / @page-width-design-px * 100vw);
|
|
|
|
+ height: calc(638 / @page-height-design-px * 100vh);
|
|
|
|
+ overflow: auto;
|
|
|
|
+ padding-right: calc(44 / @page-width-design-px * 100vw);
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ font-family: Source Han Sans SC, Source Han Sans SC;
|
|
|
|
+ font-weight: 300;
|
|
|
|
+ color: #000000;
|
|
|
|
+ line-height: 23px;
|
|
|
|
+ letter-spacing: 4px;
|
|
|
|
+ :deep(p){
|
|
|
|
+ margin-bottom: 1em;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ >.swiper-root{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: calc(1385 / @page-width-design-px * 100vw);
|
|
|
|
+ top: calc(99 / @page-height-design-px * 100vh);
|
|
|
|
+ transform: translate(-50%, 0);
|
|
|
|
+ width: calc(767 / @page-width-design-px * 100vw);
|
|
|
|
+ height: calc(767 / @page-height-design-px * 100vh);
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ >.swiper-wrapper{
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ >img.swiper-slide {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ object-fit: contain;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ >:deep(.swiper-pagination){
|
|
|
|
+ >span{
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 5px;
|
|
|
|
+ border-radius: 0;
|
|
|
|
+ // background-color: #666;
|
|
|
|
+ }
|
|
|
|
+ >span.swiper-pagination-bullet-active{
|
|
|
|
+ // background-color: #f4d085;
|
|
|
|
+ opacity: 1;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|