Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhangxiaoru
9 years ago
Commit
96f07f62f52c053c90a13c9b371d35caebff011a
1 parent
ec2a59fb
brand
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
apps/brand/controllers/brand.js
apps/brand/models/brand.js
apps/brand/controllers/brand.js
View file @
96f07f6
...
...
@@ -7,6 +7,11 @@
'use strict'
;
const
brand
=
require
(
'../models/brand'
);
/**
* 品牌一览数据
* @param req
* @param res
*/
const
index
=
(
req
,
res
)
=>
{
let
channel
=
req
.
query
.
brand
||
1
;
let
contentCode
=
'd0149783b8dd2adaf083fd10556c39a9'
;
...
...
apps/brand/models/brand.js
View file @
96f07f6
...
...
@@ -7,6 +7,10 @@ const logger = global.yoho.logger;
const
serviceAPI
=
global
.
yoho
.
ServiceAPI
;
const
config
=
global
.
yoho
.
config
;
/**
* 品牌一览列表数据处理
* @returns {*}
*/
const
_processListData
=
(
list
)
=>
{
let
listData
=
[];
...
...
@@ -36,6 +40,10 @@ const _processListData = (list) => {
return
listData
;
};
/**
* 品牌一览banner数据处理
* @returns {*}
*/
const
_processTabData
=
(
list
)
=>
{
let
tabData
=
[];
...
...
@@ -61,6 +69,11 @@ const _processTabData = (list) => {
};
/**
* 获取品牌banner
* @param channel
* @returns {*}
*/
const
_getResources
=
(
contentCode
)
=>
{
return
serviceAPI
.
get
(
'operations/api/v5/resource/get'
,
{
content_code
:
contentCode
}).
then
((
result
)
=>
{
if
(
result
&&
result
.
code
===
200
)
{
...
...
@@ -72,6 +85,11 @@ const _getResources = (contentCode) => {
});
};
/**
* 获取品牌列表数据
* @param channel
* @returns {*}
*/
const
_getBreakingSort
=
(
channel
)
=>
{
return
api
.
get
(
''
,
{
yo_channel
:
channel
,
...
...
@@ -86,6 +104,10 @@ const _getBreakingSort = (channel) => {
});
};
/**
* 获取品牌一览相关数据
* @returns {*}
*/
const
getListData
=
(
contentCode
,
channel
)
=>
{
return
Promise
.
all
([
_getResources
(
contentCode
),
_getBreakingSort
(
channel
)])
.
then
((
result
)
=>
{
...
...
Please
register
or
login
to post a comment