Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
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
front-end-dev
techbook
Commits
6b7fa7df
Commit
6b7fa7df
authored
May 13, 2020
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分类下的文章
parent
659b8384
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
82 deletions
+21
-82
router.js
src/router.js
+16
-0
api.js
src/views/mobile/article/api.js
+5
-0
articlelist.vue
src/views/mobile/article/articlelist.vue
+0
-82
list.vue
src/views/mobile/article/list.vue
+0
-0
No files found.
src/router.js
View file @
6b7fa7df
...
...
@@ -1159,6 +1159,22 @@ export default new Router({
]
},
{
path
:
'/articleFlagList'
,
name
:
"articleFlagList"
,
component
:
articleList
,
children
:[
{
name
:
"articleFlagList"
,
path
:
"/articleFlagList"
,
components
:{
default
:
resolve
=>
require
([
'views/mobile/article/list.vue'
],
resolve
),
other
:
resolve
=>
require
([
'views/mobile/article/articledetail.vue'
],
resolve
)
}
}
]
},
{
path
:
'/articleDetail'
,
name
:
"articleDetail"
,
...
...
src/views/mobile/article/api.js
View file @
6b7fa7df
...
...
@@ -7,5 +7,9 @@ export default {
getChannelListAxios
(){
return
api
.
fetchLoadingLogin
(
"/business/content/selectContentChannelList"
);
},
getArticleFlagListAxios
(
params
){
return
api
.
fetchLoadingLogin
(
"/business/content/selectContentListByClassifyId"
,
params
);
}
}
\ No newline at end of file
src/views/mobile/article/articlelist.vue
View file @
6b7fa7df
...
...
@@ -10,94 +10,12 @@
name
:
"articlelist"
,
data
()
{
return
{
userInfo
:
this
.
publicFun
.
getCookie
(
"userInfo"
)
?
JSON
.
parse
(
this
.
Base64
.
decode
(
this
.
publicFun
.
getCookie
(
"userInfo"
)))
:
null
,
tableData
:
[],
currentIndex
:
0
,
channelList
:
[
{
id
:
1
,
name
:
"智能出行"
},
{
id
:
2
,
name
:
"智能驾驶"
},
{
id
:
3
,
name
:
"科学技术"
},
{
id
:
1
,
name
:
"智能出行"
},
{
id
:
2
,
name
:
"智能驾驶"
},
{
id
:
3
,
name
:
"科学技术"
},
{
id
:
1
,
name
:
"智能出行"
},
{
id
:
2
,
name
:
"智能驾驶"
},
{
id
:
3
,
name
:
"科学技术"
},
],
page
:
1
,
pageSize
:
10
,
totalPage
:
1
,
allLoaded
:
false
,
currentData
:
null
,
isMobile
:
this
.
publicFun
.
getCookie
(
'ismobile'
)
}
},
methods
:
{
handleTab
(
data
,
index
)
{
this
.
currentIndex
=
index
;
if
(
index
>=
(
this
.
channelList
.
length
-
1
)
/
2
&&
this
.
channelList
.
length
>=
5
){
this
.
$refs
.
navBar
.
scrollLeft
=
this
.
$refs
.
navBar
.
scrollLeft
+
window
.
document
.
body
.
clientWidth
-
50
;
}
},
handleToDetail
(
data
){
this
.
$router
.
push
({
path
:
"/articleDetail"
,
query
:{
id
:
1
}})
},
loadTop
()
{
this
.
page
=
1
;
this
.
$store
.
dispatch
(
'applyListPageAction'
,{
path
:
this
.
$route
.
path
,
pars
:
this
.
page
});
// 加载更多数据
this
.
getInitFunc
();
this
.
$refs
.
loadmore
.
onTopLoaded
();
},
loadBottom
()
{
// 加载更多数据
this
.
more
();
// 上拉触发的分页查询
this
.
$refs
.
loadmore
.
onBottomLoaded
();
},
isHaveMore
:
function
(
isHaveMore
)
{
// 是否还有下一页,如果没有就禁止上拉刷新
this
.
allLoaded
=
true
;
//true是禁止上拉加载
if
(
isHaveMore
)
{
this
.
allLoaded
=
false
;
}
},
more
:
function
()
{
// 分页查询
this
.
page
=
parseInt
(
this
.
page
)
+
1
;
this
.
$store
.
dispatch
(
'applyListPageAction'
,{
path
:
this
.
$route
.
path
,
pars
:
this
.
page
});
this
.
getInitFunc
(
1
);
},
},
mounted
()
{
...
...
src/views/mobile/article/list.vue
View file @
6b7fa7df
This diff is collapsed.
Click to expand it.
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