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
hongweigao
8 years ago
Commit
03133761bf8059da98f7777371d2cd4e4cf6b078
1 parent
4f4702b2
添加brands\plusster页面的seo
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
apps/brands/models/brands-model.js
apps/brands/models/brands-service.js
apps/brands/models/brands-model.js
View file @
0313376
...
...
@@ -11,7 +11,8 @@ const co = Promise.coroutine;
const
_
=
require
(
'lodash'
);
const
helpers
=
global
.
yoho
.
helpers
;
const
brandApi
=
require
(
'./brands-api'
);
const
serviceApi
=
global
.
yoho
.
ServiceAPI
;
const
serviceApi
=
global
.
yoho
.
ServiceAPI
const
seo
=
require
(
`
$
{
global
.
utils
}
/seo`
)
;
// 品牌一览资源位CODE码
const
channelCode
=
{
...
...
@@ -25,6 +26,7 @@ const channelCode = {
brand_plusstarindex_boys
:
'a833aed63d28457156310e97faa7fa37'
,
// plusstarindex男首资源位
brand_plusstarindex_girls
:
'6e4f162be3b3ba44f3bfcf1c38bdb745'
// plusstarindex女首资源位
};
const
BOYS
=
'boys'
;
const
GIRLS
=
'girls'
;
const
KIDS
=
'kids'
;
...
...
@@ -102,14 +104,14 @@ const getBrandViewTop = channel => {
// 头部品牌图块,广告位
if
(
res
.
data
[
0
].
data
)
{
_
.
forEach
(
res
.
data
[
0
].
data
,
subValue
=>
{
_
.
forEach
(
res
.
data
[
0
].
data
,
(
subValue
,
k
)
=>
{
let
srcUrl
;
// kids lifestyle 第一张图尺寸不同
if
(
switchParams
.
channelType
===
1
||
switchParams
.
channelType
===
2
)
{
srcUrl
=
helpers
.
image
(
subValue
.
src
,
222
,
180
,
3
);
}
else
{
srcUrl
=
(
subValue
===
0
)
?
helpers
.
image
(
subValue
.
src
,
570
,
280
,
3
)
:
srcUrl
=
(
k
===
0
)
?
helpers
.
image
(
subValue
.
src
,
570
,
280
,
3
)
:
helpers
.
image
(
subValue
.
src
,
280
,
280
,
3
);
}
brandLogos
.
push
({
...
...
@@ -139,7 +141,6 @@ const getBrandViewTop = channel => {
*/
const
getBrandViewList
=
(
channel
,
start
,
length
)
=>
{
return
co
(
function
*
()
{
let
switchParams
=
switchBrandParams
(
channel
);
let
res
=
yield
brandApi
.
getBrandListData
(
switchParams
.
channelType
);
...
...
apps/brands/models/brands-service.js
View file @
0313376
...
...
@@ -13,6 +13,33 @@ const brandsModel = require('./brands-model');
const
_
=
require
(
'lodash'
);
const
helpers
=
global
.
yoho
.
helpers
;
const
pager
=
require
(
`
$
{
global
.
utils
}
/pager`
)
.setPager
;
// 添加网站的SEO
const
seoMap
=
{
boys
:{
title
:
'品牌一览|男装品牌排行榜,男装品牌大全|YOHO!BUY 有货 100%正品保证'
,
keywords
:
'品牌一览,男装品牌,男装品牌排行榜,男装品牌大全,YOHO!BUY 有货'
,
description
:
'YOHO!BUY 有货男装品牌一览汇集国内国际各大男装品牌大全,为广大爱好时尚的男士青年提供品牌男装、'
+
'休闲男装、商务男装.YOHO!BUY 有货,100%正品保证'
},
girls
:{
title
:
'品牌一览|女装品牌排行榜,女装品牌大全|YOHO!BUY 有货 100%正品保证'
,
keywords
:
'品牌一览,女装品牌,女装品牌排行榜,女装品牌大全,YOHO!BUY 有货'
,
description
:
'YOHO!BUY 有货女装品牌一览汇集国内国际各大女装品牌,为广大爱美女生提供品牌女装、休闲女装、'
+
'商务女装.买品牌女装就上YOHO!BUY 有货,100%正品保证'
},
kids
:{
title
:
'品牌一览|童装童鞋品牌,儿童鞋包配饰排行榜,潮童品牌大全|YOHO!BUY 有货 100%正品保证'
,
keywords
:
'童装品牌,童装童鞋排行榜,儿童鞋包配饰排行榜,潮童品牌大全,品牌一览,YOHO!BUY 有货'
,
description
:
'YOHO!BUY 有货童装品牌一览汇集国内国际各大童装品牌大全,为广大爱好潮流的儿童提供品牌童装、童鞋,'
+
'儿童鞋包配饰.YOHO!BUY 有货,100%正品保证'
},
lifestyle
:{
title
:
'品牌一览|数码3c,居家,玩具娱乐,文具,美妆品牌|YOHO!BUY 有货 100%正品保证'
,
keywords
:
'数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌'
,
description
:
'YOHO!BUY 有货女装品牌一览汇集国内国际各大数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,'
+
'美妆品牌.买创意生活家居就上YOHO!BUY 有货,100%正品保证'
}
}
/**
* 获取品牌一览list
...
...
@@ -24,7 +51,7 @@ exports.getBrandViewList = (channel) => {
let
apiMethod
=
[
headerModel
.
requestHeaderData
(
channel
),
brandsModel
.
getBrandViewTop
(
channel
),
brandsModel
.
getBrandViewList
(
channel
,
1
,
5
)
//分屏加载
brandsModel
.
getBrandViewList
(
channel
,
1
,
5
)
//
分屏加载
];
return
api
.
all
(
apiMethod
).
then
(
result
=>
{
...
...
@@ -40,6 +67,9 @@ exports.getBrandViewList = (channel) => {
responseData
.
brands
=
result
[
1
];
responseData
.
brands
.
navigation
=
result
[
2
].
navigation
;
responseData
.
brands
.
category
=
result
[
2
];
//SEO
Object
.
assign
(
responseData
,
seoMap
[
channel
]);
return
responseData
;
});
};
...
...
@@ -155,6 +185,9 @@ exports.plusstarList = (channel, req) => {
// 页码
Object
.
assign
(
responseData
,
pageList
);
//SEO
Object
.
assign
(
responseData
,
seoMap
[
channel
]);
return
responseData
;
})();
...
...
Please
register
or
login
to post a comment