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
郭成尧
9 years ago
Commit
88e5a383a7c6dc3af03ad92074718edcb9f7a248
1 parent
97837b22
'shop-category-ok'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
9 deletions
apps/product/controllers/list.js
apps/product/models/list.js
apps/product/views/action/shop/category.hbs
public/js/product/search/list.js
apps/product/controllers/list.js
View file @
88e5a38
...
...
@@ -366,6 +366,7 @@ const shopCategory = (req, res, next) => {
}).
then
(
result
=>
{
res
.
render
(
'shop/category'
,
{
content
:
result
,
allProduct
:
result
.
allProduct
,
module
:
'product'
,
page
:
'category'
,
pageHeader
:
headerModel
.
setNav
({
...
...
apps/product/models/list.js
View file @
88e5a38
...
...
@@ -11,6 +11,17 @@ const helpers = global.yoho.helpers;
const
api
=
global
.
yoho
.
API
;
const
searchModel
=
require
(
'./search'
);
/**
* 频道
* @type {{}}
*/
const
yhChannel
=
{
boys
:
1
,
girls
:
2
,
kids
:
3
,
lifestyle
:
4
};
/* 多品牌店铺列表数据信息处理*/
const
_processBrandShops
=
(
list
)
=>
{
const
formatDat
=
[];
...
...
@@ -122,7 +133,7 @@ const _getShopInfo = (shopId, uid) => {
const
_getShopCategory
=
(
shopId
,
channel
,
gender
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.shop.getSortInfo'
,
yh_channel
:
channel
,
yh_channel
:
yhChannel
[
channel
]
,
gender
:
gender
||
'1,3'
,
shop_id
:
shopId
}).
then
(
result
=>
{
...
...
@@ -672,10 +683,9 @@ const getShopCategory = (params) => {
});
_
.
forEach
(
value
.
sub
,
(
subValue
,
subKey
)
=>
{
value
.
sub
[
subKey
].
url
=
helpers
.
urlFormat
({
shop
:
params
.
shopId
,
categoryId
:
value
.
categoryId
,
subCategoryId
:
subValue
.
categoryId
,
value
.
sub
[
subKey
].
url
=
helpers
.
urlFormat
(
'/product/search/list'
,
{
shop_id
:
params
.
shopId
,
sort
:
_
.
get
(
value
,
'relationParameter.sort'
,
''
),
title
:
subValue
.
categoryName
,
query
:
subValue
.
categoryName
});
...
...
@@ -686,7 +696,7 @@ const getShopCategory = (params) => {
});
});
finalResult
.
all
product
=
helpers
.
urlFormat
(
'
/search/list'
,
{
finalResult
.
all
Product
=
helpers
.
urlFormat
(
'/product
/search/list'
,
{
shop_id
:
params
.
shopId
});
...
...
apps/product/views/action/shop/category.hbs
View file @
88e5a38
<div
class=
"product-category yoho-page"
>
<div
id=
"allproduct"
class=
"allproduct"
>
<a
href=
{{
all
p
roduct
}}
>
<a
href=
{{
all
P
roduct
}}
>
<p
class=
"allproductParagaraph buriedpoint"
data-bp-id =
"shop_category_all_1"
>
全部商品
</p>
<i
class=
"arrow-icon iconfont"
>

</i>
</a>
...
...
public/js/product/search/list.js
View file @
88e5a38
...
...
@@ -33,7 +33,7 @@ var $input = $('#search-input input'),
$buriedpoint
=
$
(
'.buriedpoint'
),
$search
=
$
(
'#search'
);
var
shopId
,
sort
,
brand
,
outlets
,
app_type
;
var
shopId
,
sort
,
brand
,
outlets
,
app_type
,
age_level
,
msort
,
misort
;
// 默认筛选条件
var
defaultOpt
=
require
(
'../../common/query-param'
);
...
...
@@ -194,7 +194,8 @@ sort = getQueryString('sort');
outlets
=
getQueryString
(
'outlets'
);
age_level
=
getQueryString
(
'ageLevel'
);
app_type
=
getQueryString
(
'app_type'
);
msort
=
getQueryString
(
'msort'
);
misort
=
getQueryString
(
'misort'
);
/**
* 筛选注册的回调,筛选子项点击后逻辑
* 需要执行search的场景:1.点选筛选项;2.relaod为true时切换导航;3.下拉加载
...
...
@@ -335,6 +336,14 @@ function search(opt) {
params
.
app_type
=
app_type
;
}
if
(
msort
)
{
params
.
msort
=
msort
;
}
if
(
misort
)
{
params
.
misort
=
misort
;
}
$
.
extend
(
setting
,
defaultOpt
,
params
);
searching
=
true
;
...
...
Please
register
or
login
to post a comment