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
yyq
8 years ago
Commit
71899878900176c7776e0722e474a4c47a8a1341
1 parent
36cefcb6
sort channel
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
apps/product/models/list.js
apps/product/models/search-api.js
apps/product/models/list.js
View file @
7189987
...
...
@@ -75,7 +75,7 @@ const getListData = (params, channel) => {
// 调用接口
let
apiMethod
=
[
headerModel
.
requestHeaderData
(
channel
),
searchApi
.
getSortList
(
Object
.
assign
({},
{
msort
:
''
,
misort
:
''
})
),
searchApi
.
getSortList
(
{},
channel
),
searchApi
.
getProductList
(
searchParams
,
'categoryList'
)
];
...
...
@@ -171,7 +171,7 @@ const getListNewData = (params, channel) => {
// 调用接口
let
apiMethod
=
[
headerModel
.
requestHeaderData
(
channel
),
searchApi
.
getSortList
(
Object
.
assign
({},
{
msort
:
''
,
misort
:
''
})
),
searchApi
.
getSortList
(
{},
channel
),
searchApi
.
getProductList
(
Object
.
assign
(
searchParams
),
'newProduct'
),
searchApi
.
getWeekNew
(
params
)
];
...
...
apps/product/models/search-api.js
View file @
7189987
...
...
@@ -129,7 +129,7 @@ const getSortListOrig = (finalParams) => api.get('', finalParams, config.apiCach
* 获取分类列表
* @return
*/
const
getSortList
=
(
params
)
=>
{
const
getSortList
=
(
params
,
channel
)
=>
{
let
finalParams
=
{
method
:
'web.regular.groupsort.sale'
,
sales
:
'Y'
,
// 在销售商品分类
...
...
@@ -139,6 +139,25 @@ const getSortList = (params) => {
Object
.
assign
(
finalParams
,
params
);
if
(
channel
)
{
switch
(
channel
)
{
case
'boys'
:
finalParams
.
yh_channel
=
1
;
break
;
case
'girls'
:
finalParams
.
yh_channel
=
2
;
break
;
case
'kids'
:
finalParams
.
yh_channel
=
3
;
break
;
case
'lifestyle'
:
finalParams
.
yh_channel
=
4
;
break
;
default
:
break
;
}
}
if
(
!
config
.
useCache
)
{
return
getSortListOrig
(
finalParams
);
}
else
{
...
...
Please
register
or
login
to post a comment