|
@@ -37,7 +37,7 @@
|
|
|
<div class="swiper-button-prev swiper-button-prev1"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="box2">
|
|
|
+ <div class="box2" v-if="box3Ac === 3 || box3Ac === 4">
|
|
|
<div v-for="(item, index) in data" :key="item.id">
|
|
|
<div @click="botChange(item)" :class="{ active: towAc === item.id }">
|
|
|
{{ item.name }}
|
|
@@ -91,71 +91,71 @@ export default {
|
|
|
// 点击底部的切换分区
|
|
|
botChange(item) {
|
|
|
this.towAc = "1";
|
|
|
- this.swData = [];
|
|
|
- this.Swiper = null;
|
|
|
this.towAc = item.id;
|
|
|
if (this.box3Ac === 3) this.data = [...exArr3];
|
|
|
else this.data = [...exArr4];
|
|
|
this.getSwFu(item.id + "", "1_1");
|
|
|
},
|
|
|
botChange2(item) {
|
|
|
+ this.$emit('zhanShowFu')
|
|
|
if (this.box3Ac === item.id) return;
|
|
|
this.towAc = "1";
|
|
|
- this.swData = [];
|
|
|
- this.Swiper = null;
|
|
|
this.box3Ac = item.id;
|
|
|
if (item.id === 1) this.data = [...exArr1];
|
|
|
else if (item.id === 2) this.data = [...exArr2];
|
|
|
else if (item.id === 3) this.data = [...exArr3];
|
|
|
else this.data = [...exArr4];
|
|
|
- this.getSwFu("1", "1_1");
|
|
|
+ this.getSwFu("1", "1_1",true);
|
|
|
|
|
|
// 给父组件传递信息
|
|
|
- this.$emit("zhanChange", this.box3Ac, item.code);
|
|
|
-
|
|
|
-
|
|
|
+ this.$emit("gaoduChange", this.box3Ac);
|
|
|
+ // this.$emit("zhanChange", this.box3Ac, item.code);
|
|
|
},
|
|
|
// 封装一个重新加载轮播图的方法
|
|
|
- getSwFu(id1, id2) {
|
|
|
- let obj = this.data.find((v) => v.id == id1);
|
|
|
- this.towAc = obj.id;
|
|
|
- let index = id2.indexOf("_");
|
|
|
- let bs = id2.substr(index + 1, id2.length);
|
|
|
- let num1 = Math.ceil(Number(bs) / 6);
|
|
|
- num1 -= num1;
|
|
|
- this.oneAc = id2;
|
|
|
-
|
|
|
- // 获取分区里面数据的长度
|
|
|
- let num = Math.ceil(obj.son.length / 6);
|
|
|
- for (let i = 0; i < num; i++) {
|
|
|
- this.swData.push({
|
|
|
- son: obj.son.slice(i * 6, (i + 1) * 6),
|
|
|
- });
|
|
|
- }
|
|
|
+ getSwFu(id1, id2,flag) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.Swiper = new Swiper(`.box1 .sww${this.towAc}`, {
|
|
|
- navigation: {
|
|
|
- nextEl: ".swiper-button-next1",
|
|
|
- prevEl: ".swiper-button-prev1",
|
|
|
- },
|
|
|
- slidesPerView: 1,
|
|
|
- initialSlide: num1,
|
|
|
- spaceBetween: 0,
|
|
|
- });
|
|
|
+ this.swData = [];
|
|
|
+ this.Swiper = null;
|
|
|
+
|
|
|
+ let obj = this.data.find((v) => v.id == id1);
|
|
|
+ this.towAc = obj.id;
|
|
|
+ let index = id2.indexOf("_");
|
|
|
+ let bs = id2.substr(index + 1, id2.length);
|
|
|
+ let num1 = Math.ceil(Number(bs) / 6);
|
|
|
+ num1 -= 1;
|
|
|
+ if(!flag) this.oneAc = id2;
|
|
|
+ // 获取分区里面数据的长度
|
|
|
+ let num = Math.ceil(obj.son.length / 6);
|
|
|
+ for (let i = 0; i < num; i++) {
|
|
|
+ this.swData.push({
|
|
|
+ son: obj.son.slice(i * 6, (i + 1) * 6),
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.Swiper = new Swiper(`.box1 .sww${this.towAc}`, {
|
|
|
+ navigation: {
|
|
|
+ nextEl: ".swiper-button-next1",
|
|
|
+ prevEl: ".swiper-button-prev1",
|
|
|
+ },
|
|
|
+ slidesPerView: 1,
|
|
|
+ initialSlide: num1,
|
|
|
+ spaceBetween: 0,
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
});
|
|
|
},
|
|
|
// 切换VR
|
|
|
cutVr(val) {
|
|
|
if (this.oneAc === val.id) return;
|
|
|
- console.log("切换vr");
|
|
|
this.oneAc = val.id;
|
|
|
- this.$emit("zhanChange", this.box3Ac, val.code);
|
|
|
+ this.$emit("zhanChange", val.code);
|
|
|
},
|
|
|
|
|
|
// 进来页面的方法
|
|
|
baseList(bs) {
|
|
|
- if (bs == 3) this.data = exArr3;
|
|
|
- else if (bs == 4) this.data = exArr4;
|
|
|
+ if (bs == 3) this.data = [...exArr3];
|
|
|
+ else if (bs == 4) this.data = [...exArr4];
|
|
|
else this.data = exArr1;
|
|
|
},
|
|
|
},
|
|
@@ -166,7 +166,7 @@ export default {
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
- this.getSwFu("1", "1_1");
|
|
|
+ this.getSwFu("1", "1_1",true);
|
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
beforeMount() {}, //生命周期 - 挂载之前
|
|
@@ -267,10 +267,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.swiper-button-next {
|
|
|
- color: #C48871;
|
|
|
+ color: #c48871;
|
|
|
}
|
|
|
.swiper-button-prev {
|
|
|
- color: #C48871;
|
|
|
+ color: #c48871;
|
|
|
}
|
|
|
}
|
|
|
.box2 {
|
|
@@ -291,15 +291,15 @@ export default {
|
|
|
}
|
|
|
& > div {
|
|
|
cursor: pointer;
|
|
|
- font-size: 20px;
|
|
|
+ font-size: 16px;
|
|
|
color: #fff;
|
|
|
padding-bottom: 5px;
|
|
|
opacity: 0.8;
|
|
|
&:hover {
|
|
|
opacity: 1;
|
|
|
padding-top: 2px;
|
|
|
- color: #C48871;
|
|
|
- border-bottom: 2px solid #C48871;
|
|
|
+ color: #c48871;
|
|
|
+ border-bottom: 2px solid #c48871;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -307,15 +307,15 @@ export default {
|
|
|
opacity: 1;
|
|
|
padding-top: 2px;
|
|
|
pointer-events: none;
|
|
|
- color: #C48871;
|
|
|
- border-bottom: 2px solid #C48871;
|
|
|
+ color: #c48871;
|
|
|
+ border-bottom: 2px solid #c48871;
|
|
|
}
|
|
|
}
|
|
|
.box3 {
|
|
|
margin-top: 5px;
|
|
|
background-color: rgba(0, 0, 0, 0.8);
|
|
|
width: 100%;
|
|
|
- height: 40px;
|
|
|
+ height: 56px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
@@ -337,17 +337,17 @@ export default {
|
|
|
&:hover {
|
|
|
opacity: 1;
|
|
|
padding-top: 2px;
|
|
|
- color: #C48871;
|
|
|
- border-bottom: 2px solid #C48871;
|
|
|
+ color: #c48871;
|
|
|
+ border-bottom: 2px solid #c48871;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
.active {
|
|
|
opacity: 1;
|
|
|
padding-top: 2px;
|
|
|
- pointer-events: none;
|
|
|
- color: #C48871;
|
|
|
- border-bottom: 2px solid #C48871;
|
|
|
+ // pointer-events: none;
|
|
|
+ color: #c48871;
|
|
|
+ border-bottom: 2px solid #c48871;
|
|
|
}
|
|
|
}
|
|
|
}
|