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
Plain Diff
Browse Files
Authored by
姜枫
9 years ago
Commit
21daf99a014c93419e8f6ca86df58360400fde57
2 parents
c33fd1f2
06ade4c0
Merge branch 'release/1.0' of
http://git.yoho.cn/fe/yoho-blk
into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
13 deletions
apps/editorial/controllers/editorial.js
apps/editorial/models/editorial.js
apps/editorial/views/action/detail.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
public/js/me/order.page.js
public/js/me/order/cancel-order.js
apps/editorial/controllers/editorial.js
View file @
21daf99
...
...
@@ -175,10 +175,13 @@ const detail = (req, res, next) => {
userInfo
:
result
.
head
,
comment
:
result
.
comment
,
brands
:
result
.
brands
,
article
:
{
nextChapter
:
'来来来,让我们好好聊聊'
,
lastChapter
:
'除了黑白灰'
},
// article: {
// nextChapter: '来来来,让我们好好聊聊',
// lastChapter: '除了黑白灰'
// },
nextArticle
:
result
.
nextArticle
,
perArticle
:
result
.
perArticle
,
share
:
{
shareImg
:
result
.
content
.
shareImg
,
shareDesc
:
result
.
head
.
title
,
...
...
apps/editorial/models/editorial.js
View file @
21daf99
...
...
@@ -190,8 +190,8 @@ const _processHeadData = (list) => {
}
});
// newData.headData.time = newData.headData.time.replace(/-/g, '/');
// newData.headData.time = newData.headData.time.replace(':00', '', 2);
newData
.
headData
.
time
=
newData
.
headData
.
time
.
replace
(
/-/g
,
'/'
);
newData
.
headData
.
time
=
newData
.
headData
.
time
.
replace
(
':00'
,
''
,
2
);
let
id
=
newData
.
headData
.
authorId
;
...
...
@@ -447,13 +447,58 @@ const _getArticlePre = (id, appType) => {
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
// console.log(result.message)
if
(
result
&&
result
.
code
===
200
)
{
// console.log(result)
let
perArticle
=
{};
perArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdPre
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdPre
,
appType
).
then
((
list
)
=>
{
perArticle
.
lastChapter
=
list
.
title
;
}).
then
(()
=>
{
return
perArticle
;
});
return
perArticle
;
}
else
{
logger
.
error
(
'In the previous is not 200'
);
return
{};
}
});
};
/**
* 获取详情页下一篇
* @param id
* @returns {*}
*/
const
_getArticleNext
=
(
id
,
appType
)
=>
{
return
serviceAPI
.
get
(
'/guang/api/*/article/getArticleNext'
,
{
id
:
id
,
app_type
:
appType
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
let
nextArticle
=
{};
nextArticle
.
href
=
`
$
{
config
.
siteUrl
}
/editorial/
$
{
result
.
data
.
articleIdNext
}.
html
`
;
_getHeadData
(
result
.
data
.
articleIdNext
,
appType
).
then
((
list
)
=>
{
nextArticle
.
lastChapter
=
list
.
title
;
}).
then
(()
=>
{
return
nextArticle
;
});
return
nextArticle
;
return
camelCase
(
result
.
data
);
}
else
{
logger
.
error
(
'
上一篇
is not 200'
);
logger
.
error
(
'
The next article
is not 200'
);
return
{};
}
});
...
...
@@ -573,6 +618,7 @@ const getDetailData = (id, appType) => {
_getContentData
(
id
),
_getCommentsData
(
id
),
_getArticlePre
(
id
,
appType
),
_getArticleNext
(
id
,
appType
),
_getRelateBrand
(
id
)]);
let
res
=
yield
_processHeadData
([
result
[
0
],
result
[
1
],
result
[
3
]]);
...
...
@@ -581,7 +627,9 @@ const getDetailData = (id, appType) => {
tags
:
res
.
tags
,
content
:
result
[
2
],
comment
:
result
[
3
],
brands
:
result
[
5
]
brands
:
result
[
6
],
nextArticle
:
result
[
4
],
perArticle
:
result
[
5
]
};
})();
};
...
...
apps/editorial/views/action/detail.hbs
View file @
21daf99
...
...
@@ -141,16 +141,22 @@
</div>
<div
class=
"chapter"
>
{{#
article
}}
<p
class=
"chapter-right"
>
<span>
下一篇
</span><br>
{{#
nextArticle
}}
<a
href=
"
{{
href
}}
"
>
{{
nextChapter
}}
</a>
{{/
nextArticle
}}
</p>
<p
class=
"chapter-left"
>
<span>
上一篇
</span><br>
{{#
perArticle
}}
<a
href=
"
{{
href
}}
"
>
{{
lastChapter
}}
</a>
{{/
perArticle
}}
</p>
{{/
article
}}
</div>
<div
id=
"comment-area"
class=
"comment-area"
>
...
...
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
21daf99
...
...
@@ -124,6 +124,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"javascript:void(0)"
>
{{
product_name
}}
</a></div>
<div>
{{#if
color_name
}}
...
...
public/js/me/order.page.js
View file @
21daf99
...
...
@@ -41,6 +41,7 @@ var typeMap = {
};
require
(
'../common/foreach-polyfill'
);
require
(
'../common/bind-polyfill'
);
// 个人中心共用代码加载
require
(
'./me'
);
...
...
public/js/me/order/cancel-order.js
View file @
21daf99
...
...
@@ -2,6 +2,8 @@ var dialog = require('../../plugins/dialog');
var
_dialog
=
dialog
.
Dialog
;
var
_alert
=
dialog
.
Alert
;
require
(
'../../common/foreach-polyfill'
);
// 添加.check方法
require
(
'../../plugins/check'
);
...
...
Please
register
or
login
to post a comment