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

信息公告

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