|
@@ -0,0 +1,430 @@
|
|
|
+<template>
|
|
|
+ <div class="hotspot" v-if="!isMobile">
|
|
|
+ <img
|
|
|
+ class="vhotspot"
|
|
|
+ :src="require(`@/assets/images/project/kuangti/hotspot_${theme}.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="brightness"></div>
|
|
|
+ <img
|
|
|
+ @click="$emit('close')"
|
|
|
+ class="close"
|
|
|
+ :src="require('@/assets/images/project/icon/close.png')"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+
|
|
|
+ <div class="vhotspotcon">
|
|
|
+ <div class="vtitle" v-html="hotspot.title"></div>
|
|
|
+ <div class="hotspotcon" :class="{ fullcon: !hotspot.content }">
|
|
|
+ <div class="img-con">
|
|
|
+ <img
|
|
|
+ class="aa"
|
|
|
+ v-if="hotspot.model.length > 1"
|
|
|
+ :src="require('@/assets/images/project/icon/hotspot_l.png')"
|
|
|
+ alt=""
|
|
|
+ @click="handlePage('prev')"
|
|
|
+ />
|
|
|
+ <div class="imgmain" :class="{ bigImg: !hotspot.content }">
|
|
|
+ <iframe :key="active" allowfullscreen frameborder="0" :src="hotspot.model[active]"></iframe>
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ class="aa"
|
|
|
+ v-if="hotspot.model.length > 1"
|
|
|
+ :src="require('@/assets/images/project/icon/hotspot_r.png')"
|
|
|
+ alt=""
|
|
|
+ @click="handlePage('next')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="pagna" v-if="hotspot.model.length > 1">
|
|
|
+ <span>{{ active + 1 }}</span>
|
|
|
+ /
|
|
|
+ <span>{{ hotspot.model.length }}</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="desc"
|
|
|
+ v-html="handleContent(hotspot.contents[active])"
|
|
|
+ ></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-else class="mbhotspot">
|
|
|
+ <img
|
|
|
+ class="vhotspot"
|
|
|
+ :src="require(`@/assets/images/mobile/kuangti/hotspot_${theme}.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="brightness"></div>
|
|
|
+ <img
|
|
|
+ @click="$emit('close')"
|
|
|
+ class="close"
|
|
|
+ :src="require('@/assets/images/project/icon/close.png')"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <div class="title" v-html="hotspot.title"></div>
|
|
|
+
|
|
|
+ <div class="mbhcon" :class="{ fullcon: !hotspot.content }">
|
|
|
+ <div class="img-con">
|
|
|
+ <img
|
|
|
+ class="aa"
|
|
|
+ v-if="hotspot.model.length > 1"
|
|
|
+ :src="require('@/assets/images/project/icon/hotspot_l.png')"
|
|
|
+ alt=""
|
|
|
+ @click="handlePage('prev')"
|
|
|
+ />
|
|
|
+ <div class="imgmain" :class="{ bigImg: !hotspot.content }">
|
|
|
+ <iframe :key="active" allowfullscreen frameborder="0" :src="hotspot.model[active]"></iframe>
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ class="aa"
|
|
|
+ v-if="hotspot.model.length > 1"
|
|
|
+ :src="require('@/assets/images/project/icon/hotspot_r.png')"
|
|
|
+ alt=""
|
|
|
+ @click="handlePage('next')"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-if="hotspot.content" class="desc">
|
|
|
+ <div v-html="handleContent(hotspot.contents[active], 14)"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { directive } from "vue-awesome-swiper";
|
|
|
+// import style (<= Swiper 5.x)
|
|
|
+import "swiper/css/swiper.css";
|
|
|
+import Panzoom from "@panzoom/panzoom";
|
|
|
+
|
|
|
+export default {
|
|
|
+ directives: {
|
|
|
+ swiper: directive,
|
|
|
+ },
|
|
|
+ props: ["hotspot", "type"],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ panzoom: "",
|
|
|
+ active: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handlePage(type) {
|
|
|
+ if (type === "next") {
|
|
|
+ console.log(this.hotspot.model.length);
|
|
|
+ if (this.active >= this.hotspot.model.length - 1) {
|
|
|
+ this.active = 0;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.active += 1;
|
|
|
+ } else {
|
|
|
+ if (this.active == 0) {
|
|
|
+ this.active = this.hotspot.model.length - 1;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.active -= 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ swiperOption() {
|
|
|
+ let that = this;
|
|
|
+ return {
|
|
|
+ slidesPerView: "auto",
|
|
|
+ autoplay: false,
|
|
|
+ centeredSlides: true,
|
|
|
+ watchSlidesProgress: true,
|
|
|
+ loop: this.hotspot.model.length > 1,
|
|
|
+ pagination: {
|
|
|
+ el: ".swiper-pagination",
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ slideChangeTransitionEnd: function() {
|
|
|
+ that.active = this.realIndex;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ const elem = document.getElementById("map");
|
|
|
+ this.panzoom = Panzoom(elem, {
|
|
|
+ maxScale: 10,
|
|
|
+ startScale: !this.hotspot.content ? 0.8 : this.isMobile ? 0.6 : 1,
|
|
|
+ startY: (!this.hotspot.content&&this.isMobile)?100:0
|
|
|
+ });
|
|
|
+ this.panzoom.pan(0,50)
|
|
|
+ elem.addEventListener("wheel", this.panzoom.zoomWithWheel);
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.noshow {
|
|
|
+ opacity: 0 !important;
|
|
|
+ pointer-events: none !important;
|
|
|
+}
|
|
|
+@w: 82%;
|
|
|
+@fixw: 8px;
|
|
|
+.hotspot {
|
|
|
+ width: @w;
|
|
|
+ position: relative;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ .vhotspot {
|
|
|
+ width: 100%;
|
|
|
+ position: relative;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .brightness {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 101%;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ z-index: -1;
|
|
|
+ clip-path: polygon(1% 11%, 10% 2%, 99% 2%, 99% 89%, 91% 98%, 1% 98%);
|
|
|
+ }
|
|
|
+ .close {
|
|
|
+ position: absolute;
|
|
|
+ top: 40px;
|
|
|
+ right: 30px;
|
|
|
+ width: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 1000;
|
|
|
+ }
|
|
|
+
|
|
|
+ .vhotspotcon {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ left: 50%;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ text-align: center;
|
|
|
+ .vtitle {
|
|
|
+ position: absolute;
|
|
|
+ top: 24px;
|
|
|
+ left: 130px;
|
|
|
+ z-index: 99;
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .hotspotcon {
|
|
|
+ width: 90%;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ position: absolute;
|
|
|
+ .img-con {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ position: relative;
|
|
|
+ .imgmain {
|
|
|
+ width: 90%;
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+ position: relative;
|
|
|
+ margin: 0 auto;
|
|
|
+ >iframe {
|
|
|
+ width: 100%;
|
|
|
+ cursor: pointer;
|
|
|
+ height: 60vh;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @h: 100%;
|
|
|
+ .bigImg {
|
|
|
+ max-height: @h;
|
|
|
+ margin: 0;
|
|
|
+ > img {
|
|
|
+ max-height: @h;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .aa {
|
|
|
+ width: 30px;
|
|
|
+ height: auto;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .pagna {
|
|
|
+ text-align: center;
|
|
|
+ z-index: 999;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-top: 10px;
|
|
|
+ color: rgba(255, 255, 255, 0.8);
|
|
|
+ }
|
|
|
+ .desc {
|
|
|
+ width: 90%;
|
|
|
+ font-size: 20px;
|
|
|
+ text-align: justify;
|
|
|
+ line-height: 1.8;
|
|
|
+ max-height: 120px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ padding-right: 14px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .fullcon {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ clip-path: polygon(
|
|
|
+ 1% 12%,
|
|
|
+ 3.8% 8%,
|
|
|
+ 42% 8%,
|
|
|
+ 45.2% 2.7%,
|
|
|
+ 99% 2.7%,
|
|
|
+ 99% 89%,
|
|
|
+ 92% 98%,
|
|
|
+ 1% 98%
|
|
|
+ );
|
|
|
+ .img-con {
|
|
|
+ height: 100%;
|
|
|
+ .imgmain {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.mbhotspot {
|
|
|
+ width: 96%;
|
|
|
+ margin: 60px auto 0;
|
|
|
+ position: relative;
|
|
|
+ .vhotspot {
|
|
|
+ width: 100%;
|
|
|
+ position: relative;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .brightness {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ z-index: -1;
|
|
|
+ clip-path: polygon(1% 11%, 10% 2%, 99% 2%, 99% 89%, 92% 98%, 1% 98%);
|
|
|
+ }
|
|
|
+ .close {
|
|
|
+ position: absolute;
|
|
|
+ top: 26px;
|
|
|
+ right: 16px;
|
|
|
+ width: 14px;
|
|
|
+ z-index: 1000;
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ position: absolute;
|
|
|
+ top: 14px;
|
|
|
+ left: 40px;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 16px;
|
|
|
+ margin: 0px auto;
|
|
|
+ width: 90vw;
|
|
|
+ }
|
|
|
+ .mbhcon {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ width: 100%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ clip-path: polygon(
|
|
|
+ 1% 12%,
|
|
|
+ 3.8% 7.5%,
|
|
|
+ 86% 7.5%,
|
|
|
+ 90% 2.7%,
|
|
|
+ 99% 2.7%,
|
|
|
+ 99% 89%,
|
|
|
+ 92% 97%,
|
|
|
+ 1% 97%
|
|
|
+ );
|
|
|
+ .img-con {
|
|
|
+ display: flex;
|
|
|
+ height: 70%;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ .imgmain {
|
|
|
+ width: 100%;
|
|
|
+ overflow-x: hidden;
|
|
|
+ overflow-y: auto;
|
|
|
+ position: relative;
|
|
|
+ margin: 0 auto;
|
|
|
+ iframe {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @h: 100%;
|
|
|
+ .bigImg {
|
|
|
+ max-height: @h;
|
|
|
+ margin: 0;
|
|
|
+ > img {
|
|
|
+ max-height: @h;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @pos: 14px;
|
|
|
+ .aa {
|
|
|
+ position: absolute;
|
|
|
+ width: 10px;
|
|
|
+ height: auto;
|
|
|
+ cursor: pointer;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ left: @pos;
|
|
|
+ &:last-of-type {
|
|
|
+ right: @pos;
|
|
|
+ left: unset;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .desc {
|
|
|
+ text-align: justify;
|
|
|
+ width: 100%;
|
|
|
+ height: 22%;
|
|
|
+ padding: 0 14px;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ p {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ div {
|
|
|
+ font-size: 14px;
|
|
|
+ margin-top: 10px;
|
|
|
+ line-height: 1.5;
|
|
|
+ max-height: 100%;
|
|
|
+ padding-right: 4px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .fullcon {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ clip-path: polygon(
|
|
|
+ 1% 12%,
|
|
|
+ 3.8% 7.5%,
|
|
|
+ 86% 7.5%,
|
|
|
+ 90% 2.7%,
|
|
|
+ 99% 2.7%,
|
|
|
+ 99% 89%,
|
|
|
+ 92% 98%,
|
|
|
+ 1% 98%
|
|
|
+ );
|
|
|
+ .img-con {
|
|
|
+ height: 100%;
|
|
|
+ .imgmain {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|