Kaynağa Gözat

页面效果更新

guhongwei 5 yıl önce
ebeveyn
işleme
a23945ee0a

+ 1 - 1
src/components/index.vue

@@ -37,7 +37,7 @@
             </el-col>
           </el-col>
           <el-col :span="24" class="main_3">
-            <weilai :pic="info.advert"></weilai>
+            <weilai :pic="info.advert" :advertlink="info.advertlink"></weilai>
           </el-col>
           <el-col :span="24" class="main_4">
             <el-col :span="11" class="service">

+ 1 - 3
src/layout/detail/contInfo.vue

@@ -20,9 +20,7 @@
           </el-col>
           <el-col :span="24" class="fenTime">
             <el-col :span="4" class="date">信息来源:{{ contInfos.origin }} </el-col>
-            <el-col :span="15" class="date">
-              发布时间:{{ contInfos.meta && contInfos.meta.createdAt ? new Date(contInfos.meta.createdAt).toLocaleDateString() : '' || '' }}
-            </el-col>
+            <el-col :span="15" class="date"> 发布时间: {{ contInfos.publish_time }}</el-col>
             <el-col :span="5" class="fenxiang">
               <share></share>
             </el-col>

+ 1 - 3
src/layout/detail/detail.vue

@@ -22,9 +22,7 @@
           <el-col :span="24" class="title">
             <p>{{ detailInfo.title }}</p>
           </el-col>
-          <el-col :span="24" class="date">
-            发布时间: {{ detailInfo.meta && detailInfo.meta.createdAt ? new Date(detailInfo.meta.createdAt).toLocaleDateString() : '' || '' }}</el-col
-          >
+          <el-col :span="24" class="date"> 发布时间: {{ detailInfo.publish_time }}</el-col>
           <el-col :span="24" class="content">
             <p v-html="detailInfo.content"></p>
           </el-col>

+ 1 - 1
src/layout/index/noticeNews.vue

@@ -18,7 +18,7 @@
               <p class="textOver"><i class="el-icon-caret-right icon"></i>{{ item.title }}</p>
             </el-col>
             <el-col :span="5" class="date">
-              {{ item.meta | getDate }}
+              {{ item.publish_time }}
             </el-col>
           </el-col>
         </el-col>

+ 4 - 1
src/layout/index/weilai.vue

@@ -2,7 +2,9 @@
   <div id="weilai">
     <el-row>
       <el-col :span="24" class="image">
-        <el-image style="width:100%;height:200px;" :src="pic ? pic : url"></el-image>
+        <el-link :underline="false" :href="advertlink">
+          <el-image style="width:100%;height:200px;" :src="pic ? pic : url"></el-image>
+        </el-link>
       </el-col>
     </el-row>
   </div>
@@ -12,6 +14,7 @@
 export default {
   name: 'weilai',
   props: {
+    advertlink: null,
     pic: null,
   },
   components: {},

+ 10 - 5
src/layout/list/newsInfo.vue

@@ -24,15 +24,12 @@
                 <el-col :span="20" class="title" @click.native="turnTo(item)">
                   <p class="textOver">{{ item.title }}</p>
                 </el-col>
-                <el-col :span="4" class="date" v-if="item.publish_time">
+                <el-col :span="4" class="date">
                   {{ item.publish_time }}
                 </el-col>
-                <el-col :span="4" class="date" v-else>
-                  {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
-                </el-col>
               </el-col>
             </el-col>
-            <el-col :span="17" class="content" v-html="item.content"> </el-col>
+            <el-col :span="20" class="content textOvers">{{ item.abstract }} </el-col>
           </el-col>
         </el-col>
       </el-col>
@@ -85,6 +82,14 @@ p {
   text-overflow: ellipsis;
   white-space: nowrap;
 }
+.textOvers {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  -webkit-line-clamp: 2;
+  word-break: break-all;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+}
 .listRight {
   height: 930px;
   border-left: 1px solid;

+ 9 - 8
src/views/index.vue

@@ -258,17 +258,18 @@ export default {
         modules = modules.map(item => {
           let children = result.filter(fil => fil.parent_id === item.id);
           item.children = children;
-          for (const sc of item.children) {
-            let schildren = _.get(sc, `children`, []);
-            sc.children = _.sortBy(schildren, i => {
-              return new Date(_.get(i, `meta.createdA`)).getTime();
-            });
-            sc.children = sc.children.filter(f => f.is_use === '0');
-          }
+          // for (const sc of item.children) {
+          //   let schildren = _.get(sc, `children`, []);
+          //   sc.children = _.reverse(
+          //     _.sortBy(schildren, i => {
+          //       return new Date(_.get(i, `publish_time`)).getTime();
+          //     })
+          //   );
+          //   sc.children = sc.children.filter(f => f.is_use === '0');
+          // }
           // if (item.is_use === '0') {
           this.$set(this, `${item.category}List`, item);
           // }
-
           return item;
         });
       }