From ddfc75ed45d427bb8b407133b5e2bde0e6ec581a Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期六, 22 一月 2022 16:22:45 +0800 Subject: [PATCH] 新闻查询功能完毕 --- src/views/homePage/moreMessage.vue | 68 +++++++++++++++++++++------------- 1 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/views/homePage/moreMessage.vue b/src/views/homePage/moreMessage.vue index 88b6789..43978e9 100644 --- a/src/views/homePage/moreMessage.vue +++ b/src/views/homePage/moreMessage.vue @@ -17,14 +17,14 @@ </li> </ul> <!-- 鍒嗛〉 --> - <div class="fenye"> + <div> <el-pagination background - @current-change="handleCurrentChange" - :current-page.sync="currentPage" + @current-change="handleCurrentChange1" + :current-page="currentPagenotice" :page-size="pageSize" layout="prev, pager, next,total" - :total="total"> + :total="totalnotice"> </el-pagination> </div> </el-card> @@ -43,14 +43,14 @@ </li> </ul> <!-- 鍒嗛〉 --> - <div class="fenye"> + <div> <el-pagination background - @current-change="handleCurrentChange" - :current-page.sync="currentPage" + @current-change="handleCurrentChange2" + :current-page.sync="currentPageschool" :page-size="pageSize" layout="prev, pager, next,total" - :total="total"> + :total="totalschool"> </el-pagination> </div> </el-card> @@ -70,14 +70,14 @@ </li> </ul> <!-- 鍒嗛〉 --> - <div class="fenye"> + <div> <el-pagination background - @current-change="handleCurrentChange" - :current-page.sync="currentPage" + @current-change="handleCurrentChange3" + :current-page.sync="currentPagework" :page-size="pageSize" layout="prev, pager, next,total" - :total="total"> + :total="totalwork"> </el-pagination> </div> </el-card> @@ -95,9 +95,13 @@ noticeList: [], schoolList: [], workList: [], - currentPage:1, + currentPagenotice:1, //閫氱煡鍏憡鐨勫綋鍓嶉〉 + currentPageschool:1, //瀛﹂櫌鍔ㄦ�佺殑褰撳墠椤� + currentPagework:1, //宸ヤ綔鍔ㄦ�佺殑褰撳墠椤� pageSize:4, - total:0, + totalnotice:0, //閫氱煡鍏憡鏂伴椈鐨勬�绘潯鏁� + totalschool:0, //瀛﹂櫌鍔ㄦ�佹柊闂荤殑鎬绘潯鏁� + totalwork:0, //宸ヤ綔鍔ㄦ�佹柊闂荤殑鎬绘潯鏁� } }, mounted(){ @@ -106,24 +110,36 @@ this.getschool(); }, methods: { - handleCurrentChange(val){ - console.log(`褰撳墠椤�: ${val}`); + //閫氱煡鍏憡鐨勫垎椤靛垏鎹� + handleCurrentChange1(val){ + // console.log(`褰撳墠椤�: ${val}`); + this.currentPagenotice = val; this.getnotice(); - this.getwork(); + }, + //瀛﹂櫌鍔ㄦ�佺殑鍒嗛〉鍒囨崲 + handleCurrentChange2(val){ + // console.log(`褰撳墠椤�: ${val}`); + this.currentPageschool = val; this.getschool(); + }, + //宸ヤ綔鍔ㄦ�佺殑鍒嗛〉鍒囨崲 + handleCurrentChange3(val){ + // console.log(`褰撳墠椤�: ${val}`); + this.currentPagework = val; + this.getwork(); }, //鑾峰彇鏂伴椈鍒楄〃 getnotice(){ const data = { - current:this.currentPage, + current:this.currentPagenotice, newsCategoryId:42, size:this.pageSize } getNewsList(data).then(res => { - console.log(res); + // console.log(res); if(res.code == 200){ this.noticeList = res.data.records - this.total = Number(res.data.total) + this.totalnotice = res.data.total } }).catch(error => { console.log(error); @@ -131,15 +147,15 @@ }, getwork(){ const data = { - current:this.currentPage, + current:this.currentPagework, newsCategoryId:43, size:this.pageSize } getNewsList(data).then(res => { - console.log(res); + // console.log(res); if(res.code == 200){ this.workList = res.data.records - this.total = Number(res.data.total) + this.totalwork = Number(res.data.total) } }).catch(error => { console.log(error); @@ -147,15 +163,15 @@ }, getschool(){ const data = { - current:this.currentPage, + current:this.currentPageschool, newsCategoryId:44, size:this.pageSize } getNewsList(data).then(res => { - console.log(res); + // console.log(res); if(res.code == 200){ this.schoolList = res.data.records - this.total = Number(res.data.total) + this.totalschool = Number(res.data.total) } }).catch(error => { console.log(error); -- Gitblit v1.8.0