Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
43b973b12abc61da771a0a773f2f3f3ce5d117b2
2 parents
02e3805c
912decc1
Merge branch 'gray' into 'master'
Gray See merge request
!345
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
20 deletions
doraemon/views/partial/product/good.hbs
utils/product-process-simple.js
utils/product-process.js
doraemon/views/partial/product/good.hbs
View file @
43b973b
...
...
@@ -43,10 +43,10 @@
{{/
is_solded
}}
</div>
<div
class=
"good-detail-text
{{#
for_stu
}}
stu-good-detail
{{/
for_stu
}}
"
>
<a
href=
"
{{
url
}}
"
target=
"_blank"
{{#if
noFollow
}}
rel=
"nofollow"
{{/if}}
>
{{{
product_name
}}}
</a>
<a
href=
"
{{
url
}}
"
target=
"_blank"
title=
"
{{#if
productTitle
}}{{
productTitle
}}{{^}}{{
product_name
}}{{/if}}
"
{{#if
noFollow
}}
rel=
"nofollow"
{{/if}}
>
{{{
product_name
}}}
111
</a>
<p
class=
"brand"
>
{{#if
brand_name
}}
<a
href=
"
{{
brandUrl
}}
"
{{#if
@root
.
pageNoFollow
}}
rel=
"nofollow"
{{/if}}
>
{{
brand_name
}}
</a>
<a
href=
"
{{
brandUrl
}}
"
title=
"
{{#if
productTitle
}}{{
productTitle
}}{{^}}{{
product_name
}}{{/if}}
"
{{#if
@root
.
pageNoFollow
}}
rel=
"nofollow"
{{/if}}
>
{{
brand_name
}}
</a>
{{/if}}
</p>
<p
class=
"price
{{#if
vip
}}
vip-center
{{/if}}
"
>
...
...
utils/product-process-simple.js
View file @
43b973b
...
...
@@ -3,13 +3,6 @@ const _ = require('lodash');
const
helpers
=
global
.
yoho
.
helpers
;
const
logger
=
global
.
yoho
.
logger
;
const
genderName
=
{
1
:
'男生'
,
2
:
'女生'
,
'1,3'
:
'男生'
,
'2,3'
:
'女生'
};
/**
* 处理接口返回图片链接,兼容非正常链接(如:/2015/10/22/08/023a5aa1cbdac7bdcd1685bfdab118b0c5.jpg)
*
...
...
@@ -199,8 +192,17 @@ exports.processProductList = (list, options) => {
isfew
?
proInfo
.
is_few
=
isfew
:
delete
proInfo
.
is_few
;
}
proInfo
.
productTitle
=
_
.
compact
([
product
.
brand_name_en
,
product
.
brand_name_cn
||
product
.
brand_name
,
genderName
[
product
.
gender
],
product
.
small_sort_name
,
product
.
product_name
]).
join
(
'|'
);
let
genderStr
=
''
;
if
(
_
.
get
(
options
,
'from.params.gender'
)
===
'1,3'
)
{
genderStr
=
'男士'
;
}
else
if
(
_
.
get
(
options
,
'from.params.gender'
)
===
'2,3'
)
{
genderStr
=
'女士'
;
}
else
{
genderStr
=
''
;
}
proInfo
.
productTitle
=
`【
$
{
genderStr
}
$
{
product
.
small_sort
?
product
.
small_sort
:
''
}
】
$
{
product
.
product_name
}
`
;
if
(
options
.
query
&&
_
.
isString
(
proInfo
.
product_name
))
{
try
{
...
...
utils/product-process.js
View file @
43b973b
...
...
@@ -131,13 +131,6 @@ const procProductImgs = (item, gender) => {
}
};
const
genderName
=
{
1
:
'男生'
,
2
:
'女生'
,
'1,3'
:
'男生'
,
'2,3'
:
'女生'
};
/**
* 商品搜索商品数据处理
*/
...
...
@@ -339,8 +332,17 @@ exports.processProductList = (list, options) => {
isfew
?
product
.
is_few
=
isfew
:
delete
product
.
is_few
;
}
product
.
productTitle
=
_
.
compact
([
product
.
brand_name_en
,
product
.
brand_name_cn
||
product
.
brand_name
,
genderName
[
product
.
gender
],
product
.
small_sort_name
,
product
.
product_name
]).
join
(
'|'
);
let
genderStr
=
''
;
if
(
_
.
get
(
options
,
'from.params.gender'
)
===
'1,3'
)
{
genderStr
=
'男士'
;
}
else
if
(
_
.
get
(
options
,
'from.params.gender'
)
===
'2,3'
)
{
genderStr
=
'女士'
;
}
else
{
genderStr
=
''
;
}
product
.
productTitle
=
`【
$
{
genderStr
}
$
{
product
.
small_sort
?
product
.
small_sort
:
''
}
】
$
{
product
.
product_name
}
`
;
if
(
options
.
query
&&
_
.
isString
(
product
.
product_name
))
{
try
{
...
...
Please
register
or
login
to post a comment