Commit 10f59b59 authored by 吴冠's avatar 吴冠

信息公告

parent a5efd63f
......@@ -124,7 +124,7 @@ export function getListContent(params){
})
}
//文章列表首页
export function getListSSS(params){
export function getListSite(params){
return request({
url:"/news/list-content",
method:'get',
......
......@@ -54,7 +54,7 @@
<script>
import {getLoopPic} from '@/common/list.js'
import {getSecond,getCategoryList,getListSSS} from '@/common/list.js'
import {getSecond,getCategoryList,getListSite} from '@/common/list.js'
export default {
/* computed:{
//取出特定的三项值
......@@ -67,7 +67,6 @@ import {getSecond,getCategoryList,getListSSS} from '@/common/list.js'
this.getSecond()
//文章列表
this.getCategoryList()
this.getListSSS()
},
methods:{
async getCategoryList(){
......@@ -75,10 +74,10 @@ import {getSecond,getCategoryList,getListSSS} from '@/common/list.js'
this.dynamicList = data
console.log(data,'-------------')
},
async getListSSS(){
async getListSite(){
let message = {}
message.cateId = this.id
const {data} = await getListSSS(message)
const {data} = await getListSite(message)
console.log(data,'++++++++++++++++++++++++')
this.dynamicList.list = data
},
......
......@@ -5,7 +5,7 @@
<el-col :span="12">
<el-menu :default-active="activeName" class="el-menu-vertical-demo" v-for="item in artList" :key="item.id" @select="handleSelect"
router >
<el-menu-item :index="`?id=${item.id}`">
<el-menu-item :index="`?id=${item.id}`" class="link-sty">
<i class="el-icon-menu"></i>
<span slot="title">{{item.title}}</span>
</el-menu-item>
......@@ -14,22 +14,24 @@
</div>
<ul v-if="isList">
<li v-for="item in messageList" :key="item.id" @click="urlChage">
<nuxt-link :to="`/messsage/newsdetails?id=${item.id}`" :messageContext="item" class="flex-between">
<nuxt-link :to="`/messsage/newsdetails?id=${item.id}`" :messageContext="item" class="flex-between link-style">
<div class="t2">{{item.title}}</div>
<div class="t1">发布时间:{{item.createTime}}</div>
</nuxt-link>
</li>
</ul>
<div class="pagination flex-center" v-if="isList">
<div class="pagination" v-if="isList">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:size ="size"
layout="total, prev, pager, next, jumper"
:total="total">
</el-pagination style="postion:relative;transform:translateX(-50%)">
:total="total"
class="pageObj">
</el-pagination >
</div>
</ul>
<div v-for="item in messageList" :key="item.id" class="content" v-if="!isList">
<h1>{{item.title}}</h1>
<div class="flex">
......@@ -54,7 +56,7 @@ import {
isList:true,
activeName: '1',
conText:"",
activeIndex: '1',
activeIndex: '',
size:10,
total:0,
artId:0,
......@@ -77,11 +79,11 @@ import {
}
},
created(){
this.getCategoryList()
let message = {}
message.currentPage = 1
message.size = 10
this.getListContent(message)
this.getCategoryList()
},
methods:{
urlChage(){
......@@ -90,22 +92,21 @@ import {
handleSelect(key, keyPath) {
console.log(key, keyPath)
let keyValue = key.slice(4)
console.log(keyValue)
let message = {}
message.cateId = keyValue
this.getListContent(message)
this.getListContent(message,keyValue)
},
//分类列表
async getCategoryList(){
const {data} = await getCategoryList()
const {data,total} = await getCategoryList()
this.artList = data
},
//文章列表
// 文章列表
async getListContent(params){
const {data} = await getListContent(params)
console.log(data)
this.messageList = data
// this.contentList = data
this.total = total
},
handleSizeChange(val) {
this.getListContent(this.currentPage,val)
......@@ -118,11 +119,20 @@ import {
</script>
<style scoped>
.pagination{
position: absolute;
bottom: 5%;
left: 50%;
transform:translateX(-50%);
}
.link-sty,i{
color:blue
}
.message {
border: 1px solid rgba(219, 219, 219, 1);
height:6.98rem;
position: relative;
left:110px;
left:115px;
width:750px
}
......@@ -146,7 +156,7 @@ import {
width: 2.4rem;
border: 1px solid rgba(219, 219, 219, 1);
position: absolute;
left:-216px
left:-217px
}
.el-menu {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment