From ece9b6bba5a44a06041a8ad4d5f5ac1f14560d3e Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期二, 09 八月 2022 09:42:12 +0800
Subject: [PATCH] 完善Readme

---
 src/views/school.vue |   71 +++++++++++++++++++++++------------
 1 files changed, 46 insertions(+), 25 deletions(-)

diff --git a/src/views/school.vue b/src/views/school.vue
index 943af48..53eadc8 100644
--- a/src/views/school.vue
+++ b/src/views/school.vue
@@ -1,49 +1,65 @@
 <template>
   <div>
     <el-row type="flex" justify="space-between" class="underline">
-      <span>瀛﹂櫌鍔ㄦ��</span>
-      <span @click="goMore('瀛﹂櫌鍔ㄦ��')">鏇村<i class="el-icon-d-arrow-right"></i> </span>
+      <span class="color"><b>瀛﹂櫌鍔ㄦ��</b></span>
+      <span @click="goMore('瀛﹂櫌鍔ㄦ��')" class="liPointer">鏇村<i class="el-icon-d-arrow-right"></i> </span>
     </el-row>
-    <div>
+    <div style="max-height:420px;overflow:hidden;">
       <ul>
-        <li :key="index" v-for="(item, index) in schoolList">
-          <!-- <a href="item.path"> {{ item.title }} </a> -->
-          <!-- <router-link :to="{name:'schoolMessage',params:{id:item.id}}" >{{ item.title }} </router-link> -->
-          <div @click="toSchoolMsg(item.title)"> {{ item.title }} </div>
+        <li :key="index" v-for="(item, index) in schoolList" class="liPointer">
+          <div @click="toSchoolMsg(item.id)" class="bgc mart10">
+            {{ item.title }}
+          </div>
         </li>
       </ul>
     </div>
   </div>
 </template>
 <script>
+import { getNewsList } from '../api/api'
 export default {
   name: 'school',
   data() {
     return {
-      schoolList: [
-        { id: '1',title: '瀛︽牎鐘舵��1' },
-        { id: '2',title: '瀛︽牎鐘舵��2' },
-        { id: '3',title: '瀛︽牎鐘舵��3' },
-        { id: '4',title: '瀛︽牎鐘舵��4' },
-        { id: '5',title: '瀛︽牎鐘舵��5' },
-        { id: '6',title: '瀛︽牎鐘舵��6' }
-      ]
+      schoolList: []
     }
   },
-  methods:{
-    goMore(val){
+  created() {
+    this.getnews()
+  },
+  methods: {
+    getnews() {
+      const data = {
+        current: 1,
+        newsCategoryId: 44,
+        size: 6
+      }
+      getNewsList(data)
+        .then(res => {
+          console.log(res)
+          if (res.code == 200) {
+            this.schoolList = res.data.records
+          }
+        })
+        .catch(error => {
+          console.log(error)
+        })
+    },
+    //鍓嶅線鏇村淇℃伅椤甸潰
+    goMore(val) {
       this.$router.push({
-        path:'moreMessage',
-        query:{
-          type:val,
+        path: 'moreMessage',
+        query: {
+          type: val
         }
       })
     },
-    toSchoolMsg(t) {
+    //鍓嶅線淇℃伅灞曠ず椤甸潰
+    toSchoolMsg(id) {
       this.$router.push({
-        path: 'schoolMessage',
+        path: '/home/news',
         query: {
-          title:t
+          id: id
         }
       })
     }
@@ -52,7 +68,7 @@
 </script>
 <style lang="less" scoped>
 .underline {
-  border-bottom: 1px solid rgb(0, 110, 215);
+  border-bottom: 1px solid rgb(1, 72, 153);
 }
 ul {
   padding-left: 0;
@@ -65,4 +81,9 @@
 a {
   text-decoration: none;
 }
-</style>
\ No newline at end of file
+.bgc {
+  background: rgb(241, 241, 241);
+  height: 55px;
+  line-height: 55px;
+}
+</style>

--
Gitblit v1.8.0