Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
ee5e515f5ff9b179f66c278780741ba0d07f8f22
2 parents
4b7642b4
211af89c
Merge branch 'feature/guang2' into release/5.8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
utils/guang-process.js
utils/guang-process.js
View file @
ee5e515
...
...
@@ -241,21 +241,37 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW
// 一张图片
if
(
_
.
get
(
value
,
'singleImage.data.length'
,
false
))
{
let
tagList
=
_
.
get
(
value
,
'singleImage.data[0].tagList'
,
[]);
let
tagListGlobal
=
_
.
get
(
value
,
'singleImage.data[0].tagListGlobal'
,
[]);
let
tagListLimit
=
_
.
get
(
value
,
'singleImage.data[0].tagListLimit'
,
[]);
// 普通商品
if
(
tagList
.
length
>
0
)
{
_
.
forEach
(
tagList
,
(
tag
,
tagIndex
)
=>
{
// 链接
if
(
tag
.
is_global
===
'Y'
)
{
tagList
[
tagIndex
].
href
=
'//m.yohobuy.com/product/global/'
+
tag
.
product_skn
+
'.html'
;
}
else
{
tagList
[
tagIndex
].
href
=
'//m.yohobuy.com/product/'
+
tag
.
product_skn
+
'.html'
;
}
tagList
[
tagIndex
].
href
=
'//m.yohobuy.com/product/'
+
tag
.
product_skn
+
'.html'
;
tagList
[
tagIndex
].
isApp
=
isApp
;
});
}
// 全球购商品
if
(
tagListGlobal
.
length
>
0
)
{
_
.
forEach
(
tagListGlobal
,
tagGlobal
=>
{
tagList
.
push
(
Object
.
assign
(
tagGlobal
,
{
href
:
'//m.yohobuy.com/product/global/'
+
tagGlobal
.
product_skn
+
'.html'
,
isApp
:
isApp
}));
});
}
// 限定商品
if
(
tagListLimit
.
length
>
0
)
{
_
.
forEach
(
tagListLimit
,
tagLimit
=>
{
tagList
.
push
(
Object
.
assign
(
tagLimit
,
{
href
:
'//m.yohobuy.com/product/'
+
tagLimit
.
product_skn
+
'.html'
,
isApp
:
isApp
}));
});
}
finalDetail
.
push
({
bigImage
:
helpers
.
image
(
_
.
get
(
value
,
'singleImage.data[0].src'
,
''
),
640
,
640
),
noLazy
:
index
<=
3
,
...
...
@@ -378,15 +394,34 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW
});
}
//
170505 新添加
推荐商品
// 推荐商品
if
(
_
.
get
(
value
,
'recommend_products'
,
false
))
{
let
recommendProducts
=
_
.
get
(
value
,
'recommend_products.data'
,
[]);
let
recommendProductsGlobal
=
_
.
get
(
value
,
'recommend_products.dataGlobal'
,
[]);
let
recommendProductsLimit
=
_
.
get
(
value
,
'recommend_products.dataLimit'
,
[]);
// 普通商品
_
.
forEach
(
recommendProducts
,
(
goods
,
goodsKey
)
=>
{
recommendProducts
[
goodsKey
].
price
=
parseFloat
(
goods
.
sales_price
).
toFixed
(
2
);
recommendProducts
[
goodsKey
].
href
=
isApp
?
`
http
:
//m.yohobuy.com/product/${goods.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${goods.product_skn}"}}` : `//m.yohobuy.com/product/${goods.product_skn}.html`;
});
// 全球购商品
_
.
forEach
(
recommendProductsGlobal
,
goodsGlobal
=>
{
recommendProducts
.
push
(
Object
.
assign
(
goodsGlobal
,
{
price
:
parseFloat
(
goodsGlobal
.
sales_price
).
toFixed
(
2
),
href
:
isApp
?
`
http
:
//m.yohobuy.com/product/${goodsGlobal.product_skn}.html?openby:yohobuy={"action":"go.globalpurchase","params":{"skn":"${goodsGlobal.product_skn}"}}` : `//m.yohobuy.com/product/global/${goodsGlobal.product_skn}.html`
}));
});
// 限定商品
_
.
forEach
(
recommendProductsLimit
,
goodsLimit
=>
{
recommendProducts
.
push
(
Object
.
assign
(
goodsLimit
,
{
price
:
parseFloat
(
goodsLimit
.
sales_price
).
toFixed
(
2
),
href
:
isApp
?
`
http
:
//m.yohobuy.com/product/${goodsLimit.product_skn}.html?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":"${goodsLimit.product_skn}"}}` : `//m.yohobuy.com/product/${goodsLimit.product_skn}.html`
}));
});
finalDetail
.
push
({
recommendProducts
:
_
.
get
(
value
,
'recommend_products.data'
,
[])
});
...
...
Please
register
or
login
to post a comment