Browse Source

修改图片跳转地址,修改横幅适配

asd123a20 1 year ago
parent
commit
0fff968aea
2 changed files with 16 additions and 2 deletions
  1. 9 0
      src/assets/index.scss
  2. 7 2
      src/views/Home.vue

+ 9 - 0
src/assets/index.scss

@@ -95,6 +95,9 @@ html, body, #app{
     }
   }
   .home {
+    .hfbox {
+      width: 70% !important;
+    }
     .listBox {
       width: 70% !important;
     }
@@ -119,6 +122,9 @@ html, body, #app{
       }
     }
     .home {
+      .hfbox {
+        width: 80% !important;
+      }
       .listBox {
         width: 80% !important;
       }
@@ -174,6 +180,9 @@ html, body, #app{
       }
     }
     .home {
+      .hfbox {
+        width: 95% !important;
+      }
       .listBox {
         width: 95% !important;
       }

+ 7 - 2
src/views/Home.vue

@@ -2,7 +2,7 @@
   <div class="home">
     <el-carousel height="100px" class="hfbox" direction="vertical" autoplay :interval="3000">
       <el-carousel-item>
-        <a class="hf" @click="imgClick('ztjy1', '02')">
+        <a class="hf" @click="imgClick('ztjy')">
           <img src="../assets/hf1.jpg" class="hfimg">
         </a>
       </el-carousel-item>
@@ -12,7 +12,7 @@
         </a>
       </el-carousel-item>
       <el-carousel-item>
-        <a class="hf" @click="imgClick('ztjy1', '02')">
+        <a class="hf" @click="imgClick('ztjy')">
           <img src="../assets/hf1.jpg" class="hfimg">
         </a>
       </el-carousel-item>
@@ -175,6 +175,11 @@ export default {
     },
     // 图片点击
     imgClick(code, parentCode) {
+      if (code == 'ztjy') {
+        const routeUrl = this.$router.resolve(`/templates/ztjy/${code}`);
+        window.open(routeUrl.href, '_blank');
+        return;
+      }
       const item = this.$last({ menus: this.menusall, code: code });
       this.$setParentsetSession({ menus: this.menusall, iscode: item });
       this.$router.push(`/list/${code}?parentCode=${parentCode}`);