|
@@ -8,7 +8,7 @@
|
|
|
|
|
|
<div class="zhan-con" ref="bgsw" v-swiper:mySwiper="swiperOptions">
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li @click="onClick(item)" class="swiper-slide" v-for="(item, i) in zhanxiangData.company" :key="i">
|
|
|
+ <li @click="onClick(item, i)" class="swiper-slide" v-for="(item, i) in zhanxiangData.company" :key="i">
|
|
|
<div class="img">
|
|
|
<img :src="`zhanxiang/images/${theme}/${item.img}`" alt="" />
|
|
|
</div>
|
|
@@ -29,9 +29,11 @@ import "swiper/css/swiper.css";
|
|
|
import { Booth } from "@/data/booth.js";
|
|
|
|
|
|
export default {
|
|
|
+ props: ["zxdata", "currentPanoid"],
|
|
|
data() {
|
|
|
return {
|
|
|
searchkey: "",
|
|
|
+ initIdx: 0
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -43,7 +45,10 @@ export default {
|
|
|
show: false,
|
|
|
});
|
|
|
},
|
|
|
- onClick(data) {
|
|
|
+ onClick(data, idx) {
|
|
|
+ if (this.swiper.realIndex != idx) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$bus.$emit("ifrMessage", {
|
|
|
events: "flyToPano",
|
|
|
data: data,
|
|
@@ -52,8 +57,6 @@ export default {
|
|
|
},
|
|
|
search() {
|
|
|
this.$emit("showSearch", true);
|
|
|
- // let idx = this.zhanxiangData.company.findIndex((item) => item.name.indexOf(this.searchkey) > -1)
|
|
|
- // this.swiper.slideToLoop(idx);
|
|
|
},
|
|
|
},
|
|
|
directives: {
|
|
@@ -64,6 +67,7 @@ export default {
|
|
|
return this.$refs.bgsw.swiper;
|
|
|
},
|
|
|
zhanxiangData() {
|
|
|
+ console.log(Booth.find((item) => item.id == this.theme));
|
|
|
return Booth.find((item) => item.id == this.theme);
|
|
|
},
|
|
|
swiperOptions() {
|
|
@@ -73,6 +77,7 @@ export default {
|
|
|
effect: that.g_isLandscape ? "coverflow" : "slide",
|
|
|
slidesPerView: "auto",
|
|
|
centeredSlides: true,
|
|
|
+ initialSlide: this.initIdx,
|
|
|
coverflowEffect: {
|
|
|
rotate: 0,
|
|
|
stretch: 124,
|
|
@@ -84,40 +89,54 @@ export default {
|
|
|
on: that.g_isLandscape
|
|
|
? {}
|
|
|
: {
|
|
|
- progress: function() {
|
|
|
- for (let i = 0; i < this.slides.length; i++) {
|
|
|
- var slide = this.slides.eq(i);
|
|
|
- var slideProgress = this.slides[i].progress;
|
|
|
- let modify = 1;
|
|
|
- let fixY = 0;
|
|
|
-
|
|
|
- if (Math.abs(slideProgress) > 1) {
|
|
|
- modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
|
|
|
- }
|
|
|
- let translateX = slideProgress * modify * 120 + "px";
|
|
|
- let translateY = fixY + (that.g_isLandscape ? Math.abs(slideProgress) : -Math.abs(slideProgress)) * 35 + "px";
|
|
|
-
|
|
|
- let zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
|
- let opacity = 1 - Math.abs(slideProgress) / 10;
|
|
|
-
|
|
|
- slide.transform(`translateX(${translateX}) translateY(${translateY})`);
|
|
|
- slide.css("zIndex", zIndex);
|
|
|
- slide.css("opacity", opacity);
|
|
|
- if (Math.abs(slideProgress) > 3) {
|
|
|
- slide.css("opacity", 0);
|
|
|
- }
|
|
|
+ progress: function () {
|
|
|
+ for (let i = 0; i < this.slides.length; i++) {
|
|
|
+ var slide = this.slides.eq(i);
|
|
|
+ var slideProgress = this.slides[i].progress;
|
|
|
+ let modify = 1;
|
|
|
+ let fixY = 0;
|
|
|
+
|
|
|
+ if (Math.abs(slideProgress) > 1) {
|
|
|
+ modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
|
|
|
}
|
|
|
- },
|
|
|
- setTransition: function(transition) {
|
|
|
- for (var i = 0; i < this.slides.length; i++) {
|
|
|
- var slide = this.slides.eq(i);
|
|
|
- slide.transition(transition);
|
|
|
+ let translateX = slideProgress * modify * 120 + "px";
|
|
|
+ let translateY = fixY + (that.g_isLandscape ? Math.abs(slideProgress) : -Math.abs(slideProgress)) * 35 + "px";
|
|
|
+
|
|
|
+ let zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
|
|
|
+ let opacity = 1 - Math.abs(slideProgress) / 10;
|
|
|
+
|
|
|
+ slide.transform(`translateX(${translateX}) translateY(${translateY})`);
|
|
|
+ slide.css("zIndex", zIndex);
|
|
|
+ slide.css("opacity", opacity);
|
|
|
+
|
|
|
+ if (Math.abs(slideProgress) > 3) {
|
|
|
+ slide.css("opacity", 0);
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
+ setTransition: function (transition) {
|
|
|
+ for (var i = 0; i < this.slides.length; i++) {
|
|
|
+ var slide = this.slides.eq(i);
|
|
|
+ slide.transition(transition);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ currentPanoid: {
|
|
|
+ immediate: true,
|
|
|
+ handler: function (newVal) {
|
|
|
+ let idx = this.zxdata.company.findIndex((item) => newVal == item.panoId);
|
|
|
+ if (idx > -1) {
|
|
|
+ this.initIdx = idx
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -133,6 +152,7 @@ export default {
|
|
|
left: 0;
|
|
|
background-color: rgba(255, 255, 255, 0.5);
|
|
|
backdrop-filter: blur(20px);
|
|
|
+
|
|
|
.z-bar {
|
|
|
height: 60px;
|
|
|
width: 100%;
|
|
@@ -142,11 +162,13 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 0 10px;
|
|
|
- > img {
|
|
|
+
|
|
|
+ >img {
|
|
|
width: 50px;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
text-align: left;
|
|
|
display: inline-block;
|
|
|
flex: auto;
|
|
@@ -160,10 +182,12 @@ export default {
|
|
|
position: relative;
|
|
|
height: calc(100vh - 60px);
|
|
|
padding-bottom: 30px;
|
|
|
- > ul {
|
|
|
+
|
|
|
+ >ul {
|
|
|
width: 100%;
|
|
|
align-items: flex-end;
|
|
|
- > li {
|
|
|
+
|
|
|
+ >li {
|
|
|
width: 80%;
|
|
|
max-height: 56vh;
|
|
|
padding: 20px 16px;
|
|
@@ -174,24 +198,27 @@ export default {
|
|
|
background-size: 100% auto;
|
|
|
background-position: bottom left;
|
|
|
background-repeat: no-repeat;
|
|
|
+
|
|
|
.img {
|
|
|
width: 100%;
|
|
|
margin-top: 0;
|
|
|
|
|
|
- > img {
|
|
|
+ >img {
|
|
|
width: 100%;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- > div {
|
|
|
+ >div {
|
|
|
color: #000;
|
|
|
text-align: center;
|
|
|
margin-top: 30px;
|
|
|
- > h3 {
|
|
|
+
|
|
|
+ >h3 {
|
|
|
font-size: 20px;
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
font-size: 16px;
|
|
|
line-height: 1.5;
|
|
|
display: inline-block;
|
|
@@ -215,6 +242,7 @@ export default {
|
|
|
left: 0;
|
|
|
background-color: rgba(255, 255, 255, 0.5);
|
|
|
backdrop-filter: blur(20px);
|
|
|
+
|
|
|
.z-bar {
|
|
|
height: 60px;
|
|
|
width: 100%;
|
|
@@ -224,11 +252,13 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 0 10px;
|
|
|
- > img {
|
|
|
+
|
|
|
+ >img {
|
|
|
width: 50px;
|
|
|
flex-shrink: 0;
|
|
|
}
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
text-align: left;
|
|
|
display: inline-block;
|
|
|
flex: auto;
|
|
@@ -242,10 +272,12 @@ export default {
|
|
|
position: relative;
|
|
|
height: calc(100vh - 60px);
|
|
|
padding-bottom: 0;
|
|
|
- > ul {
|
|
|
+
|
|
|
+ >ul {
|
|
|
width: 100%;
|
|
|
align-items: center;
|
|
|
- > li {
|
|
|
+
|
|
|
+ >li {
|
|
|
width: 58%;
|
|
|
max-height: 90%;
|
|
|
padding: 16px;
|
|
@@ -256,13 +288,15 @@ export default {
|
|
|
background-position: bottom left;
|
|
|
background-repeat: no-repeat;
|
|
|
display: flex;
|
|
|
+
|
|
|
.img {
|
|
|
flex: 2;
|
|
|
width: auto;
|
|
|
text-align: center;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
- > img {
|
|
|
+
|
|
|
+ >img {
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
@@ -271,14 +305,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- > div {
|
|
|
+ >div {
|
|
|
color: #000;
|
|
|
text-align: center;
|
|
|
margin-top: 0;
|
|
|
width: 24%;
|
|
|
flex-shrink: 0;
|
|
|
margin-left: 16px;
|
|
|
- > h3 {
|
|
|
+
|
|
|
+ >h3 {
|
|
|
position: absolute;
|
|
|
top: 16px;
|
|
|
right: 16px;
|
|
@@ -290,7 +325,8 @@ export default {
|
|
|
text-align: left;
|
|
|
height: 100%;
|
|
|
}
|
|
|
- > span {
|
|
|
+
|
|
|
+ >span {
|
|
|
font-size: 18px;
|
|
|
line-height: 1.2;
|
|
|
margin-left: 10px;
|