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
c4e53e1d8e195bdefe8465be86d66da49f7c1a71
2 parents
7337c49f
be6d3763
Merge branch 'master' of
http://git.yoho.cn/fe/yohobuywap-node
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
63 deletions
apps/product/models/list.js
config/cache.js
oneapm.js
package.json
public/js/product/shop/shop.js
apps/product/models/list.js
View file @
c4e53e1
...
...
@@ -526,6 +526,7 @@ const getBaseShopData = (params, shopInfo) => {
const
getShopData
=
(
req
,
shopId
,
uid
,
isApp
)
=>
{
let
shopData
=
{};
let
channel
=
req
.
yoho
.
channel
;
let
brandData
=
[];
return
_getShopInfo
(
shopId
,
uid
).
then
(
shopInfoResult
=>
{
...
...
@@ -536,56 +537,73 @@ const getShopData = (req, shopId, uid, isApp) => {
};
}
return
Promise
.
all
([
_getShopDecorator
(
shopId
),
searchModel
.
getFilterSearchData
({
shop_id
:
shopId
,
channel
:
channel
}),
_shopCouponsList
(
shopId
,
uid
)
]).
then
((
result
)
=>
{
shopData
=
{
decorator
:
result
[
0
],
// 店铺装修资源数据
shopInfo
:
shopInfoResult
// 店铺信息
};
return
_getShopDecorator
(
shopId
).
then
(
shopDeco
=>
{
return
shopDeco
;
}).
then
(
shopDeco
=>
{
let
brandBrowseData
;
// 取店铺下的brand, id
_
.
forEach
(
shopDeco
.
list
,
floor
=>
{
if
(
floor
.
resource_name
===
'brandBrowse'
)
{
brandBrowseData
=
JSON
.
parse
(
floor
.
resource_data
);
_
.
forEach
(
brandBrowseData
,
brandBrowse
=>
{
brandData
.
push
(
brandBrowse
.
id
);
});
}
});
/* 获取一次分类和商品数据 */
let
shopFilterSearchData
=
{
filter
:
[],
goods
:
[]
};
return
Promise
.
all
([
searchModel
.
getFilterSearchData
({
shop_id
:
shopId
,
brand
:
brandData
.
join
(
','
),
order
:
'0'
,
channel
:
channel
}),
_shopCouponsList
(
shopId
,
uid
)
]).
then
((
result
)
=>
{
shopData
=
{
decorator
:
shopDeco
,
// 店铺装修资源数据
shopInfo
:
shopInfoResult
// 店铺信息
};
if
(
result
[
1
])
{
shopFilterSearchData
.
filter
=
productProcess
.
processFilter
(
result
[
1
].
filter
||
[]);
shopFilterSearchData
.
goods
=
productProcess
.
processProductList
(
result
[
1
].
product_list
||
[],
{
isApp
:
isApp
});
}
/* 获取一次分类和商品数据 */
let
shopFilterSearchData
=
{
filter
:
[],
goods
:
[]
};
/* 店鋪優惠券 */
let
shopCoupons
=
result
[
2
]
||
[];
// 店铺分类
return
_getShopCategory
(
shopId
,
channel
).
then
(
shopCategory
=>
{
shopData
=
_
.
assign
({
shopCategory
:
shopCategory
},
shopData
);
// noinspection JSCheckFunctionSignatures
return
Object
.
assign
(
_formShopData
(
shopData
,
shopId
,
isApp
),
shopFilterSearchData
,
{
shopId
:
shopId
,
uid
:
uid
?
crypto
.
encryption
(
''
,
uid
+
''
)
:
''
,
coverChannel
:
channel
,
shopCoupons
:
shopCoupons
,
shopCouponsOne
:
shopCoupons
.
length
===
1
}
);
if
(
result
[
0
])
{
shopFilterSearchData
.
filter
=
productProcess
.
processFilter
(
result
[
0
].
filter
||
[]);
shopFilterSearchData
.
goods
=
productProcess
.
processProductList
(
result
[
0
].
product_list
||
[],
{
isApp
:
isApp
});
}
/* 店铺优惠券 */
let
shopCoupons
=
result
[
1
]
||
[];
// 店铺分类
return
_getShopCategory
(
shopId
,
channel
).
then
(
shopCategory
=>
{
shopData
=
_
.
assign
({
shopCategory
:
shopCategory
},
shopData
);
// noinspection JSCheckFunctionSignatures
return
Object
.
assign
(
_formShopData
(
shopData
,
shopId
,
isApp
),
shopFilterSearchData
,
{
shopId
:
shopId
,
uid
:
uid
?
crypto
.
encryption
(
''
,
uid
+
''
)
:
''
,
coverChannel
:
channel
,
shopCoupons
:
shopCoupons
,
shopCouponsOne
:
shopCoupons
.
length
===
1
}
);
});
});
});
});
};
/**
...
...
config/cache.js
View file @
c4e53e1
...
...
@@ -26,7 +26,8 @@ const cachePage = {
'/guang/author/index'
:
1
*
MINUTE
,
'/guang/tags/index'
:
1
*
MINUTE
,
'/guang/plustar'
:
1
*
MINUTE
,
'/guang/plustar/brandinfo'
:
1
*
MINUTE
,
// '/guang/plustar/brandinfo': 1 * MINUTE,
'/guang/star'
:
1
*
MINUTE
,
...
...
oneapm.js
deleted
100644 → 0
View file @
7337c49
/**
* OneAPM agent configuration
*/
const
commonConfig
=
require
(
'./config/common'
);
exports
.
config
=
{
app_name
:
[
commonConfig
.
appName
],
license_key
:
'BwEGA1dRDlQ6357HHQ1AD1xJVkbc9fNfWRtQUwhQG41c5QFWGFIDSQoHc0e8AgMaUlcUVw0='
,
logging
:
{
level
:
'info'
},
transaction_events
:
{
enabled
:
true
}
};
package.json
View file @
c4e53e1
...
...
@@ -39,7 +39,7 @@
"request-promise"
:
"^3.0.0"
,
"serve-favicon"
:
"^2.3.0"
,
"uuid"
:
"^2.0.3"
,
"yoho-node-lib"
:
"0.1.2
8
"
,
"yoho-node-lib"
:
"0.1.2
9
"
,
"yoho-zookeeper"
:
"^1.0.3"
},
"devDependencies"
:
{
...
...
public/js/product/shop/shop.js
View file @
c4e53e1
...
...
@@ -101,7 +101,7 @@ var $listNav = $('#list-nav'),
end
:
false
},
newest
:
{
order
:
1
,
order
:
0
,
reload
:
true
,
page
:
0
,
end
:
false
...
...
Please
register
or
login
to post a comment