From 6cf9fe5c9eb7dc664b7a64454cd327d08baf1a93 Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期一, 15 八月 2022 16:51:26 +0800
Subject: [PATCH] 更新sql文件

---
 src/views/notice.vue |   78 ++++++++++++++++++++------------------
 1 files changed, 41 insertions(+), 37 deletions(-)

diff --git a/src/views/notice.vue b/src/views/notice.vue
index 2c73869..22659f8 100644
--- a/src/views/notice.vue
+++ b/src/views/notice.vue
@@ -3,20 +3,17 @@
     <!-- 閫氱煡鍏憡瀵艰埅鏉� -->
     <el-row type="flex" class="row-bg underline marb10" justify="space-between">
       <span class="color"><b>閫氱煡鍏憡</b></span>
-      <span @click="goMore('閫氱煡鍏憡')" class="liPointer">
-        鏇村<i class="el-icon-d-arrow-right"></i>
-      </span>
+      <span @click="goMore('閫氱煡鍏憡')" class="liPointer"> 鏇村<i class="el-icon-d-arrow-right"></i> </span>
     </el-row>
     <!-- 閫氱煡鍏憡鏂伴椈鍒楄〃 -->
     <div style="max-height:382px;overflow:hidden;">
       <ul>
         <li class="lieBiao liPointer" :key="index" v-for="(item, index) in noticeList">
           <div class="time">
-            <span>{{ item.year }}</span>
-            <span>{{ item.month }}</span>
+            {{ item.releaseTime }}
           </div>
-          <div class="title" @click="toNoticeMsg(item.id,item.count)">
-            {{ item.news }}
+          <div class="title" @click="toNoticeMsg(item.id)">
+            {{ item.title }}
           </div>
         </li>
       </ul>
@@ -24,45 +21,53 @@
   </div>
 </template>
 <script>
-import {getNewsList} from '../api/api'
+import axios from 'axios'
+import { getMinTitle, getNewsList } from '../api/api'
 export default {
   name: 'notice',
   data() {
     return {
-     noticeList: [{id:1,year: 2022,month:'1-10',count:10, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:2,year: 2022,month:'1-10',count:11, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},
-      {id:3,year: 2022,month:'1-10',count:12, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:4,year: 2022,month:'1-10',count:13, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},
-      {id:5,year: 2022,month:'1-10',count:14, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:14, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},
-      {id:6,year: 2022,month:'1-10',count:15, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:16, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},
-      {id:6,year: 2022,month:'1-10',count:16, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:17, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}],
+      noticeList: []
     }
   },
-  created() {
-    this.getnews();
+  created() {},
+  mounted() {
+    //鑾峰彇灏忔爣棰�
+    // axios.get('http://localhost:8080/news_category/list/1').then(res => {
+    //   console.log(res);
+    //   if(res.status==200){
+    //     this.noticeList = res.data.data
+    //   }
+    // }).catch(err => {
+    //   console.log(err);
+    // })
+    this.getnews()
   },
   methods: {
     //鑾峰彇鏂伴椈鍒楄〃
     getnews() {
       const data = {
-        categoryId: 1,//灏忔爣棰業D
-        contypeId: 2,//澶ф爣棰業D
-        p: 0//褰撳墠椤�
-      };
-      getNewsList(data).then(res => {
-        console.log('res',res);
-        if(res.code == 200){
-          this.noticeList = res.data.records
-        }
-      }).catch(err => {
-        console.log('err',err);
-      })
+        current: 1,
+        newsCategoryId: 42,
+        size: 6
+      }
+      getNewsList(data)
+        .then(res => {
+          console.log(res)
+          if (res.code == 200) {
+            this.noticeList = res.data.records
+          }
+        })
+        .catch(error => {
+          console.log(error)
+        })
     },
     // 鍘诲埌鏂伴椈灞曠ず椤�
-    toNoticeMsg(id,count) {
+    toNoticeMsg(id) {
       this.$router.push({
-        path: '/home/noticeMessage',
+        path: '/home/news',
         query: {
-          id:id,
-          count:count
+          id: id
         }
       })
     },
@@ -83,7 +88,7 @@
   border-bottom: 1px solid rgb(1, 72, 153);
 }
 .lieBiao {
-  width: 95%;
+  width: 100%;
   height: 55px;
   background: rgb(241, 241, 241);
   display: flex;
@@ -92,12 +97,10 @@
   margin-bottom: 10px;
 }
 .time {
-  width: 80px;
-  overflow: hidden;
+  width: 100px;
+  padding: 17px 0px;
   display: flex;
-  // line-height: 20px;
   flex-direction: column;
-  padding: 8px;
   background-color: rgb(1, 72, 153);
   color: white;
   text-align: center;
@@ -107,6 +110,7 @@
   height: 50px;
   overflow: hidden;
   line-height: 50px;
+  // background-color: rgb(179, 19, 19);
   padding: 0 0 0 10px;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0