Преглед изворни кода

新闻。窗口办理等待情况

LiuTeng пре 7 месеци
родитељ
комит
50b57c842a
2 измењених фајлова са 32 додато и 3 уклоњено
  1. 24 2
      src/component/custom2.vue
  2. 8 1
      src/component/news.vue

+ 24 - 2
src/component/custom2.vue

@@ -9,10 +9,13 @@
           class="datas-data"
           :style="`width: ${conConfig.style.width};height: ${conConfig.style.height}`"
         >
-          <dv-water-level-pond
+          <!-- <dv-water-level-pond
             :config="item.config"
             style="width: 100%; height: 100%"
-          />
+          /> -->
+          <dv-decoration-9 style="width: 100%; height: 100%" :dur="5">
+            <div class="datas-data-value">{{ item.value }}<span>人</span></div>
+          </dv-decoration-9>
         </div>
         <div
           class="datas-name"
@@ -120,6 +123,7 @@ export default {
             this.getInfo();
           }, 10 * 1000);
         } else {
+          console.log(111,res.data)
           let data = res.data;
           if (data && data.length >= 0) {
             this.dataFormat(res.data);
@@ -183,6 +187,24 @@ export default {
 
       .datas-data {
         margin: auto;
+
+        .datas-data-value {
+          width: 100%;
+          height: 100%;
+          font-size: 20px;
+          font-weight: bold;
+          font-family: "苹方简R";
+          color: #17b978;
+          display: flex;
+          align-items: center;
+          justify-content: center;
+
+          span {
+            margin-left: 1px;
+            font-size: 12px;
+            font-weight: normal;
+          }
+        }
       }
 
       .datas-name {

+ 8 - 1
src/component/news.vue

@@ -116,6 +116,7 @@
             bodyHeight +
             'px);overflow: hidden;'
           "
+          :key="showindex"
         >
           <div id="demo1">
             <div
@@ -214,6 +215,7 @@ export default {
       bodyunitfontsize: "",
       bodyunitfontfamily: "",
       bodyunitcolor: "",
+      marqueeTimer: null,
     };
   },
   created() {
@@ -221,8 +223,9 @@ export default {
   },
   methods: {
     marquee() {
+      clearTimeout(this.marqueeTimer);
       let speed = 100;
-      setTimeout(() => {
+      this.marqueeTimer = setTimeout(() => {
         let demo = document.getElementById("demo");
         let demo1 = document.getElementById("demo1");
         let demo2 = document.getElementById("demo2");
@@ -331,6 +334,7 @@ export default {
       this.showindex = item.value;
       this.righttitle = item.name;
       this.changeTime();
+      this.marquee();
     },
     // 自动切换
     changeTime() {
@@ -343,11 +347,14 @@ export default {
         }
         this.changeIndex(this.titleData[this.showindex]);
       }, 15 * 1000);
+      this.marquee();
     },
   },
   beforeDestroy() {
+    clearTimeout(this.marqueeTimer);
     clearInterval(this.newTimer);
     clearInterval(this.changeTimer);
+    this.marqueeTimer = null;
     this.changeTimer = null;
     this.newTimer = null;
   },