From 08e0f4f66d2e39a19b91e8e2fe1bcad75569d4b8 Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期三, 26 一月 2022 23:24:08 +0800 Subject: [PATCH] 登录权限设置好 --- src/views/notice.vue | 64 +++++++++++++++++--------------- 1 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/views/notice.vue b/src/views/notice.vue index 23c8736..907d956 100644 --- a/src/views/notice.vue +++ b/src/views/notice.vue @@ -10,17 +10,12 @@ <!-- 閫氱煡鍏憡鏂伴椈鍒楄〃 --> <div style="max-height:382px;overflow:hidden;"> <ul> - <li - class="lieBiao liPointer" - :key="index" - v-for="(item, index) in noticeList" - > + <li class="lieBiao liPointer" :key="index" v-for="(item, index) in noticeList"> <div class="time"> - <span>{{ item.contypeId }}</span> - <span>{{ item.categoryId }}</span> + {{ item.releaseTime }} </div> - <div class="title" @click="toNoticeMsg(item.title,item.id)"> - {{ item.dataString }} + <div class="title" @click="toNoticeMsg(item.id)"> + {{ item.title }} </div> </li> </ul> @@ -28,42 +23,52 @@ </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: [ - ] + noticeList: [], } }, created() { - this.getnews(); + }, + 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() { + getnews(){ const data = { - categoryId: 1,//灏忔爣棰業D - contypeId: 2,//澶ф爣棰業D - p: 0//褰撳墠椤� - }; + current:1, + newsCategoryId:42, + size:6 + } getNewsList(data).then(res => { - console.log('res',res); + console.log(res); if(res.code == 200){ this.noticeList = res.data.records } - }).catch(err => { - console.log('err',err); + }).catch(error => { + console.log(error); }) }, // 鍘诲埌鏂伴椈灞曠ず椤� - toNoticeMsg(t,id) { + toNoticeMsg(id) { this.$router.push({ - path: '/home/noticeMessage', + path: '/home/news', query: { - title: t, - id:id + id:id, } }) }, @@ -84,7 +89,7 @@ border-bottom: 1px solid rgb(1, 72, 153); } .lieBiao { - width: 95%; + width: 100%; height: 55px; background: rgb(241, 241, 241); display: flex; @@ -93,12 +98,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; @@ -108,6 +111,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 -- Gitblit v1.8.0