|
@@ -1,12 +1,20 @@
|
|
<template>
|
|
<template>
|
|
<div v-if="cItem.entity">
|
|
<div v-if="cItem.entity">
|
|
<div class="img-body">
|
|
<div class="img-body">
|
|
- <img class="close" @click.stop="hideBroadcast" :src="require(`@/assets/images/icon/close.png`)" />
|
|
|
|
|
|
+ <img
|
|
|
|
+ class="close"
|
|
|
|
+ @click.stop="hideBroadcast"
|
|
|
|
+ :src="require(`@/assets/images/icon/close.png`)"
|
|
|
|
+ />
|
|
|
|
|
|
<template v-if="cItem.entity.type == 'img'">
|
|
<template v-if="cItem.entity.type == 'img'">
|
|
<div class="swcon swiper-container" id="imglist">
|
|
<div class="swcon swiper-container" id="imglist">
|
|
<ul class="swiper-wrapper">
|
|
<ul class="swiper-wrapper">
|
|
- <li class="swiper-slide" v-for="(sub, index) in cItem.file" :key="index">
|
|
|
|
|
|
+ <li
|
|
|
|
+ class="swiper-slide"
|
|
|
|
+ v-for="(sub, index) in cItem.file"
|
|
|
|
+ :key="index"
|
|
|
|
+ >
|
|
<div class="sl-item">
|
|
<div class="sl-item">
|
|
<img :src="sub.filePath" />
|
|
<img :src="sub.filePath" />
|
|
<p>{{ cItem.entity.name }}</p>
|
|
<p>{{ cItem.entity.name }}</p>
|
|
@@ -15,84 +23,114 @@
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<template v-if="cItem.file.length > 1">
|
|
<template v-if="cItem.file.length > 1">
|
|
- <img class="vpagination left" :src="require('@/assets/images/icon/left.png')" @click="slide('slidePrev')"
|
|
|
|
- alt="" />
|
|
|
|
- <img class="vpagination right" :src="require('@/assets/images/icon/right.png')" @click="slide('slideNext')"
|
|
|
|
- alt="" />
|
|
|
|
|
|
+ <img
|
|
|
|
+ class="vpagination left"
|
|
|
|
+ :src="require('@/assets/images/icon/left.png')"
|
|
|
|
+ @click="slide('slidePrev')"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
|
|
+ <img
|
|
|
|
+ class="vpagination right"
|
|
|
|
+ :src="require('@/assets/images/icon/right.png')"
|
|
|
|
+ @click="slide('slideNext')"
|
|
|
|
+ alt=""
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
<ul class="pagna" v-if="cItem.file.length > 1">
|
|
<ul class="pagna" v-if="cItem.file.length > 1">
|
|
- <li v-for="(sub, i) in cItem.file" :class="{ active: i == active }" :key="i"></li>
|
|
|
|
|
|
+ <li
|
|
|
|
+ v-for="(sub, i) in cItem.file"
|
|
|
|
+ :class="{ active: i == active }"
|
|
|
|
+ :key="i"
|
|
|
|
+ ></li>
|
|
</ul>
|
|
</ul>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
|
<template v-else>
|
|
- <iframe v-if="cItem.entity.type == 'model'" :src="`/model-page/model.html?m=${cItem.entity.filePath}`"
|
|
|
|
- frameborder="0"></iframe>
|
|
|
|
- <video ref="itemvideo" controlslist="nodownload noplaybackrate" :disablePictureInPicture="true"
|
|
|
|
- v-else-if="cItem.entity.type == 'video'" controls :src="cItem.entity.filePath" loop autoplay></video>
|
|
|
|
-
|
|
|
|
- <vAudio v-else :adata="cItem.entity" ></vAudio>
|
|
|
|
- <p v-if="cItem.entity.type != 'audio'" class="btmname">{{ cItem.entity.name }}</p>
|
|
|
|
|
|
+ <iframe
|
|
|
|
+ v-if="cItem.entity.type == 'model'"
|
|
|
|
+ :src="`/model-page/model.html?m=${cItem.entity.filePath}`"
|
|
|
|
+ frameborder="0"
|
|
|
|
+ ></iframe>
|
|
|
|
+ <video
|
|
|
|
+ ref="itemvideo"
|
|
|
|
+ controlslist="nodownload noplaybackrate"
|
|
|
|
+ :disablePictureInPicture="true"
|
|
|
|
+ v-else-if="cItem.entity.type == 'video'"
|
|
|
|
+ controls
|
|
|
|
+ :src="cItem.entity.filePath"
|
|
|
|
+ loop
|
|
|
|
+ autoplay
|
|
|
|
+ ></video>
|
|
|
|
+
|
|
|
|
+ <vAudio v-else :adata="cItem.entity"></vAudio>
|
|
|
|
+ <p v-if="cItem.entity.type != 'audio'" class="btmname">
|
|
|
|
+ {{ cItem.entity.name }}
|
|
|
|
+ </p>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import emitter from "@/mitt/index";
|
|
import emitter from "@/mitt/index";
|
|
-import vAudio from '@/components/Audio'
|
|
|
|
|
|
+import vAudio from "@/components/Audio";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
|
+ name: "showCollection",
|
|
props: ["item", "zhuti"],
|
|
props: ["item", "zhuti"],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
isFull: false,
|
|
isFull: false,
|
|
active: 0,
|
|
active: 0,
|
|
- swInstance: null
|
|
|
|
|
|
+ swInstance: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
components: { vAudio },
|
|
components: { vAudio },
|
|
computed: {
|
|
computed: {
|
|
cItem() {
|
|
cItem() {
|
|
- return { ...this.item }
|
|
|
|
- }
|
|
|
|
|
|
+ return { ...this.item };
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
isFull(newVal) {
|
|
isFull(newVal) {
|
|
let tmp = this.cItem.type == "img";
|
|
let tmp = this.cItem.type == "img";
|
|
this.$emit("hideSlide", tmp && !newVal);
|
|
this.$emit("hideSlide", tmp && !newVal);
|
|
},
|
|
},
|
|
|
|
+ // "swInstance.activeIndex"(val) {
|
|
|
|
+ // this.active = val;
|
|
|
|
+ // console.log("----------", val);
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
slide(type) {
|
|
slide(type) {
|
|
this.swInstance[type]();
|
|
this.swInstance[type]();
|
|
},
|
|
},
|
|
hideBroadcast() {
|
|
hideBroadcast() {
|
|
- emitter.emit('closeCollection')
|
|
|
|
- }
|
|
|
|
|
|
+ emitter.emit("closeCollection");
|
|
|
|
+ },
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- let that = this
|
|
|
|
|
|
+ let that = this;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
let t = setTimeout(() => {
|
|
let t = setTimeout(() => {
|
|
clearTimeout(t);
|
|
clearTimeout(t);
|
|
this.swInstance = new Swiper("#imglist", {
|
|
this.swInstance = new Swiper("#imglist", {
|
|
slidesPerView: "auto",
|
|
slidesPerView: "auto",
|
|
|
|
+ normalizeSlideIndex: false,
|
|
on: {
|
|
on: {
|
|
- slideChangeTransitionEnd() {
|
|
|
|
|
|
+ slideChange() {
|
|
that.active = this.realIndex;
|
|
that.active = this.realIndex;
|
|
|
|
+ if (this.realIndex > that.cItem.file.length - 1)
|
|
|
|
+ that.active = that.cItem.file.length - 1;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
});
|
|
- console.log(this.swInstance);
|
|
|
|
- },200);
|
|
|
|
- })
|
|
|
|
|
|
+ }, 200);
|
|
|
|
+ });
|
|
},
|
|
},
|
|
-
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-
|
|
|
|
.img-body {
|
|
.img-body {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -154,7 +192,7 @@ export default {
|
|
height: 95%;
|
|
height: 95%;
|
|
position: relative;
|
|
position: relative;
|
|
|
|
|
|
- >img {
|
|
|
|
|
|
+ > img {
|
|
width: auto;
|
|
width: auto;
|
|
max-height: 90vh;
|
|
max-height: 90vh;
|
|
max-width: 100%;
|
|
max-width: 100%;
|
|
@@ -165,7 +203,7 @@ export default {
|
|
transform: translate(-50%, -50%);
|
|
transform: translate(-50%, -50%);
|
|
}
|
|
}
|
|
|
|
|
|
- >p {
|
|
|
|
|
|
+ > p {
|
|
color: #fff;
|
|
color: #fff;
|
|
position: absolute;
|
|
position: absolute;
|
|
bottom: 30px;
|
|
bottom: 30px;
|
|
@@ -186,7 +224,7 @@ export default {
|
|
text-align: center;
|
|
text-align: center;
|
|
z-index: 999;
|
|
z-index: 999;
|
|
|
|
|
|
- >li {
|
|
|
|
|
|
+ > li {
|
|
width: 10px;
|
|
width: 10px;
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
height: 10px;
|
|
height: 10px;
|
|
@@ -268,179 +306,178 @@ export default {
|
|
|
|
|
|
@media screen and (max-width: 1000px) {
|
|
@media screen and (max-width: 1000px) {
|
|
.img-body {
|
|
.img-body {
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
- position: relative;
|
|
|
|
- color: #fff;
|
|
|
|
-
|
|
|
|
- iframe,
|
|
|
|
- audio,
|
|
|
|
- video {
|
|
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 80%;
|
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
- top: 50%;
|
|
|
|
- left: 50%;
|
|
|
|
- position: absolute;
|
|
|
|
- }
|
|
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ color: #fff;
|
|
|
|
|
|
- audio {
|
|
|
|
- width: 50%;
|
|
|
|
- height: 20%;
|
|
|
|
- }
|
|
|
|
|
|
+ iframe,
|
|
|
|
+ audio,
|
|
|
|
+ video {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 80%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ }
|
|
|
|
|
|
- .btmname {
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
- bottom: 30px;
|
|
|
|
- left: 50%;
|
|
|
|
- position: absolute;
|
|
|
|
- font-size: 24px;
|
|
|
|
- }
|
|
|
|
|
|
+ audio {
|
|
|
|
+ width: 50%;
|
|
|
|
+ height: 20%;
|
|
|
|
+ }
|
|
|
|
|
|
- .close {
|
|
|
|
- position: absolute;
|
|
|
|
- right: 20px;
|
|
|
|
- top: 20px;
|
|
|
|
- width: 30px;
|
|
|
|
- height: 30px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- z-index: 999999;
|
|
|
|
- }
|
|
|
|
|
|
+ .btmname {
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ bottom: 30px;
|
|
|
|
+ left: 50%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ }
|
|
|
|
|
|
- .swcon {
|
|
|
|
- position: relative;
|
|
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
|
|
+ .close {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 20px;
|
|
|
|
+ top: 20px;
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ z-index: 999999;
|
|
|
|
+ }
|
|
|
|
|
|
- .swiper-wrapper {
|
|
|
|
- padding: 0;
|
|
|
|
|
|
+ .swcon {
|
|
|
|
+ position: relative;
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
|
|
- .swiper-slide {
|
|
|
|
|
|
+ .swiper-wrapper {
|
|
|
|
+ padding: 0;
|
|
width: 100%;
|
|
width: 100%;
|
|
- transform-style: preserve-3d;
|
|
|
|
- position: relative;
|
|
|
|
- height: 100%;
|
|
|
|
- margin: 0 auto;
|
|
|
|
- transform: translate3d(0, 0, 0);
|
|
|
|
|
|
|
|
- .sl-item {
|
|
|
|
|
|
+ .swiper-slide {
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 95%;
|
|
|
|
|
|
+ transform-style: preserve-3d;
|
|
position: relative;
|
|
position: relative;
|
|
-
|
|
|
|
- >img {
|
|
|
|
- width: auto;
|
|
|
|
- max-height: 90vh;
|
|
|
|
- max-width: 100%;
|
|
|
|
- cursor: pointer;
|
|
|
|
- position: absolute;
|
|
|
|
- top: 50%;
|
|
|
|
- left: 50%;
|
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- >p {
|
|
|
|
- color: #fff;
|
|
|
|
- position: absolute;
|
|
|
|
- bottom: 30px;
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
- left: 50%;
|
|
|
|
- font-size: 24px;
|
|
|
|
|
|
+ height: 100%;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ transform: translate3d(0, 0, 0);
|
|
|
|
+
|
|
|
|
+ .sl-item {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 95%;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ > img {
|
|
|
|
+ width: auto;
|
|
|
|
+ max-height: 90vh;
|
|
|
|
+ max-width: 100%;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ > p {
|
|
|
|
+ color: #fff;
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 30px;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ left: 50%;
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
-
|
|
|
|
- .pagna {
|
|
|
|
- position: absolute;
|
|
|
|
- bottom: 20px;
|
|
|
|
- left: 50%;
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
- text-align: center;
|
|
|
|
- z-index: 999;
|
|
|
|
-
|
|
|
|
- >li {
|
|
|
|
- width: 10px;
|
|
|
|
- border-radius: 50%;
|
|
|
|
- height: 10px;
|
|
|
|
- background: rgba(51, 143, 123, 0.24);
|
|
|
|
- display: inline-block;
|
|
|
|
- margin: 0 4px;
|
|
|
|
|
|
|
|
- &.active {
|
|
|
|
- background: #338f7b;
|
|
|
|
|
|
+ .pagna {
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom: 20px;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ text-align: center;
|
|
|
|
+ z-index: 999;
|
|
|
|
+
|
|
|
|
+ > li {
|
|
|
|
+ width: 10px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ height: 10px;
|
|
|
|
+ background: rgba(51, 143, 123, 0.24);
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin: 0 4px;
|
|
|
|
+
|
|
|
|
+ &.active {
|
|
|
|
+ background: #338f7b;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- .vpagination {
|
|
|
|
- position: absolute;
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translateY(-50%);
|
|
|
|
- cursor: pointer;
|
|
|
|
- width: 50px;
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
|
|
+ .vpagination {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ width: 50px;
|
|
|
|
+ display: none;
|
|
|
|
+ }
|
|
|
|
|
|
- $pos: 180px;
|
|
|
|
|
|
+ $pos: 180px;
|
|
|
|
|
|
- .left {
|
|
|
|
- left: $pos;
|
|
|
|
- }
|
|
|
|
|
|
+ .left {
|
|
|
|
+ left: $pos;
|
|
|
|
+ }
|
|
|
|
|
|
- .right {
|
|
|
|
- right: $pos;
|
|
|
|
|
|
+ .right {
|
|
|
|
+ right: $pos;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-}
|
|
|
|
-
|
|
|
|
-.full {
|
|
|
|
- width: 100%;
|
|
|
|
- height: 100%;
|
|
|
|
- z-index: 99999999;
|
|
|
|
- position: relative;
|
|
|
|
|
|
|
|
- iframe,
|
|
|
|
- video {
|
|
|
|
|
|
+ .full {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
- }
|
|
|
|
|
|
+ z-index: 99999999;
|
|
|
|
+ position: relative;
|
|
|
|
|
|
- .conname {
|
|
|
|
- color: #fff;
|
|
|
|
- margin-top: 6px;
|
|
|
|
- position: fixed;
|
|
|
|
- left: 50%;
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
- bottom: 40px;
|
|
|
|
- font-size: 18px;
|
|
|
|
- }
|
|
|
|
|
|
+ iframe,
|
|
|
|
+ video {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
|
|
- .img {
|
|
|
|
- height: 100%;
|
|
|
|
- position: absolute;
|
|
|
|
- left: 50%;
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translate(-50%, -50%);
|
|
|
|
- }
|
|
|
|
|
|
+ .conname {
|
|
|
|
+ color: #fff;
|
|
|
|
+ margin-top: 6px;
|
|
|
|
+ position: fixed;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
+ bottom: 40px;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ }
|
|
|
|
|
|
- .full-btn {
|
|
|
|
- width: 30px;
|
|
|
|
- position: absolute;
|
|
|
|
- right: 12px;
|
|
|
|
- bottom: 30px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- }
|
|
|
|
|
|
+ .img {
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 50%;
|
|
|
|
+ top: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ }
|
|
|
|
|
|
- .full-close {
|
|
|
|
- width: 30px;
|
|
|
|
- position: absolute;
|
|
|
|
- right: 12px;
|
|
|
|
- top: 30px;
|
|
|
|
- cursor: pointer;
|
|
|
|
|
|
+ .full-btn {
|
|
|
|
+ width: 30px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 12px;
|
|
|
|
+ bottom: 30px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .full-close {
|
|
|
|
+ width: 30px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 12px;
|
|
|
|
+ top: 30px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
-
|
|
|
|
</style>
|
|
</style>
|