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
yyq
9 years ago
Commit
d6f32bd515d617b42733686e6199ceb2b7348dc3
2 parents
e9616ed1
5b4808d4
Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
20 deletions
apps/product/models/public-handler.js
apps/product/models/sale-handler.js
apps/product/models/sale.js
apps/product/models/public-handler.js
View file @
d6f32bd
...
...
@@ -496,7 +496,9 @@ exports.handleSaleFilterData = (origin, params) => {
return
o
.
index
;
});
// 处理 价格 筛选数据
// 处理价格筛选数据
let
priceRangechecked
=
false
;
if
(
!
_
.
isEmpty
(
origin
.
priceRange
))
{
_
.
forEach
(
origin
.
priceRange
,
(
value
,
key
)
=>
{
let
price
=
{
...
...
@@ -509,6 +511,20 @@ exports.handleSaleFilterData = (origin, params) => {
});
}
// 处理用户自主填写的价格区间
if
(
!
priceRangechecked
&&
params
.
price
)
{
let
customPrice
=
_
.
split
(
params
.
price
,
','
);
dest
.
customPrice
=
{
min
:
customPrice
[
0
],
max
:
customPrice
[
1
]
};
dest
.
checkedConditions
.
conditions
.
push
({
name
:
'¥ '
+
customPrice
[
0
]
+
'-'
+
customPrice
[
1
],
href
:
handleFilterUrl
(
params
,
{
price
:
''
})
});
}
// 处理性别数据
dest
.
gender
=
[
{
...
...
apps/product/models/sale-handler.js
View file @
d6f32bd
...
...
@@ -83,7 +83,7 @@ exports.handleSaleActivityData = (origin, channel) => {
_
.
forEach
(
origin
,
function
(
value
,
key
)
{
let
activity
=
{
link
:
helpers
.
urlFormat
(
'/product/sale/discount/detail'
,
{
id
:
value
.
id
,
channel
:
channel
}),
img
:
value
.
cover_url
,
img
:
value
.
web_
cover_url
,
time
:
processTime
(
parseInt
(
value
.
left_time
,
10
)
*
1000
),
brand
:
value
.
logo_url
,
title
:
value
.
title
...
...
apps/product/models/sale.js
View file @
d6f32bd
...
...
@@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => {
switch
(
userInfo
.
curLevel
)
{
case
'1'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip1Price
;
finalResult
.
goods
[
key
].
vip1
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip1Price
,
vip1
:
true
};
break
;
case
'2'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip2Price
;
finalResult
.
goods
[
key
].
vip2
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip2Price
,
vip2
:
true
};
break
;
case
'3'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip3Price
;
finalResult
.
goods
[
key
].
vip3
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip3Price
,
vip3
:
true
};
break
;
default
:
finalResult
.
goods
[
key
].
vip
=
true
;
finalResult
.
goods
[
key
]
=
{
vip
:
true
};
delete
finalResult
.
goods
[
key
].
salesPrice
;
break
;
}
...
...
@@ -285,6 +293,8 @@ exports.getSaleOthersData = (params, channel) => {
delete
finalResult
.
goods
[
key
].
tags
.
isSale
;
// 屏蔽 sale 标签
delete
finalResult
.
goods
[
key
].
discount
;
// 屏蔽折扣信息
});
}
else
{
logger
.
error
(
'goods list api code no 200'
);
}
// 获取焦点图数据
...
...
@@ -317,19 +327,27 @@ exports.getSaleOthersData = (params, channel) => {
switch
(
userInfo
.
curLevel
)
{
case
'1'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip1_price
;
finalResult
.
goods
[
key
].
vip1
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip1_price
,
vip1
:
true
};
break
;
case
'2'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip2_price
;
finalResult
.
goods
[
key
].
vip2
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip2_price
,
vip2
:
true
};
break
;
case
'3'
:
finalResult
.
goods
[
key
].
salePrice
=
value
.
vip3_price
;
finalResult
.
goods
[
key
].
vip3
=
true
;
finalResult
.
goods
[
key
]
=
{
salePrice
:
value
.
vip3_price
,
vip3
:
true
};
break
;
default
:
finalResult
.
goods
[
key
].
vip
=
true
;
finalResult
.
goods
[
key
]
=
{
vip
:
true
};
delete
finalResult
.
goods
[
key
].
salesPrice
;
break
;
}
...
...
@@ -378,10 +396,11 @@ exports.getSaleDiscountData = (params, channel) => {
finalResult
.
saleTitle
=
saleHandler
.
handleDiscountTitleData
(
result
[
2
].
data
[
0
]);
if
(
result
[
2
].
data
[
0
].
web_url
)
{
finalResult
.
topBanner
=
{
list
:
[]
};
finalResult
.
topBanner
.
list
[
0
]
=
{
img
:
result
[
2
].
data
[
0
].
web_url
list
:
[
{
img
:
result
[
2
].
data
[
0
].
web_url
}
]
};
}
else
{
logger
.
error
(
'discount activity data[0] web_url empty'
);
...
...
Please
register
or
login
to post a comment