Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-site
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张冬
web-site
Commits
10f59b59
Commit
10f59b59
authored
Sep 22, 2020
by
吴冠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
信息公告
parent
a5efd63f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
list.js
common/list.js
+1
-1
index.vue
pages/index/index.vue
+3
-4
news.vue
pages/index/message/news.vue
+25
-15
No files found.
common/list.js
View file @
10f59b59
...
...
@@ -124,7 +124,7 @@ export function getListContent(params){
})
}
//文章列表首页
export
function
getListS
SS
(
params
){
export
function
getListS
ite
(
params
){
return
request
({
url
:
"/news/list-content"
,
method
:
'get'
,
...
...
pages/index/index.vue
View file @
10f59b59
...
...
@@ -54,7 +54,7 @@
<
script
>
import
{
getLoopPic
}
from
'@/common/list.js'
import
{
getSecond
,
getCategoryList
,
getListS
SS
}
from
'@/common/list.js'
import
{
getSecond
,
getCategoryList
,
getListS
ite
}
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
getListS
SS
(){
async
getListS
ite
(){
let
message
=
{}
message
.
cateId
=
this
.
id
const
{
data
}
=
await
getListS
SS
(
message
)
const
{
data
}
=
await
getListS
ite
(
message
)
console
.
log
(
data
,
'++++++++++++++++++++++++'
)
this
.
dynamicList
.
list
=
data
},
...
...
pages/index/message/news.vue
View file @
10f59b59
...
...
@@ -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
:
11
0
px
;
left
:
11
5
px
;
width
:
750px
}
...
...
@@ -146,7 +156,7 @@ import {
width
:
2.4rem
;
border
:
1px
solid
rgba
(
219
,
219
,
219
,
1
);
position
:
absolute
;
left
:
-21
6
px
left
:
-21
7
px
}
.el-menu
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment