wxy 4 年之前
父节点
当前提交
f29f6473ed
共有 1 个文件被更改,包括 16 次插入3 次删除
  1. 16 3
      src/views/channel/index.vue

+ 16 - 3
src/views/channel/index.vue

@@ -9,8 +9,12 @@
           <el-col :span="24" class="con">
             <el-col :span="24" class="list" v-for="(item, index) in lists" :key="index">
               <el-col :span="11" class="video">
-                <video :src="item.videodata[0].url" controls style="width:100%;height:100%"></video>
-                <!-- <el-col :span="24" v-else style="width:100%;height:100%;background:gray"></el-col> -->
+                <el-image :src="item.image_path" style="width:100%;height:100%;border-radius: 10px;" v-if="item.image_path"></el-image>
+                <el-image v-else style="width:100%;height:100%">
+                  <div slot="error" class="image-slot">
+                    <el-image :src="url1" style="width:100%;height:100%;border-radius: 10px;"></el-image>
+                  </div>
+                </el-image>
               </el-col>
               <el-col :span="13" class="text">
                 <el-col :span="24" class="title">{{ item.title }}</el-col>
@@ -49,6 +53,7 @@ export default {
       navShow: true,
       //列表
       lists: [],
+      url1: require('@/assets/222.png'),
     };
   },
   created() {
@@ -102,11 +107,17 @@ export default {
       margin: 0 0 10px 0;
       .video {
         height: 100%;
+        .el-image {
+          /deep/.image-slot {
+            width: 100%;
+            height: 100%;
+          }
+        }
       }
       .text {
         padding-left: 15px;
         .title {
-          font-size: 18px;
+          font-size: 16px;
           font-weight: bolder;
           overflow: hidden;
           text-overflow: ellipsis;
@@ -119,9 +130,11 @@ export default {
           display: -webkit-box;
           -webkit-line-clamp: 2;
           -webkit-box-orient: vertical;
+          font-size: 12px;
         }
         .time {
           margin-top: 9px;
+          font-size: 12px;
         }
       }
     }