Browse Source

修复fix问题

martin.ma 3 years ago
parent
commit
d620dc60bd
3 changed files with 18 additions and 5 deletions
  1. 10 2
      assets/css/frontend/personal.scss
  2. 1 1
      layouts/header-fix.vue
  3. 7 2
      pages/frontend/personal/index.vue

+ 10 - 2
assets/css/frontend/personal.scss

@@ -6,6 +6,7 @@
   min-width: auto;
   display: block!important;
   width:100%!important;
+  margin-top: 20px!important;
   .personal-side{
     display: none;
   }
@@ -357,6 +358,13 @@
 .ad-item{
   // margin:16px;
   display:block;
-  width: 100%;
-  height: 100%;
+  // width: 100%;
+  // height: 100%;
+  padding-bottom: 75%;
+  // width:318px;
+  // height:233px;
+  background-size: cover;
+  background-position: center;
+  background-repeat: no-repeat;
+  margin-bottom: 10px;
 }

+ 1 - 1
layouts/header-fix.vue

@@ -91,7 +91,7 @@
     min-height: calc(100vh - 376px);
     margin:0 30px !important;
     margin-bottom: 30px !important;
-    margin-top: 20px !important;
+    margin-top: 85px !important;
   }
   .ma-header-fix{
     position:fixed!important;

+ 7 - 2
pages/frontend/personal/index.vue

@@ -110,8 +110,13 @@
         </div>
 
         <div class="personal-ad-container">
-            <a class="ad-item" v-for="(item, index) in adList" :key="index" :href="item.url" target="view_window">
-                <el-image style="width:318px;height:233px" fit="cover" :src="item.image"></el-image>
+            <a
+              class="ad-item"
+              v-for="(item, index) in adList"
+              :key="index"
+              target="view_window"
+              :style="{ backgroundImage: 'url(' + item.image + ')' }"
+            >
             </a>
         </div>
     </div>