|
@@ -4,21 +4,30 @@
|
|
|
<!-- 标题 -->
|
|
|
<div class="title">
|
|
|
<div class="back" @click="$router.go(-1)"></div>
|
|
|
- <h3>{{ data.name }}</h3>
|
|
|
+ <h3 v-if="data.name&&data.name[imgInd]">{{ data.name[imgInd] }}</h3>
|
|
|
</div>
|
|
|
<!-- 模型 -->
|
|
|
<div class="model" :class="`model${$route.params.id}`">
|
|
|
<div class="swiper-container">
|
|
|
<div class="swiper-wrapper" ref="mySwiper">
|
|
|
+ <template v-if="data.url && data.url.length > 0&&$route.params.id=='21'">
|
|
|
+ <div
|
|
|
+ class="swiper-slide"
|
|
|
+ v-for="(url, index) in modelUrl"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <iframe class="iframeBox" :src="url" frameborder="0"></iframe>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div
|
|
|
class="swiper-slide"
|
|
|
v-for="item in data.img"
|
|
|
:key="item"
|
|
|
- @click="lookImg(`data/${$route.params.id}_${item}.png`)"
|
|
|
+ @click="lookImg(`data/${item}.png`)"
|
|
|
>
|
|
|
- <img :src="`data/${$route.params.id}_${item}.png`" alt="" />
|
|
|
+ <img :src="`data/${item}.png`" alt="" />
|
|
|
</div>
|
|
|
- <template v-if="data.url && data.url.length > 0">
|
|
|
+ <template v-if="data.url && data.url.length > 0&&$route.params.id!='21'">
|
|
|
<div
|
|
|
class="swiper-slide"
|
|
|
v-for="(url, index) in modelUrl"
|
|
@@ -36,7 +45,7 @@
|
|
|
<!-- <div>1/{{ data.img + 1 }}</div> -->
|
|
|
</div>
|
|
|
<!-- 左右箭头 -->
|
|
|
- <div class="nextTo">
|
|
|
+ <div class="nextTo" v-show="nextToFlag">
|
|
|
<div class="swiper-button-next">下一件</div>
|
|
|
<div class="swiper-button-prev">上一件</div>
|
|
|
</div>
|
|
@@ -66,6 +75,8 @@ export default {
|
|
|
data: {},
|
|
|
lookPics: [],
|
|
|
modelUrl: [],
|
|
|
+ nextToFlag: true,
|
|
|
+ imgInd: 0,
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
@@ -91,36 +102,41 @@ export default {
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
activated() {
|
|
|
+ this.imgInd=0
|
|
|
+ this.nextToFlag=true
|
|
|
this.data = {};
|
|
|
this.lookPics = [];
|
|
|
- window.scrollTo({ top: 0 });
|
|
|
- this.data = info.find((v) => v.id == this.$route.params.id);
|
|
|
+ // window.scrollTo({ top: 0 });
|
|
|
+ document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
|
+ let myId = this.$route.params.id;
|
|
|
+ this.data = info.find((v) => v.id == myId);
|
|
|
this.$nextTick(() => {
|
|
|
+ console.log("-----", this.data);
|
|
|
+ if (this.data.img.length + this.data.url.length <= 1) this.nextToFlag = false;
|
|
|
setTimeout(() => {
|
|
|
- let aaa = new Swiper(
|
|
|
- `.model${this.$route.params.id} .swiper-container`,
|
|
|
- {
|
|
|
- navigation: {
|
|
|
- nextEl: ".swiper-button-next",
|
|
|
- prevEl: ".swiper-button-prev",
|
|
|
- },
|
|
|
- pagination: {
|
|
|
- el: ".swiper-pagination",
|
|
|
- type: "fraction",
|
|
|
+ let aaa = new Swiper(`.model${myId} .swiper-container`, {
|
|
|
+ navigation: {
|
|
|
+ nextEl: ".swiper-button-next",
|
|
|
+ prevEl: ".swiper-button-prev",
|
|
|
+ },
|
|
|
+ pagination: {
|
|
|
+ el: ".swiper-pagination",
|
|
|
+ type: "fraction",
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ slideChange: () => {
|
|
|
+ let ind = aaa.activeIndex;
|
|
|
+ this.imgInd = ind;
|
|
|
+ console.log('123',this.imgInd,this.data.name[this.imgInd]);
|
|
|
+ if (this.modelUrl[ind] == "") {
|
|
|
+ let dom = document.querySelectorAll(".iframeBox");
|
|
|
+ dom[ind].src = this.data.url[ind];
|
|
|
+ // console.log("-----", dom[ind].src);
|
|
|
+ this.modelUrl[ind] = this.data.url[ind];
|
|
|
+ }
|
|
|
},
|
|
|
- on: {
|
|
|
- slideChange: () => {
|
|
|
- let ind = aaa.activeIndex;
|
|
|
- if (this.modelUrl[ind] == "") {
|
|
|
- let dom = document.querySelectorAll(".iframeBox");
|
|
|
- dom[ind].src = this.data.url[ind];
|
|
|
- console.log("-----", dom[ind].src);
|
|
|
- this.modelUrl[ind] = this.data.url[ind];
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- }
|
|
|
- );
|
|
|
+ },
|
|
|
+ });
|
|
|
}, 100);
|
|
|
});
|
|
|
let temp = [];
|
|
@@ -155,6 +171,7 @@ export default {
|
|
|
text-align: center;
|
|
|
font-size: 20px;
|
|
|
line-height: 30px;
|
|
|
+ min-height: 60px;
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
@@ -173,7 +190,7 @@ export default {
|
|
|
& > img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- object-fit: cover;
|
|
|
+ object-fit: contain;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -207,7 +224,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.myMusic {
|
|
|
- padding: 10px 20px 40px 30px;
|
|
|
+ padding: 30px 20px 30px 30px;
|
|
|
border-bottom: 2px dashed rgba(235, 223, 191, 0.2);
|
|
|
}
|
|
|
.txtt {
|
|
@@ -223,12 +240,12 @@ export default {
|
|
|
margin-top: 15px;
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
- height: 50px;
|
|
|
+ height: 20px;
|
|
|
z-index: 999;
|
|
|
.swiper-button-next {
|
|
|
z-index: 999;
|
|
|
width: 100px;
|
|
|
- height: 50px;
|
|
|
+ height: 20px;
|
|
|
background-color: #e7dbbc;
|
|
|
right: 24px;
|
|
|
bottom: 0px;
|
|
@@ -246,7 +263,7 @@ export default {
|
|
|
padding-left: 36px;
|
|
|
width: 110px;
|
|
|
z-index: 999;
|
|
|
- height: 50px;
|
|
|
+ height: 20px;
|
|
|
background-color: #e7dbbc;
|
|
|
left: 30px;
|
|
|
top: auto;
|