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
biao
9 years ago
Commit
61af69f958a702f86d66971ba2eedeb15035303b
2 parents
feda4b38
2b5409a6
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
11 changed files
with
86 additions
and
24 deletions
apps/editorial/controllers/editorial.js
apps/editorial/models/editorial.js
apps/editorial/views/action/detail.hbs
apps/me/views/partial/address/table.hbs
apps/product/controllers/list.js
apps/product/controllers/query.js
apps/product/controllers/shop.js
apps/product/views/partial/list/shop-sort.hbs
config/common.js
public/js/me/setting.page.js
public/scss/product/_shop.css
apps/editorial/controllers/editorial.js
View file @
61af69f
...
...
@@ -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 @
61af69f
...
...
@@ -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 @
61af69f
...
...
@@ -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/me/views/partial/address/table.hbs
View file @
61af69f
...
...
@@ -21,11 +21,11 @@
<td
class=
"width-opearte"
>
<div>
<span
class=
"blue opreation update-address"
data-id=
"
{{
address_id
}}
"
>
修改
</span>
<em
class=
"op-sep"
>
|
</em>
<span
class=
"blue opreation del-address"
data-id=
"
{{
address_id
}}
"
>
删除
</span>
{{#if
default
}}
<span
class=
"btn set-default opreation current-default"
data-id=
{{
address_id
}}
>
默认地址</span
>
{{else}}
<em
class=
"op-sep"
>
|
</em>
<span
class=
"blue opreation del-address"
data-id=
"
{{
address_id
}}
"
>
删除
</span>
<span
class=
"btn set-default opreation "
data-id=
{{
address_id
}}
>
设为默认</span
>
{{/if}}
</div>
...
...
apps/product/controllers/list.js
View file @
61af69f
...
...
@@ -17,7 +17,7 @@ const list = {
// 列表页
index
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
@@ -69,7 +69,7 @@ const list = {
// 新品到着
newPage
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
apps/product/controllers/query.js
View file @
61af69f
...
...
@@ -17,7 +17,7 @@ const Query = {
index
:
(
req
,
res
,
next
)
=>
{
let
q
=
req
.
query
;
let
query
=
q
.
query
||
''
;
let
channel
=
req
.
cookies
.
_Channel
||
req
.
query
.
_Channel
||
'men'
;
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
order
=
q
.
order
||
's_n_desc'
;
...
...
apps/product/controllers/shop.js
View file @
61af69f
...
...
@@ -91,7 +91,8 @@ const shop = {
page
:
'shop-list'
,
title
:
'店铺列表'
};
let
nav
=
[
DataHelper
.
getChannelNav
()];
let
channel
=
req
.
query
.
_Channel
||
req
.
cookies
.
_Channel
||
'men'
;
let
nav
=
[
DataHelper
.
getChannelNav
(
channel
)];
let
domain
=
req
.
params
.
domain
;
let
uid
=
req
.
user
.
uid
;
let
q
=
req
.
query
;
...
...
@@ -99,6 +100,7 @@ const shop = {
q
.
order
=
q
.
order
||
's_n_desc'
;
q
.
page
=
parseInt
(
q
.
page
||
1
,
10
);
q
.
channel
=
channel
;
ShopData
.
getShopHeadData
(
domain
,
uid
).
then
(
result
=>
{
data
.
banner
=
result
;
...
...
apps/product/views/partial/list/shop-sort.hbs
View file @
61af69f
<div
class=
"shop-sort"
>
<div
class=
"all"
>
所有商品
</div>
<div
class=
"sort-list"
>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=2,3"
>
女装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=1,3"
>
男装
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=1,3"
>
男士
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?gender=2,3"
>
女士
</a></div>
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?_Channel=lifestyle"
>
生活
</a></div>
{{#
each
banner
.
sorts
}}
<div><a
href=
"
{{
@root
.
mores
.
all
.
url
}}
?misort=
{{
sortId
}}
"
>
{{
sortName
}}
</a></div>
{{/
each
}}
...
...
config/common.js
View file @
61af69f
...
...
@@ -22,8 +22,8 @@ module.exports = {
},
cookieDomain
:
'yohoblk.com'
,
domains
:
{
api
:
'http://api-test1.yohops.com:9999/'
,
// devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service
:
'http://service-test1.yohops.com:9999/'
,
// testservice.yoho.cn:28077 devservice.yoho.cn:58077
api
:
'http://dev-api.yohops.com:9999/'
,
// devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service
:
'http://dev-service.yohops.com:9999/'
,
// testservice.yoho.cn:28077 devservice.yoho.cn:58077
search
:
'http://192.168.102.216:8080/yohosearch/'
},
useOneapm
:
false
,
...
...
public/js/me/setting.page.js
View file @
61af69f
...
...
@@ -34,7 +34,7 @@ var Bll = {
},
validate
:
function
(
info
)
{
var
regBirth
=
new
RegExp
(
/^
[
1-2
][
0-9
][
0-9
][
0-9
]
-
[
0-1
]{0,1}[
0-9
]
-
[
0-3
]{0,1}[
0-9
]
$/
);
var
regName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5_
-a-zA-Z0-9
]
+$/
);
var
regName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5_
a-zA-Z0-9-
]
+$/
);
var
regRealName
=
new
RegExp
(
/^
[\u
4e00-
\u
9fa5a-zA-Z
]{2,12}
$/
);
var
birthdayForm
=
$
(
'#birthday'
);
var
nickForm
=
$
(
'#nick_name'
);
...
...
public/scss/product/_shop.css
View file @
61af69f
...
...
@@ -233,6 +233,8 @@
float
:
left
;
height
:
30px
;
line-height
:
30px
;
width
:
1000px
;
overflow
:
hidden
;
div
{
float
:
left
;
margin
:
0
5px
;
...
...
Please
register
or
login
to post a comment