|
|
@@ -22,7 +22,10 @@
|
|
|
</div>
|
|
|
<div class="conten">
|
|
|
<div class="left">
|
|
|
- <img :src="require(`@/assets/img/contCun/${$route.params.id}.png`)" alt="" />
|
|
|
+ <img
|
|
|
+ :src="require(`@/assets/img/contCun/${$route.params.id}.png`)"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
<div class="leftRow">
|
|
|
<div
|
|
|
@click="cutScroll(index)"
|
|
|
@@ -45,12 +48,48 @@
|
|
|
</div>
|
|
|
<!-- 主要切换内容 -->
|
|
|
<div class="right">
|
|
|
- <Son1 @pageNext="pageNext" v-if="topDataInd === '1000'" />
|
|
|
- <Son2 @pageNext="pageNext" v-else-if="topDataInd === '2000'" />
|
|
|
- <Son3 @pageNext="pageNext" v-else-if="topDataInd === '3000'" />
|
|
|
- <Son4 @pageNext="pageNext" v-else-if="topDataInd === '4000'" />
|
|
|
- <Son5 @pageNext="pageNext" v-else-if="topDataInd === '5000'" />
|
|
|
- <Son6 @pageNext="pageNext" v-else-if="topDataInd === '6000'" />
|
|
|
+ <Son1
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-if="topDataInd === '1000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ <Son2
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-else-if="topDataInd === '2000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ <Son3
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-else-if="topDataInd === '3000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ <Son4
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-else-if="topDataInd === '4000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ <Son5
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-else-if="topDataInd === '5000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ <Son6
|
|
|
+ @pageNext="pageNext"
|
|
|
+ v-else-if="topDataInd === '6000'"
|
|
|
+ @openLook="openLook"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 查看图片 -->
|
|
|
+ <viewer class="viewerCla" ref="viewer" :images="lookPics">
|
|
|
+ <img :src="lookPics[0]" alt="" />
|
|
|
+ </viewer>
|
|
|
+
|
|
|
+ <!-- 查看视频的盒子 -->
|
|
|
+ <div class="videoBox" v-if="lookShow === 'video'">
|
|
|
+ <video autoplay controls :src="lookUrl"></video>
|
|
|
+ <div class="closeL" @click="lookShow = null">
|
|
|
+ <img src="../../assets/img/closeL.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -70,6 +109,10 @@ export default {
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
+ lookShow: null,
|
|
|
+ lookUrl: null,
|
|
|
+ lookPics: [],
|
|
|
+ // ----------------------
|
|
|
leftData: [],
|
|
|
topDataInd: "1000",
|
|
|
topData: [],
|
|
|
@@ -87,7 +130,7 @@ export default {
|
|
|
pageInd(val) {
|
|
|
let dom = document.querySelector(".conten");
|
|
|
dom.scrollTo({ top: this.pageHeight * val, behavior: "smooth" });
|
|
|
- // 切换的时候暂时视频
|
|
|
+ // // 切换的时候暂时视频
|
|
|
this.$nextTick(() => {
|
|
|
setTimeout(() => {
|
|
|
let dom = document.querySelectorAll("video");
|
|
|
@@ -100,6 +143,16 @@ export default {
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ openLook(url, type) {
|
|
|
+ if (type === "img") {
|
|
|
+ let dom = this.$refs.viewer.$viewer;
|
|
|
+ this.lookPics = [url];
|
|
|
+ dom.show();
|
|
|
+ } else {
|
|
|
+ this.lookUrl = url;
|
|
|
+ this.lookShow = type;
|
|
|
+ }
|
|
|
+ },
|
|
|
pageNext(index) {
|
|
|
this.cutScroll(index);
|
|
|
},
|
|
|
@@ -127,6 +180,25 @@ export default {
|
|
|
// 获取一个页面的高度
|
|
|
let domH = document.querySelector(".conten .right");
|
|
|
this.pageHeight = domH.clientHeight;
|
|
|
+ // uc浏览器兼容问题
|
|
|
+ let dom = document.querySelector(".conten");
|
|
|
+ if (!dom.scrollTo) {
|
|
|
+ const Element = window.HTMLElement || window.Element;
|
|
|
+ Element.prototype.scrollTo = function () {
|
|
|
+ let left = 0;
|
|
|
+ let top = 0;
|
|
|
+ if (arguments.length > 1) {
|
|
|
+ left = arguments[0];
|
|
|
+ top = arguments[1];
|
|
|
+ } else {
|
|
|
+ left = arguments[0].left;
|
|
|
+ top = arguments[0].top;
|
|
|
+ }
|
|
|
+ this.scrollLeft = left;
|
|
|
+ this.scrollTop = top;
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
// 获取滚动元素
|
|
|
// let sroolDom = document.querySelector(".info .conten");
|
|
|
// sroolDom.addEventListener(
|
|
|
@@ -207,7 +279,8 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
.top {
|
|
|
- z-index: 9999;
|
|
|
+ font-family: "思源宋体";
|
|
|
+ z-index: 1999;
|
|
|
min-width: 1800px;
|
|
|
padding: 0 0px 0 120px;
|
|
|
color: #fff;
|
|
|
@@ -301,5 +374,32 @@ export default {
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
+ .videoBox {
|
|
|
+ position: fixed;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 99999;
|
|
|
+ background-color: rgba(0, 0, 0, 0.8);
|
|
|
+ video {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .closeL {
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 99999;
|
|
|
+ position: absolute;
|
|
|
+ top: 10px;
|
|
|
+ right: 10px;
|
|
|
+ width: 30px;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .viewerCla img {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|