瀏覽代碼

添加作者

asd123a20 2 年之前
父節點
當前提交
fd267124a4
共有 7 個文件被更改,包括 14 次插入7 次删除
  1. 二進制
      src/assets/cg.jpg
  2. 二進制
      src/assets/xz.jpg
  3. 二進制
      src/assets/zc.jpg
  4. 3 2
      src/components/heads/index.vue
  5. 1 1
      src/components/list/threeList.vue
  6. 1 1
      src/views/Home.vue
  7. 9 3
      src/views/details.vue

二進制
src/assets/cg.jpg


二進制
src/assets/xz.jpg


二進制
src/assets/zc.jpg


+ 3 - 2
src/components/heads/index.vue

@@ -27,11 +27,12 @@ export default {
     };
   },
   async mounted() {
+    await this.websiteQuery();
     await this.imgNewsQuery();
-    this.interval = Number(this.websiteInfo.find(e => e.code == 'banner').value);
+    this.interval = Number(this.websiteInfo?.find(e => e.code == 'banner').value);
   },
   methods: {
-    ...mapActions(['imgNewsQuery'])
+    ...mapActions(['imgNewsQuery', 'websiteQuery'])
   }
 };
 </script>

+ 1 - 1
src/components/list/threeList.vue

@@ -87,7 +87,7 @@ export default {
   .titleImg {
     display: block;
     width: 100%;
-    height: 80px;
+    height: 70px;
   }
   .title {
     display: flex;

+ 1 - 1
src/views/Home.vue

@@ -198,7 +198,7 @@ export default {
       width: 100%;
       position: absolute;
       bottom: 0;
-      height: 80px;
+      height: 70px;
     }
   }
 }

+ 9 - 3
src/views/details.vue

@@ -6,7 +6,12 @@
       <h2 class="title">{{ contentsItem.title }}</h2>
       <h4 class="title" v-if="contentsItem && contentsItem.curtTitle">{{ contentsItem.curtTitle }}</h4>
       <!-- <span class="describe">{{ contentsItem.describe }}</span> -->
-      <span class="date">发表时间: {{ contentsItem.date | dates }}<span class="visit" v-if="contentsItem.source">来源: {{ contentsItem.source | source }}</span><span class="visit">访问量: {{ contentsItem.visit }}</span></span>
+      <span class="date">
+        发表时间: {{ contentsItem.date | dates }}
+        <span class="visit" v-if="contentsItem.source">来源: {{ contentsItem.source | source }}</span>
+        <span class="visit" v-if="contentsItem.author">作者 : {{ contentsItem && contentsItem.author }}</span>
+        <span class="visit">访问量: {{ contentsItem.visit }}</span>
+      </span>
       <div class="content" v-html="contentsItem.content"></div>
       <div v-if="contentsItem && contentsItem.annex">
         <a v-for="(item, index) in contentsItem.annex" :key="index" :href="item.url" :download="item.url" target="view_window">下载附件:{{ item.name }}<br/></a>
@@ -47,8 +52,9 @@ export default {
       return;
     }
     await this.contentsFetch({ id: this.id });
-    this.$refs.detailsHome.scrollIntoView(true);
     await this.sourceQuery();
+    // eslint-disable-next-line no-unused-expressions
+    if (this.$refs.detailsHome) this.$refs.detailsHome?.scrollIntoView(true);
   },
   methods: {
     ...mapActions(['contentsFetch', 'imgNewsFetch', 'sourceQuery'])
@@ -58,7 +64,7 @@ export default {
       return moment(e).format('YYYY-MM-DD');
     },
     source(code) {
-      const name = _this.dict.source.find(e => e.code == code).name;
+      const name = _this.dict?.source?.find(e => e.code == code).name;
       return name;
     }
   }