From 149ca94b739f7f2286a502c1dc6627817a43f2a5 Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期一, 08 八月 2022 18:02:46 +0800
Subject: [PATCH] 修改readme
---
src/views/notice.vue | 147 +++++++++++++++++++++++++++++-------------------
1 files changed, 89 insertions(+), 58 deletions(-)
diff --git a/src/views/notice.vue b/src/views/notice.vue
index c9dd9e3..22659f8 100644
--- a/src/views/notice.vue
+++ b/src/views/notice.vue
@@ -1,57 +1,82 @@
<template>
<div>
- <el-row type="flex" class="row-bg underline" justify="space-between">
- <span>閫氱煡鍏憡</span>
- <span @click="goMore('閫氱煡鍏憡')" class="liPointer">
- 鏇村<i class="el-icon-d-arrow-right"></i>
- </span>
+ <!-- 閫氱煡鍏憡瀵艰埅鏉� -->
+ <el-row type="flex" class="row-bg underline marb10" justify="space-between">
+ <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: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.date }}</span>
- <span>{{ item.years }}</span>
+ {{ item.releaseTime }}
</div>
- <div class="title" @click="toNoticeMsg(item.title)">{{ item.title }}</div>
+ <div class="title" @click="toNoticeMsg(item.id)">
+ {{ item.title }}
+ </div>
</li>
</ul>
</div>
</div>
</template>
<script>
+import axios from 'axios'
+import { getMinTitle, getNewsList } from '../api/api'
export default {
- name:'notice',
- data(){
- return{
- noticeList:[
- {years:'2021',date:'11-2',title:'鎴戞槸鏍囬1'},
- {years:'2021',date:'11-2',title:'鎴戞槸鏍囬2'},
- {years:'2021',date:'11-2',title:'鎴戞槸鏍囬3'},
- {years:'2021',date:'11-2',title:'鎴戞槸鏍囬4'},
- {years:'2021',date:'11-2',title:'鎴戞槸鏍囬5'},
-
- ]
+ name: 'notice',
+ data() {
+ return {
+ noticeList: []
}
},
- methods:{
- toNoticeMsg(t){
+ created() {},
+ 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() {
+ const data = {
+ current: 1,
+ newsCategoryId: 42,
+ size: 6
+ }
+ getNewsList(data)
+ .then(res => {
+ console.log(res)
+ if (res.code == 200) {
+ this.noticeList = res.data.records
+ }
+ })
+ .catch(error => {
+ console.log(error)
+ })
+ },
+ // 鍘诲埌鏂伴椈灞曠ず椤�
+ toNoticeMsg(id) {
this.$router.push({
- path:'/home/noticeMessage',
- query:{
- title:t
+ path: '/home/news',
+ query: {
+ id: id
}
})
},
- goMore(val){
+ //鍘诲埌鏇村鏂伴椈鍒楄〃椤�
+ goMore(val) {
this.$router.push({
- path:'/home/moreMessage',
- query:{
- type:val,
+ path: '/home/moreMessage',
+ query: {
+ type: val
}
})
}
@@ -59,27 +84,33 @@
}
</script>
<style lang="less" scoped>
- .underline{
- border-bottom: 1px solid #0f99e9;
- }
- .lieBiao{
- width: 95%;
- height: 80px;
- background: rgb(202, 202, 202);
- display: flex;
- justify-content: space-between;
- overflow: hidden;
- margin-bottom: 10px;
- }
- .time{
- width: 100px;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .title{
- width: 500px;
- height: 70px;
- overflow: hidden;
- }
-</style>
\ No newline at end of file
+.underline {
+ border-bottom: 1px solid rgb(1, 72, 153);
+}
+.lieBiao {
+ width: 100%;
+ height: 55px;
+ background: rgb(241, 241, 241);
+ display: flex;
+ justify-content: space-between;
+ overflow: hidden;
+ margin-bottom: 10px;
+}
+.time {
+ width: 100px;
+ padding: 17px 0px;
+ display: flex;
+ flex-direction: column;
+ background-color: rgb(1, 72, 153);
+ color: white;
+ text-align: center;
+}
+.title {
+ width: 500px;
+ height: 50px;
+ overflow: hidden;
+ line-height: 50px;
+ // background-color: rgb(179, 19, 19);
+ padding: 0 0 0 10px;
+}
+</style>
--
Gitblit v1.8.0