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
4d963d5c00d074b165225cffec124f66f7cb0bdb
1 parent
f698d34f
editorial
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
33 deletions
apps/editorial/models/editorial.js
apps/editorial/views/action/detail.hbs
apps/editorial/views/partial/comment.hbs
apps/editorial/views/partial/msg.hbs
apps/me/controllers/favorite.js
apps/me/views/partial/collection/editorial.hbs
public/scss/editorial/_index.css
public/scss/editorial/_msg.css
apps/editorial/models/editorial.js
View file @
4d963d5
...
...
@@ -53,8 +53,6 @@ const _processListData = (list) => {
return
listData
;
};
/**
* 首页、列表页列表相关
* @param type
...
...
@@ -121,7 +119,7 @@ const getListData = (appType, pageNum, limit, udid, gender, tag, authorId) => {
*/
const
_getAuthorData
=
(
id
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/service/*/author/getAuthor'
,
{
return
serviceAPI
.
get
(
'guang/service/*/author/getAuthor'
,
{
author_id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
...
...
@@ -182,7 +180,6 @@ const _processHeadData = (list) => {
}
if
(
index
===
2
)
{
newData
.
headData
=
_
.
assign
(
newData
.
headData
,
{
commentNum
:
data
.
total
...
...
@@ -358,7 +355,7 @@ const _getHeadData = (id, appType, uid, udid) => {
par
.
udid
=
udid
;
}
return
serviceAPI
.
get
(
'
/
guang/api/*/article/getArticleBaseInfo'
,
par
).
then
((
result
)
=>
{
return
serviceAPI
.
get
(
'guang/api/*/article/getArticleBaseInfo'
,
par
).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
return
result
.
data
;
}
else
{
...
...
@@ -374,7 +371,7 @@ const _getHeadData = (id, appType, uid, udid) => {
* @returns {*}
*/
const
_getContentData
=
(
id
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/service/*/article/getArticleContent'
,
{
return
serviceAPI
.
get
(
'guang/service/*/article/getArticleContent'
,
{
article_id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
...
...
@@ -392,7 +389,7 @@ const _getContentData = (id) => {
* @returns {*}
*/
const
_getArticleData
=
(
id
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/service/v2/article/getArticle'
,
{
return
serviceAPI
.
get
(
'guang/service/v2/article/getArticle'
,
{
article_id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
...
...
@@ -410,7 +407,7 @@ const _getArticleData = (id) => {
* @returns {*}
*/
const
_getCommentsData
=
(
id
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/*/comments/getList'
,
{
return
serviceAPI
.
get
(
'guang/api/*/comments/getList'
,
{
article_id
:
id
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
...
...
@@ -457,7 +454,7 @@ const _getRelateBrand = (id) => {
* @returns {*}
*/
const
_getArticlePre
=
(
id
,
appType
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/*/article/getArticlePre'
,
{
return
serviceAPI
.
get
(
'guang/api/*/article/getArticlePre'
,
{
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
...
...
@@ -491,7 +488,7 @@ const _getArticlePre = (id, appType) => {
* @returns {*}
*/
const
_getArticleNext
=
(
id
,
appType
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/*/article/getArticleNext'
,
{
return
serviceAPI
.
get
(
'guang/api/*/article/getArticleNext'
,
{
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
...
...
@@ -534,7 +531,7 @@ const setCollect = (id, uid, appType) => {
message
:
'未登录'
});
}
return
serviceAPI
.
get
(
'
/
guang/api/*/favorite/setFavorite'
,
{
return
serviceAPI
.
get
(
'guang/api/*/favorite/setFavorite'
,
{
article_id
:
id
,
uid
:
uid
,
app_type
:
appType
...
...
@@ -554,7 +551,7 @@ const cancelCollect = (id, uid, appType) => {
message
:
'未登录'
});
}
return
serviceAPI
.
get
(
'
/
guang/api/*/favorite/cancelFavorite'
,
{
return
serviceAPI
.
get
(
'guang/api/*/favorite/cancelFavorite'
,
{
article_id
:
id
,
uid
:
uid
,
app_type
:
appType
...
...
@@ -569,7 +566,7 @@ const cancelCollect = (id, uid, appType) => {
*/
const
setPraise
=
(
id
,
udid
,
appType
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/v2/praise/setPraise'
,
{
return
serviceAPI
.
get
(
'guang/api/v2/praise/setPraise'
,
{
article_id
:
id
,
udid
:
udid
,
app_type
:
appType
...
...
@@ -584,7 +581,7 @@ const setPraise = (id, udid, appType) => {
*/
const
cancelPraise
=
(
id
,
udid
,
appType
)
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/v2/praise/cancel'
,
{
return
serviceAPI
.
get
(
'guang/api/v2/praise/cancel'
,
{
article_id
:
id
,
udid
:
udid
,
app_type
:
appType
...
...
@@ -605,7 +602,7 @@ const addComment = (id, uid, comment) => {
message
:
'未登录'
});
}
return
serviceAPI
.
get
(
'
/
guang/api/*/comments/add'
,
{
return
serviceAPI
.
get
(
'guang/api/*/comments/add'
,
{
article_id
:
id
,
uid
:
uid
,
content
:
comment
...
...
@@ -613,7 +610,7 @@ const addComment = (id, uid, comment) => {
};
const
shareData
=
()
=>
{
return
serviceAPI
.
get
(
'
/
guang/api/*/share/guang'
,
{}).
then
((
result
)
=>
{
return
serviceAPI
.
get
(
'guang/api/*/share/guang'
,
{}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
return
camelCase
(
result
.
data
);
}
else
{
...
...
apps/editorial/views/action/detail.hbs
View file @
4d963d5
...
...
@@ -18,9 +18,9 @@
<a
class=
"author-name"
href=
"
{{
authorUrl
}}
"
>
{{
name
}}
</a>
</div>
<div
class=
"article-status"
>
<span
class=
"article-time font"
>
{{
time
}}
</span>
<span
class=
"article-browse font"
>
浏览:
{{
click
}}
</span>
<span
class=
"article-comments font"
>
评论:
{{
commentNum
}}
</span>
<span
class=
"article-time brown-light"
>
{{
time
}}
</span>
<span
class=
"article-browse"
>
浏览:
<b
class=
" brown-light"
>
{{
click
}}
</b></span>
<span
class=
"article-comments"
>
评论:
<b
class=
"brown-light"
>
{{
commentNum
}}
</b></span>
</div>
</div>
{{/
header
}}
...
...
apps/editorial/views/partial/comment.hbs
View file @
4d963d5
...
...
@@ -15,7 +15,7 @@
</div>
<div
class=
"comment-info"
>
<p
class=
"comment-content"
>
{{
content
}}
</p>
<p
class=
"comment-time
fon
t"
>
{{
createTime
}}
</p>
<p
class=
"comment-time
brown-ligh
t"
>
{{
createTime
}}
</p>
</div>
</li>
{{/
list
}}
...
...
apps/editorial/views/partial/msg.hbs
View file @
4d963d5
<div
class=
"content-msg clearfix"
data-id=
"
{{
id
}}
"
>
<div
class=
"msg-left"
><i
class=
"iconfont"
>

</i>
<span
class=
"time-word font"
>
{{
publishTime
}}
</span></div>
<div
class=
"msg-left"
><i
class=
"iconfont"
>

</i>
<span
class=
"time-word font
brown-light
"
>
{{
publishTime
}}
</span></div>
<div
class=
"msg-right"
>
<a
class=
"msg-title"
href=
"/editorial/
{{
id
}}
.html"
target=
"_blank"
>
{{
title
}}
</a>
<a
href=
"/editorial/
{{
id
}}
.html"
target=
"_blank"
>
...
...
@@ -9,7 +9,7 @@
<div
class=
"msg-app"
>
<span
class=
"like-comment"
>
<i
class=
"iconfont like-icon
{{#if
isPraise
}}
liked
{{/if}}
"
>

</i>
<b
class=
"like-num font"
>
{{
praiseNum
}}
</b>
<b
class=
"like-num
brown-light
font"
>
{{
praiseNum
}}
</b>
</span>
</div>
</div>
...
...
apps/me/controllers/favorite.js
View file @
4d963d5
...
...
@@ -196,6 +196,12 @@ const favorite = {
editorialList
:
data
.
data
};
_
.
forEach
(
retData
.
editorialList
,
function
(
val
){
val
.
publishTime
=
val
.
publishTime
.
replace
(
/年|月/g
,
'/'
);
val
.
publishTime
=
val
.
publishTime
.
replace
(
/日/g
,
''
);
})
retData
.
total
=
data
.
total
;
retData
.
paginationData
=
{
page
:
page
,
...
...
apps/me/views/partial/collection/editorial.hbs
View file @
4d963d5
...
...
@@ -23,9 +23,9 @@
</div>
<div
class=
"editorial-some"
>
<span
class=
"author"
>
{{
author
.
name
}}
</span>
<span
class=
"time"
>
{{
publishTime
}}
</span>
<span>
浏览:
{{
viewsNum
}}
</span>
<span>
评论:
{{
praiseNum
}}
</span>
<span
class=
"time brown-light"
>
{{
publishTime
}}
</span>
<span>
浏览:
<b
class=
"brown-light"
>
{{
viewsNum
}}
</b></span>
<span>
评论:
<b
class=
"brown-light"
>
{{
praiseNum
}}
</b></span>
</div>
<p
class=
"summer"
>
{{
intro
}}
...
...
public/scss/editorial/_index.css
View file @
4d963d5
...
...
@@ -20,10 +20,6 @@
height
:
40px
;
}
.font
{
font-family
:
'黑体'
;
}
.paging
{
margin-top
:
40px
;
margin-bottom
:
80px
;
...
...
public/scss/editorial/_msg.css
View file @
4d963d5
...
...
@@ -11,7 +11,7 @@
line-height
:
30px
;
text-align
:
center
;
border-bottom
:
1px
solid
#bbb
;
color
:
#
a0a0a0
;
color
:
#
999
;
}
.msg-right
{
...
...
@@ -30,7 +30,7 @@
.msg-title
{
font-size
:
20px
;
color
:
#
333
;
color
:
#
1b1b1b
;
line-height
:
30px
;
max-height
:
64px
;
overflow
:
hidden
;
...
...
@@ -42,7 +42,7 @@
}
.msg-title
:hover
{
color
:
#
ff1414
;
color
:
#
379ed6
;
}
.lazy
{
...
...
@@ -86,7 +86,7 @@
}
.like-comment
{
color
:
#
a6a6a6
;
color
:
#
999
;
cursor
:
pointer
;
font-size
:
14px
;
...
...
Please
register
or
login
to post a comment