Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
9 years ago
Commit
04e8d4ce3f57c321f4e462680a3d905aad37f4a6
1 parent
75cb4ecd
editorial
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
apps/editorial/controllers/editorial.js
apps/editorial/models/editorial.js
apps/editorial/controllers/editorial.js
View file @
04e8d4c
...
...
@@ -16,6 +16,7 @@ const index = (req, res, next) => {
// let gender = req.query.brand || 1;
editorialModel
.
getIndexData
(
type
,
pageNum
,
limit
).
then
((
result
)
=>
{
console
.
log
()
res
.
display
(
'index'
,
{
module
:
'editorial'
,
page
:
'index'
,
...
...
@@ -34,11 +35,11 @@ const index = (req, res, next) => {
}
],
msgTypes
:
result
.
msgTypes
,
msg
:
result
.
msg
,
msg
:
result
.
msg
.
list
.
artList
,
paginationOpts
:
{
page
:
pageNum
,
// current page: http://host/?page=2
limit
:
20
,
// per_page records' number
total
:
300
,
// total page number
total
:
result
.
msg
.
total
,
// total page number
queryParams
:
req
.
query
}
},
...
...
@@ -87,11 +88,11 @@ const list = (req, res) => {
}
],
pathTitle
:
req
.
query
.
query
,
msg
:
result
,
msg
:
result
.
list
.
artList
,
paginationOpts
:
{
page
:
pageNum
,
// current page: http://host/?page=2
limit
:
20
,
// per_page records' number
total
:
300
,
// total page number
total
:
result
.
total
,
// total page number
queryParams
:
req
.
query
}
},
...
...
apps/editorial/models/editorial.js
View file @
04e8d4c
...
...
@@ -19,7 +19,7 @@ const _processNavData = (list, type) => {
list
=
camelCase
(
list
);
_
.
forEach
(
list
,
(
data
,
index
)
=>
{
data
.
url
=
`
/
/127.0.0.1:6003/
editorial?type=${data.id}`;
data
.
url
=
`
/
editorial
?
type
=
$
{
data
.
id
}
`
;
data
.
isActive
=
index
===
parseInt
(
type
,
10
)
?
true
:
false
;
formatData
.
push
(
data
);
...
...
@@ -33,10 +33,7 @@ const _processListData = (list) => {
list
=
list
||
[];
list
=
camelCase
(
list
);
// let data = moment('2016年06月02日 15:56', 'YYYY年MM月DD日 HH:mm').format('YYYY/MM/DD HH:mm');
let
artList
=
list
.
list
.
artList
.
map
(
data
=>
{
_
.
forEach
(
list
.
list
.
artList
,
(
data
)
=>
{
data
.
publishTime
=
data
.
publishTime
.
replace
(
/年|月/g
,
'/'
);
data
.
publishTime
=
data
.
publishTime
.
replace
(
/日/g
,
''
);
...
...
@@ -46,10 +43,9 @@ const _processListData = (list) => {
data
.
isPraise
=
true
;
}
return
data
;
});
return
artL
ist
;
return
l
ist
;
};
const
_getResources
=
(
type
)
=>
{
...
...
Please
register
or
login
to post a comment