From a112e96ab559adc810ae043a145fd898548725f7 Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期二, 09 八月 2022 09:45:53 +0800
Subject: [PATCH] 完善Readme
---
src/views/school.vue | 64 ++++++++++++++-----------------
1 files changed, 29 insertions(+), 35 deletions(-)
diff --git a/src/views/school.vue b/src/views/school.vue
index 8515aee..53eadc8 100644
--- a/src/views/school.vue
+++ b/src/views/school.vue
@@ -2,17 +2,13 @@
<div>
<el-row type="flex" justify="space-between" class="underline">
<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: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>
@@ -20,52 +16,50 @@
</div>
</template>
<script>
-import {getNewsList} from '../api/api'
+import { getNewsList } from '../api/api'
export default {
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() {
this.getnews()
},
- methods:{
- getnews(){
+ methods: {
+ getnews() {
const data = {
- categoryId: 1,
- contypeId: 2,
- p: 0
- }
- getNewsList(data).then(res => {
- console.log('res',res);
- if(res.code == 200){
- this.schoolList = res.data.records
- }
- }).catch(err => {
- console.log('err',err);
- })
+ 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){
+ 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
}
})
}
@@ -92,4 +86,4 @@
height: 55px;
line-height: 55px;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0