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
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
8 years ago
Commit
3b76ecccf03c2306e2bdb4b28f5f99ca025cfd4d
1 parent
e68efdeb
shop-list-js
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
10 deletions
apps/product/controllers/new-shop.js
apps/product/models/search.js
apps/product/views/action/newshop/brand.hbs → apps/product/views/action/newshop/shop-brand.hbs
apps/product/views/action/newshop/shop-list.hbs
public/js/product/brand-index.page.js
public/js/product/shop-list.page.js
apps/product/controllers/new-shop.js
View file @
3b76ecc
...
...
@@ -121,14 +121,14 @@ const shop = {
co
(
function
*
()
{
let
banner
=
yield
listModel
.
getBrandBanner
(
brandId
);
let
brandInfo
=
yield
listModel
.
getBrandIntro
(
brandId
,
uid
);
let
goodListApi
=
yield
searchModel
.
getBrandGoods
(
searchParam
);
let
good
s
ListApi
=
yield
searchModel
.
getBrandGoods
(
searchParam
);
let
title
=
brandInfo
.
title
;
let
good
List
=
productProcess
.
processProductList
(
_
.
get
(
good
ListApi
,
'data.product_list'
,
[]));
let
good
sList
=
productProcess
.
processProductList
(
_
.
get
(
goods
ListApi
,
'data.product_list'
,
[]));
brandInfo
.
banner
=
banner
;
res
.
render
(
'newshop/brand'
,
{
res
.
render
(
'newshop/
shop-
brand'
,
{
module
:
'product'
,
page
:
'brand-index'
,
pageHeader
:
headerModel
.
setNav
({
...
...
@@ -141,7 +141,7 @@ const shop = {
description
:
title
+
'|Yoho!Buy有货'
+
title
+
'潮流服饰官方授权店!100%品牌正品保证,支持货到付款。'
,
brandId
:
brandId
,
brandInfo
:
brandInfo
,
newGoods
:
good
List
,
goodsList
:
goods
List
,
shopPage
:
true
,
_noLazy
:
true
,
localCss
:
true
...
...
@@ -153,7 +153,7 @@ const shop = {
* 红人店铺
*/
redShop
(
req
,
res
,
next
)
{
let
shopId
=
req
.
shopInfo
.
shopId
;
// test3 792
let
shopId
=
req
.
shopInfo
.
shopId
;
let
channel
=
req
.
yoho
.
channel
||
'boys'
;
let
uid
=
req
.
user
.
uid
||
0
;
let
udid
=
req
.
sessionID
||
'yoho'
;
...
...
@@ -216,6 +216,37 @@ const shop = {
*/
list
(
req
,
res
,
next
)
{
co
(
function
*
()
{
let
title
=
'商品列表'
;
let
shopId
=
req
.
shopInfo
.
shopId
;
let
searchParam
=
{
isApp
:
req
.
yoho
.
isApp
,
shop_id
:
shopId
,
app_type
:
req
.
query
.
app_type
,
type
:
'default'
,
order
:
'0'
,
page
:
1
};
let
goodsListApi
=
yield
searchModel
.
getShopGoods
(
searchParam
);
let
goodsList
=
productProcess
.
processProductList
(
_
.
get
(
goodsListApi
,
'data.product_list'
,
[]));
res
.
render
(
'newshop/shop-list'
,
{
module
:
'product'
,
page
:
'shop-list'
,
pageHeader
:
headerModel
.
setNav
({
navTitle
:
title
}),
showDownloadApp
:
true
,
pageFooter
:
true
,
title
:
title
+
'|'
+
title
+
'潮流服装服饰-Yoho!Buy有货'
,
keywords
:
title
+
','
+
title
+
'服装服饰,'
+
title
+
'潮流服装服饰'
,
description
:
title
+
'|Yoho!Buy有货'
+
title
+
'潮流服饰官方授权店!100%品牌正品保证,支持货到付款。'
,
shopId
:
shopId
,
goodsList
:
goodsList
,
shopPage
:
true
,
_noLazy
:
true
,
localCss
:
true
});
})().
catch
(
next
);
},
...
...
apps/product/models/search.js
View file @
3b76ecc
...
...
@@ -322,14 +322,28 @@ const getBrandGoods = (params) => {
};
/**
* 搜索店铺的商品
*/
const
getShopGoods
=
(
params
)
=>
{
let
finalParams
=
{
method
:
'app.search.shop'
,
};
finalParams
=
_
.
assign
(
finalParams
,
searchProcess
.
getSearchParamsWithoutMethod
(
params
));
return
api
.
get
(
''
,
finalParams
);
};
/**
* 获取筛选数据
*/
const
getFilterData
=
(
params
)
=>
{
return
co
(
function
*
()
{
let
filterDataResult
=
{};
if
(
params
.
is
BrandShop
===
'Y'
)
{
if
(
params
.
is
ShopBrand
===
'Y'
)
{
// 店铺之品牌
filterDataResult
=
yield
getBrandGoods
(
params
);
}
else
if
(
params
.
isShopList
===
'Y'
)
{
// 无店铺有店铺 ID 的商品列表
filterDataResult
=
yield
getShopGoods
(
params
);
}
else
{
filterDataResult
=
yield
_searchGoods
(
params
);
}
...
...
@@ -604,5 +618,6 @@ module.exports = {
getBrandDomain
,
getSearchKeywordData
,
getSearchKeywordDataById
,
getBrandGoods
getBrandGoods
,
getShopGoods
};
...
...
apps/product/views/action/newshop/brand.hbs → apps/product/views/action/newshop/
shop-
brand.hbs
View file @
3b76ecc
...
...
@@ -37,9 +37,9 @@
<div
id=
"goods-container"
class=
"goods-container"
>
<div
class=
"default-goods container clearfix"
>
{{#
newGoods
}}
{{#
goodsList
}}
{{>
common
/
goods
}}
{{/
newGoods
}}
{{/
goodsList
}}
</div>
</div>
...
...
apps/product/views/action/newshop/shop-list.hbs
0 → 100644
View file @
3b76ecc
<div
class=
"good-list-page yoho-page"
>
{{!--筛选tab--}}
<div
class=
"filter-box"
>
{{>
product
/
filter-tab-new
}}
{{>
common
/
filter
}}
</div>
<div
id=
"goods-container"
class=
"goods-container"
>
<div
class=
"default-goods container clearfix"
>
{{#
goodsList
}}
{{>
common
/
goods
}}
{{/
goodsList
}}
</div>
</div>
{{>
common
/
suspend-cart
}}
<input
type=
"hidden"
id=
"shopId"
value=
{{
shopId
}}
>
</div
>
\ No newline at end of file
...
...
public/js/product/brand-index.page.js
View file @
3b76ecc
...
...
@@ -7,7 +7,7 @@ let productListWithFilterModel =
new
ProductListWithFilter
({
brand_id
:
brandId
,
page
:
2
,
// 首页服务端已经渲染
is
BrandShop
:
'Y'
// 传给 filter,表明调用哪个接口获取筛选面板的数据
is
ShopBrand
:
'Y'
// 传给 filter,表明调用哪个接口获取筛选面板的数据
},
'product/search/brand/goods'
);
productListWithFilterModel
.
getFilter
();
...
...
public/js/product/shop-list.page.js
0 → 100644
View file @
3b76ecc
require
(
'product/shop/shop.page.css'
);
let
ProductListWithFilter
=
require
(
'product/product-list-with-filter'
);
let
shopId
=
$
(
'#shopId'
).
val
();
let
productListWithFilterModel
=
new
ProductListWithFilter
({
shop_id
:
shopId
,
page
:
2
,
// 首页服务端已经渲染
isShopList
:
'Y'
// 传给 filter,表明调用哪个接口获取筛选面板的数据
},
'product/search/brand/goods'
);
productListWithFilterModel
.
getFilter
();
...
...
Please
register
or
login
to post a comment