|
@@ -53,13 +53,25 @@
|
|
|
:key="index"
|
|
|
>
|
|
|
<div
|
|
|
+ v-if="item.fourTableVoList.length > 1"
|
|
|
+ class="control-left"
|
|
|
+ @click="chageL(index, item.showIndex)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-arrow-left"></i>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="item.fourTableVoList.length > 1"
|
|
|
+ class="control-right"
|
|
|
+ @click="chageR(index, item.showIndex)"
|
|
|
+ >
|
|
|
+ <i class="el-icon-arrow-right"></i>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="item.showIndex == elIndex"
|
|
|
class="type-item"
|
|
|
:id="'zj' + index"
|
|
|
- v-for="(ele, index) in item.fourTableVoList"
|
|
|
- :key="index"
|
|
|
- :style="
|
|
|
- item.fourTableVoList.length == 1 ? ' opacity: 1;' : ' opacity: 0;'
|
|
|
- "
|
|
|
+ v-for="(ele, elIndex) in item.fourTableVoList"
|
|
|
+ :key="elIndex"
|
|
|
>
|
|
|
<component
|
|
|
:is="ele.enName"
|
|
@@ -187,10 +199,10 @@ export default {
|
|
|
|
|
|
this.top = JSON.parse(a)[0] + "px";
|
|
|
this.left = JSON.parse(a)[1] + "px";
|
|
|
- this.modelList = res.list;
|
|
|
- setTimeout(() => {
|
|
|
- this.setCSS(res.list);
|
|
|
- }, 1000);
|
|
|
+ this.modelList = res.list.map((e) => {
|
|
|
+ e.showIndex = 0;
|
|
|
+ return e;
|
|
|
+ });
|
|
|
if (this.$route.query.nwbg) {
|
|
|
this.background = require("@/assets/background/" +
|
|
|
this.$route.query.nwbg);
|
|
@@ -200,67 +212,32 @@ export default {
|
|
|
Message.error("请配置相关参数!");
|
|
|
}
|
|
|
},
|
|
|
- // 反转
|
|
|
- setCSS(e) {
|
|
|
- for (let i = 0; i < e.length; i++) {
|
|
|
- if (document.querySelector("#aaa" + i).children.length > 1) {
|
|
|
- let aaa = e[i];
|
|
|
-
|
|
|
- // 定时方法
|
|
|
- let count = 0;
|
|
|
- // 第一次进入
|
|
|
- if (count + 1 == document.querySelector("#aaa" + i).children.length) {
|
|
|
- count = 0;
|
|
|
- } else {
|
|
|
- count++;
|
|
|
- }
|
|
|
|
|
|
- for (
|
|
|
- let n = 0;
|
|
|
- n < document.querySelector("#aaa" + i).children.length;
|
|
|
- n++
|
|
|
- ) {
|
|
|
- document.querySelector("#aaa" + i).children[n].style.cssText =
|
|
|
- "opacity: 0;";
|
|
|
- }
|
|
|
- document.querySelector("#aaa" + i).children[count].style.cssText =
|
|
|
- "opacity: 1;transition: all 2s;";
|
|
|
- time();
|
|
|
- function time() {
|
|
|
- let times = 15;
|
|
|
- if (
|
|
|
- JSON.parse(aaa.fourTableVoList[count].config).showtime &&
|
|
|
- JSON.parse(aaa.fourTableVoList[count].config).showtime != ""
|
|
|
- ) {
|
|
|
- times = JSON.parse(aaa.fourTableVoList[count].config).showtime;
|
|
|
- }
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- if (
|
|
|
- count + 1 ==
|
|
|
- document.querySelector("#aaa" + i).children.length
|
|
|
- ) {
|
|
|
- count = 0;
|
|
|
- } else {
|
|
|
- count++;
|
|
|
- }
|
|
|
-
|
|
|
- for (
|
|
|
- let n = 0;
|
|
|
- n < document.querySelector("#aaa" + i).children.length;
|
|
|
- n++
|
|
|
- ) {
|
|
|
- document.querySelector("#aaa" + i).children[n].style.cssText =
|
|
|
- "opacity: 0;transform:rotateY(-180deg);transition: all 1s;";
|
|
|
- }
|
|
|
- document.querySelector("#aaa" + i).children[count].style.cssText =
|
|
|
- "opacity: 1; transform:rotateY(0);transition: all 1s;";
|
|
|
+ chageL(index, showIndex) {
|
|
|
+ let now = showIndex;
|
|
|
+ let length = this.modelList[index].fourTableVoList.length;
|
|
|
+ if (showIndex > 0) {
|
|
|
+ now--;
|
|
|
+ } else {
|
|
|
+ now = length - 1;
|
|
|
+ }
|
|
|
+ console.log(this.modelList[index].fourTableVoList[now])
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ this.modelList[index].showIndex = now;
|
|
|
+ // });
|
|
|
+ },
|
|
|
|
|
|
- time();
|
|
|
- }, times * 1000);
|
|
|
- }
|
|
|
- }
|
|
|
+ chageR(index, showIndex) {
|
|
|
+ let now = showIndex;
|
|
|
+ let length = this.modelList[index].fourTableVoList.length;
|
|
|
+ if (showIndex < length - 1) {
|
|
|
+ now++;
|
|
|
+ } else {
|
|
|
+ now = 0;
|
|
|
}
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ this.modelList[index].showIndex = now;
|
|
|
+ // });
|
|
|
},
|
|
|
|
|
|
backDown(e) {
|
|
@@ -300,6 +277,7 @@ export default {
|
|
|
body {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ user-select: none;
|
|
|
}
|
|
|
#home {
|
|
|
// width: 100vw;
|
|
@@ -314,7 +292,54 @@ body {
|
|
|
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ opacity: 0;
|
|
|
+ transform: rotateY(90deg);
|
|
|
+ animation: setChange 2s forwards;
|
|
|
}
|
|
|
+
|
|
|
+ @keyframes setChange {
|
|
|
+ 0% {
|
|
|
+ opacity: 0;
|
|
|
+ transform: rotateY(90deg);
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ opacity: 1;
|
|
|
+ transform: rotateY(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.control-left,
|
|
|
+.control-right {
|
|
|
+ position: absolute;
|
|
|
+ top: calc(50% - 15px);
|
|
|
+ z-index: 99999999999;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 50%;
|
|
|
+ color: rgba(255, 255, 255, 0.5);
|
|
|
+ font-size: 15px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: rgba(255, 255, 255, 0.1);
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.35s;
|
|
|
+ user-select: none;
|
|
|
+}
|
|
|
+
|
|
|
+.control-left {
|
|
|
+ left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.control-right {
|
|
|
+ right: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.control-left:hover,
|
|
|
+.control-right:hover {
|
|
|
+ color: #417dff;
|
|
|
+ background: #ffffff;
|
|
|
}
|
|
|
|
|
|
.back {
|