Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-frontM
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
云深项目组
beyond-clouds-frontM
Commits
386cdac8
Commit
386cdac8
authored
Mar 22, 2020
by
yanju
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yoona' into 'master'
资讯列表页对接完成 See merge request
!25
parents
969158ed
d49584ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
17 deletions
+62
-17
pages/news/index.vue
+62
-17
No files found.
pages/news/index.vue
View file @
386cdac8
<
template
>
<yun-div>
<Nav
:path=
"path"
:nav-list=
"navList"
></Nav>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<project-card></project-card>
<Nav
:show-right=
"false"
:path=
"path"
:nav-list=
"navList"
></Nav>
<project-card
v-for=
"(val,index) in newsList"
:info=
"val"
:key=
"val.contentId"
></project-card>
<scroll-loading
ref=
"pagination"
:pages=
"pages"
v-on:changePage=
"changePage"
></scroll-loading>
</yun-div>
</
template
>
<
script
>
import
Nav
from
"../../components/moblie/nav"
;
import
ProjectCard
from
"../../components/moblie/projectCard"
;
import
ScrollLoading
from
"../../components/moblie/scrollLoading"
;
import
config
from
"../../action/config"
;
export
default
{
components
:
{
ProjectCard
,
Nav
},
components
:
{
ProjectCard
,
Nav
,
ScrollLoading
},
data
()
{
return
{
path
:
'/news'
,
navList
:
[
{
label
:
'新闻速递'
,
id
:
'
all
'
id
:
'
13
'
},
{
label
:
'行业资讯'
,
id
:
'1
0
'
id
:
'1
4
'
},
{
label
:
'软件更新'
,
id
:
'1
1
'
id
:
'1
7
'
}
]
],
newsList
:[],
pages
:
1
,
}
},
watch
:
{
$route
(
val
){
this
.
restartPagination
();
},
},
created
()
{
if
(
this
.
$route
.
query
.
type
)
{
return
...
...
@@ -46,9 +48,52 @@ export default {
this
.
$router
.
replace
({
path
:
'/news'
,
query
:
{
type
:
'
all
'
type
:
'
13
'
}
})
},
methods
:
{
restartPagination
(){
if
(
process
.
browser
){
this
.
newsList
=
[];
this
.
pages
=
1
;
this
.
$refs
.
pagination
.
setCurrentPage
(
1
)
}
},
handleResponse
(
currentPage
,
response
){
if
(
currentPage
===
1
){
this
.
newsList
=
response
.
data
.
dataList
;
this
.
pages
=
response
.
data
.
totalPage
;
}
else
{
response
.
data
.
dataList
.
map
((
val
,
index
)
=>
{
this
.
newsList
.
push
(
val
)
});
this
.
pages
=
response
.
data
.
totalPage
;
}
},
dataGetNewsList
(
currentPage
){
let
params
=
{
page
:
currentPage
,
size
:
12
,
type
:
1
};
if
(
this
.
$route
.
query
.
type
){
let
id
=
this
.
$route
.
query
.
type
this
.
$axios
.
$get
(
config
.
api
.
get
.
Content
.
list
+
`
${
id
}
/contents`
,
{
params
:
params
})
.
then
((
response
)
=>
{
console
.
log
(
response
);
this
.
handleResponse
(
currentPage
,
response
)
})
}
},
changePage
(
currentPage
){
//返回页数 请求新的数据
this
.
dataGetNewsList
(
currentPage
)
},
}
}
</
script
>
...
...
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