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
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
9 years ago
Commit
6c95b16a334083df9b222e3011032cc89d1311ec
1 parent
5a2b1cf5
ad image
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
utils/product-process.js
utils/product-process.js
View file @
6c95b16
...
...
@@ -5,6 +5,8 @@ const camelCase = global.yoho.camelCase;
const
helpers
=
global
.
yoho
.
helpers
;
const
images
=
require
(
`
$
{
global
.
utils
}
/images`
)
;
let
fixQuality
=
imageUrl
=>
imageUrl
.
replace
(
'/quality/70'
,
'/quality/90'
);
/**
* 根据性别来决定 默认图片获取字段 如果是 2、3
*
...
...
@@ -12,7 +14,7 @@ const images = require(`${global.utils}/images`);
* 否则优先从cover1 --》 cover2 -- 》 images_url
*
*/
const
procProductImg
=
(
product
,
gender
)
=>
{
const
_
procProductImg
=
(
product
,
gender
)
=>
{
if
(
gender
===
'2,3'
)
{
return
product
.
cover2
||
product
.
cover1
||
product
.
imagesUrl
||
''
;
}
...
...
@@ -20,6 +22,7 @@ const procProductImg = (product, gender) => {
return
product
.
cover1
||
product
.
cover2
||
product
.
imagesUrl
||
''
;
};
const
procProductImg
=
(
product
,
gender
)
=>
fixQuality
(
_procProductImg
(
product
,
gender
));
/**
* 处理列表大图周边小图数据,拼接添加 href
...
...
@@ -161,6 +164,10 @@ exports.processProductList = (list, options) => {
}
}
_
.
get
(
product
,
'goodsList'
,
[]).
forEach
((
goods
)
=>
{
console
.
log
(
goods
);
});
pruductList
.
push
(
product
);
});
return
handleGoodsListData
(
pruductList
);
...
...
Please
register
or
login
to post a comment