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
889f7b887b55f15c3fe7be11f7ba1c0986c71c5e
1 parent
ec51a626
add
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
36 deletions
apps/product/controllers/detail.js
apps/product/models/detail-service.js
apps/product/models/outlets-handler.js
apps/product/models/sale.js
config/common.js
doraemon/models/header.js
utils/resources-process.js
apps/product/controllers/detail.js
View file @
889f7b8
...
...
@@ -94,8 +94,7 @@ class CommentAction extends YohoAction {
this
.
response
.
json
({
code
:
result
.
code
,
// TODO:
data
:
camelCase
(
_
.
get
(
pageResponse
,
'list'
,
[])).
map
((
item
)
=>
{
data
:
_
.
get
(
pageResponse
,
'list'
,
[]).
map
((
item
)
=>
{
return
{
avatar
:
_
.
get
(
item
,
'userInfo.headIco'
,
''
)
?
...
...
@@ -103,8 +102,8 @@ class CommentAction extends YohoAction {
DEFAULT_AVATAR_ICO
,
userName
:
_
.
get
(
item
,
'userInfo.nickName'
,
''
),
date
:
moment
(
item
.
createTime
,
'X'
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
color
:
_
.
get
(
item
,
'goods.colorName'
,
''
),
size
:
_
.
get
(
item
,
'goods.sizeName'
,
''
),
color
:
_
.
get
(
item
,
'goods.color_name'
,
''
),
size
:
_
.
get
(
item
,
'goods.size_name'
,
''
),
comment
:
item
.
content
,
total
:
pageResponse
.
totalCount
};
...
...
apps/product/models/detail-service.js
View file @
889f7b8
...
...
@@ -896,8 +896,6 @@ const _sizeInfoBoSort = (sizeInfoBo) => {
return
{};
}
// TODO: 这里的排序代码很乱
_
.
get
(
sizeInfoBo
,
'sizeBoList'
,
[]).
forEach
((
sizeBoList
,
sizek
)
=>
{
let
sortAttr
=
{};
...
...
apps/product/models/outlets-handler.js
View file @
889f7b8
...
...
@@ -110,17 +110,14 @@ const categoryNavigation = (data, params) => {
* @return {[array]}
*/
exports
.
processFloor
=
(
list
,
params
)
=>
{
const
formatData
=
[]
;
const
formatData
=
{}
;
let
floorData
;
list
=
list
||
[];
// TODO:
list
=
camelCase
(
list
);
// 格式化数据
_
.
forEach
(
list
,
(
floor
)
=>
{
switch
(
floor
.
template
N
ame
)
{
switch
(
floor
.
template
_n
ame
)
{
case
'NL2R'
:
floorData
=
{
topBanner
:
floor
.
data
};
break
;
...
...
apps/product/models/sale.js
View file @
889f7b8
...
...
@@ -73,17 +73,16 @@ exports.getSaleGoodsData = (params) => {
// 处理 VIP 商品数据
if
(
result
[
1
].
code
===
200
)
{
// TODO:
let
userInfo
=
result
[
1
].
data
.
vip_info
?
camelCase
(
result
[
1
].
data
.
vip_info
)
:
{};
let
vipInfo
=
_
.
get
(
result
,
'[1].data.vip_info'
,
{});
if
(
_
.
isEmpty
(
user
Info
))
{
if
(
_
.
isEmpty
(
vip
Info
))
{
logger
.
info
(
'no user info'
);
}
if
(
params
.
saleType
===
'2'
)
{
_
.
forEach
(
finalResult
.
goods
,
(
value
,
key
)
=>
{
switch
(
userInfo
.
curL
evel
)
{
switch
(
vipInfo
.
cur_l
evel
)
{
case
'1'
:
finalResult
.
goods
[
key
].
salesPrice
=
value
.
vip1Price
;
finalResult
.
goods
[
key
].
vip1
=
true
;
...
...
@@ -193,13 +192,15 @@ exports.getSaleIndexData = (channel) => {
if
(
result
[
4
].
code
===
200
)
{
let
breakingSizeSort
=
saleHandler
.
handleSaleBreakingSizeData
(
result
[
4
].
data
);
return
api
.
all
([
saleApi
.
getSaleGoodsList
({
channel
:
channel
,
saleType
:
'5'
,
// app 与 pc 有冲突,为 PC 加一个 5 的选项
limit
:
'1'
,
breakSize
:
breakingSizeSort
.
breakSize
,
breakSort
:
breakingSizeSort
.
breakSort
})]).
then
(
subResult
=>
{
return
api
.
all
([
saleApi
.
getSaleGoodsList
({
channel
:
channel
,
saleType
:
'5'
,
// app 与 pc 有冲突,为 PC 加一个 5 的选项
limit
:
'1'
,
breakSize
:
breakingSizeSort
.
breakSize
,
breakSort
:
breakingSizeSort
.
breakSort
})
]).
then
(
subResult
=>
{
if
(
subResult
[
0
].
code
===
200
)
{
finalResult
.
saleCategory
.
push
(
saleHandler
.
handleSaleCategoryData
(
...
...
@@ -316,17 +317,16 @@ exports.getSaleOthersData = (params, channel) => {
if
(
!
_
.
isEmpty
(
result
[
4
]))
{
// 处理 VIP 商品数据
// TODO:
if
(
result
[
4
].
code
===
200
&&
parseInt
(
params
.
saleType
,
10
)
===
2
)
{
let
userInfo
=
result
[
4
].
data
.
vip_info
?
camelCase
(
result
[
4
].
data
.
vip_info
)
:
{}
;
let
vipInfo
=
_
.
get
(
result
,
'[4].data.vip_info'
,
{})
;
if
(
_
.
isEmpty
(
user
Info
))
{
if
(
_
.
isEmpty
(
vip
Info
))
{
logger
.
info
(
'no user info'
);
}
_
.
forEach
(
finalResult
.
goods
,
(
value
,
key
)
=>
{
switch
(
userInfo
.
curL
evel
)
{
switch
(
vipInfo
.
cur_l
evel
)
{
case
'1'
:
finalResult
.
goods
[
key
].
salesPrice
=
value
.
vip1Price
;
finalResult
.
goods
[
key
].
vip1
=
true
;
...
...
config/common.js
View file @
889f7b8
...
...
@@ -16,9 +16,9 @@ module.exports = {
siteUrl
:
'http://www.yohobuy.com'
,
domains
:
{
favApi
:
'http://192.168.102.31:8092/brower'
,
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
search
:
'http://192.168.102.216:8080/yohosearch/'
api
:
'http://api.yoho.yohoops.org/'
,
service
:
'http://service.yoho.yohoops.org/'
,
search
:
'http://search.yohoops.org/yohosearch/'
},
subDomains
:
{
host
:
'.yohobuy.com'
,
...
...
doraemon/models/header.js
View file @
889f7b8
...
...
@@ -49,11 +49,8 @@ const getNavBar = (data, type) => {
let
navBars
=
[];
_
.
forEach
(
data
,
item
=>
{
let
obj
=
{},
// TODO:
lowEn
=
_
.
camelCase
(
item
.
sort_name_en
).
toLowerCase
();
let
obj
=
{};
let
lowEn
=
_
.
camelCase
(
item
.
sort_name_en
).
toLowerCase
();
obj
.
link
=
item
.
sort_url
;
obj
.
cn
=
item
.
sort_name
;
...
...
@@ -142,7 +139,6 @@ const getSubNav = (data, type) => {
let
subNav
=
[];
_
.
forEach
(
data
,
it
=>
{
// TODO:
if
(
type
===
_
.
camelCase
(
it
.
sort_name_en
).
toLowerCase
())
{
_
.
forEach
(
it
.
sub
,
item
=>
{
let
obj
=
{};
...
...
utils/resources-process.js
View file @
889f7b8
...
...
@@ -14,7 +14,6 @@ module.exports = (list) => {
list
=
camelCase
(
list
);
_
.
forEach
(
list
,
(
floor
)
=>
{
// TODO:
floor
[
_
.
camelCase
(
floor
.
templateName
)]
=
true
;
// 特殊资源位处理
...
...
Please
register
or
login
to post a comment