From b80d0c5dd5ca242427a07f4891e8a0dc354889b3 Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期三, 19 一月 2022 23:46:29 +0800 Subject: [PATCH] 后台查看功能完成 --- src/views/school.vue | 32 +++++++++++++------------------- 1 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/views/school.vue b/src/views/school.vue index 8515aee..58963fb 100644 --- a/src/views/school.vue +++ b/src/views/school.vue @@ -9,10 +9,8 @@ <div style="max-height:420px;overflow:hidden;"> <ul> <li :key="index" v-for="(item, index) in schoolList" class="liPointer"> - <!-- <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)" class="bgc mart10"> - {{ item.news }} + <div @click="toSchoolMsg(item.id)" class="bgc mart10"> + {{ item.title }} </div> </li> </ul> @@ -25,11 +23,7 @@ name: 'school', data() { return { - schoolList: [{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:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}], + schoolList: [], } }, created() { @@ -38,17 +32,17 @@ methods:{ getnews(){ const data = { - categoryId: 1, - contypeId: 2, - p: 0 - } + current:1, + newsCategoryId:44, + size:6 + } getNewsList(data).then(res => { - console.log('res',res); + console.log(res); if(res.code == 200){ this.schoolList = res.data.records } - }).catch(err => { - console.log('err',err); + }).catch(error => { + console.log(error); }) }, //鍓嶅線鏇村淇℃伅椤甸潰 @@ -61,11 +55,11 @@ }) }, //鍓嶅線淇℃伅灞曠ず椤甸潰 - toSchoolMsg(t) { + toSchoolMsg(id) { this.$router.push({ - path: 'schoolMessage', + path: '/home/news', query: { - title:t + id:id } }) } -- Gitblit v1.8.0