|
|
@@ -1,98 +1,119 @@
|
|
|
<template>
|
|
|
- <div class="images" >
|
|
|
- <div class="img-con">
|
|
|
- <span v-if="hotspot.image.length>1" @click="handlePage('prev')" >
|
|
|
- <img :src="require('@/assets/images/pano/hotspot/left.png')" alt="">
|
|
|
- </span>
|
|
|
- <img v-viewer :src="$serverName + hotspot.image[active].filePath" alt="">
|
|
|
- <span v-if="hotspot.image.length>1" @click="handlePage('next')">
|
|
|
- <img :src="require('@/assets/images/pano/hotspot/right.png')" alt="">
|
|
|
- </span>
|
|
|
- <ul class="pagna" v-if="hotspot.image.length>1">
|
|
|
- <li v-for="(item,i) in hotspot.image" :class="{active:i==active}" :key="i"></li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <div class="title" v-html="hotspot.hotspotTitle"></div>
|
|
|
- <div class="desc" v-html="hotspot.introduce"></div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
+ <div class="images">
|
|
|
+ <span
|
|
|
+ class="arrows"
|
|
|
+ v-if="hotspot.image.length > 1"
|
|
|
+ @click="handlePage('prev')"
|
|
|
+ >
|
|
|
+ <img :src="require('@/assets/images/pano/hotspot/left.png')" alt="" />
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ class="arrows"
|
|
|
+ v-if="hotspot.image.length > 1"
|
|
|
+ @click="handlePage('next')"
|
|
|
+ >
|
|
|
+ <img :src="require('@/assets/images/pano/hotspot/right.png')" alt="" />
|
|
|
+ </span>
|
|
|
+ <!-- 左右箭头 👆 -->
|
|
|
|
|
|
+ <div class="img-con">
|
|
|
+ <img
|
|
|
+ @click="$emit('close')"
|
|
|
+ class="close"
|
|
|
+ :src="require('@/assets/images/pano/hotspot/cancel.png')"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <!-- 关闭按钮 👆-->
|
|
|
+
|
|
|
+ <img
|
|
|
+ v-viewer
|
|
|
+ :src="$serverName + hotspot.image[active].filePath"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <ul class="pagna" v-if="hotspot.image.length > 1">
|
|
|
+ <li
|
|
|
+ v-for="(item, i) in hotspot.image"
|
|
|
+ :class="{ active: i == active }"
|
|
|
+ :key="i"
|
|
|
+ ></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="title" v-html="hotspot.hotspotTitle"></div>
|
|
|
+ <div class="desc" v-html="hotspot.introduce"></div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
export default {
|
|
|
-
|
|
|
- props:['hotspot'],
|
|
|
- data(){
|
|
|
+ props: ["hotspot"],
|
|
|
+ data() {
|
|
|
return {
|
|
|
- active:0,
|
|
|
- to:null,
|
|
|
- mbactive:0
|
|
|
- }
|
|
|
+ active: 0,
|
|
|
+ to: null,
|
|
|
+ mbactive: 0,
|
|
|
+ };
|
|
|
},
|
|
|
- watch:{
|
|
|
- active(){
|
|
|
+ watch: {
|
|
|
+ active() {
|
|
|
setTimeout(() => {
|
|
|
- this.$showLoading();
|
|
|
+ this.$showLoading();
|
|
|
});
|
|
|
|
|
|
if (this.to) {
|
|
|
- clearTimeout(this.to)
|
|
|
- this.to = null
|
|
|
+ clearTimeout(this.to);
|
|
|
+ this.to = null;
|
|
|
}
|
|
|
this.to = setTimeout(() => {
|
|
|
this.$hideLoading();
|
|
|
- },100);
|
|
|
- }
|
|
|
+ }, 100);
|
|
|
+ },
|
|
|
},
|
|
|
- beforeDestroy(){
|
|
|
- this.$hideLoading();
|
|
|
+ beforeDestroy() {
|
|
|
+ this.$hideLoading();
|
|
|
},
|
|
|
- methods:{
|
|
|
- handlePage(type){
|
|
|
- if (type==='next') {
|
|
|
- console.log(this.hotspot.image.length);
|
|
|
- if (this.active>=this.hotspot.image.length - 1) {
|
|
|
- this.active = 0
|
|
|
- return
|
|
|
- }
|
|
|
- this.active += 1
|
|
|
- }
|
|
|
- else{
|
|
|
- if (this.active==0) {
|
|
|
- this.active = this.hotspot.image.length - 1
|
|
|
- return
|
|
|
+ methods: {
|
|
|
+ handlePage(type) {
|
|
|
+ if (type === "next") {
|
|
|
+ console.log(this.hotspot.image.length);
|
|
|
+ if (this.active >= this.hotspot.image.length - 1) {
|
|
|
+ this.active = 0;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.active += 1;
|
|
|
+ } else {
|
|
|
+ if (this.active == 0) {
|
|
|
+ this.active = this.hotspot.image.length - 1;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.active -= 1;
|
|
|
}
|
|
|
- this.active -= 1
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- },
|
|
|
- computed:{
|
|
|
-
|
|
|
+ },
|
|
|
},
|
|
|
+ computed: {},
|
|
|
mounted() {
|
|
|
this.$showLoading();
|
|
|
if (this.TO) {
|
|
|
- clearTimeout(this.TO)
|
|
|
- this.TO = null
|
|
|
+ clearTimeout(this.TO);
|
|
|
+ this.TO = null;
|
|
|
}
|
|
|
this.TO = setTimeout(() => {
|
|
|
this.$hideLoading();
|
|
|
- },800);
|
|
|
+ }, 800);
|
|
|
},
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.noshow{
|
|
|
- opacity: 0!important;;
|
|
|
- pointer-events: none!important;;
|
|
|
+.noshow {
|
|
|
+ opacity: 0 !important;
|
|
|
+ pointer-events: none !important;
|
|
|
}
|
|
|
|
|
|
-.images{
|
|
|
+.images {
|
|
|
+ border-top: 10px solid #be1220;
|
|
|
+ border-bottom: 10px solid #be1220;
|
|
|
+ background: url("../../assets/images/pano/hotspot/bg.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
width: 1410px;
|
|
|
height: 760px;
|
|
|
text-align: center;
|
|
|
@@ -100,72 +121,74 @@ export default {
|
|
|
position: fixed;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
border-radius: 5px;
|
|
|
text-align: left;
|
|
|
color: #fff;
|
|
|
-
|
|
|
- .img-con{
|
|
|
+ .arrows {
|
|
|
+ display: inline-block;
|
|
|
+ padding: 0 30px;
|
|
|
+ box-sizing: content-box;
|
|
|
+ cursor: pointer;
|
|
|
+ position: absolute;
|
|
|
+ left: -140px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ > img {
|
|
|
+ width: 50px;
|
|
|
+ }
|
|
|
+ &:last-of-type {
|
|
|
+ left: unset;
|
|
|
+ right: -140px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .img-con {
|
|
|
display: flex;
|
|
|
justify-content: space-around;
|
|
|
align-items: center;
|
|
|
position: relative;
|
|
|
- padding-bottom: 40px;
|
|
|
- min-height: 70vh;
|
|
|
- >span{
|
|
|
- @juli:60px;
|
|
|
- display: inline-block;
|
|
|
- padding: 0 30px;
|
|
|
- box-sizing: content-box;
|
|
|
- cursor: pointer;
|
|
|
- position: absolute;
|
|
|
- left: @juli;
|
|
|
- top: 50%;
|
|
|
- transform: translateY(-50%);
|
|
|
- >img{
|
|
|
- width: 20px;
|
|
|
- }
|
|
|
- &:last-of-type{
|
|
|
- left: unset;
|
|
|
- right: @juli;
|
|
|
- }
|
|
|
- }
|
|
|
- >img{
|
|
|
+ padding-bottom: 20px;
|
|
|
+ min-height: 60vh;
|
|
|
+ padding-top: 30px;
|
|
|
+ > img {
|
|
|
max-width: 100%;
|
|
|
- max-height: 520px;
|
|
|
+ max-height: 500px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
- .pagna{
|
|
|
+ .pagna {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
text-align: center;
|
|
|
z-index: 999;
|
|
|
- >li{
|
|
|
- width: 10px;
|
|
|
+ > li {
|
|
|
+ width: 8px;
|
|
|
border-radius: 50%;
|
|
|
- height: 10px;
|
|
|
- background: rgba(51, 143, 123, .24);
|
|
|
+ height: 8px;
|
|
|
display: inline-block;
|
|
|
- margin: 0 4px;
|
|
|
- &.active{
|
|
|
- background: #338F7B;
|
|
|
+ margin: 0 5px;
|
|
|
+ background-color: #be1220;
|
|
|
+ opacity: .3;
|
|
|
+ &.active {
|
|
|
+ opacity: 1;
|
|
|
+ background-color: #be1220;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.title {
|
|
|
+ color: #8b3c43;
|
|
|
font-weight: bold;
|
|
|
- font-size: 30px;
|
|
|
+ font-size: 20px;
|
|
|
width: 100%;
|
|
|
padding: 0 50px;
|
|
|
margin-bottom: 10px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
-.desc{
|
|
|
+ .desc {
|
|
|
+ color: #8b3c43;
|
|
|
margin: 0 auto;
|
|
|
width: 70%;
|
|
|
- color: #fff;
|
|
|
- text-align: justify;
|
|
|
+ text-align: center;
|
|
|
line-height: 1.8;
|
|
|
max-height: 120px;
|
|
|
overflow-y: auto;
|
|
|
@@ -174,13 +197,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .close{
|
|
|
- position: fixed;
|
|
|
- top: 40px;
|
|
|
- right: 50px;
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
- cursor: pointer;
|
|
|
- z-index: 9999999;
|
|
|
- }
|
|
|
+.close {
|
|
|
+ position: fixed;
|
|
|
+ top: 20px;
|
|
|
+ right: 20px;
|
|
|
+ width: 26px;
|
|
|
+ height: 26px;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 9999999;
|
|
|
+}
|
|
|
</style>
|