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
9e44a86ea2c81bc8b4b1261780c53629080c6095
1 parent
ba7d74a2
逛index tdk
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
apps/guang/controllers/index.js
apps/guang/models/guang-helper.js
apps/guang/controllers/index.js
View file @
9e44a86
...
...
@@ -45,8 +45,9 @@ exports.index = (req, res, next) => {
res
.
set
(
'Cache-Control'
,
'no-cache'
);
}
res
.
render
(
'guang/index'
,
{
title
:
'逛'
+
(
res
.
locals
.
title
||
''
),
let
seoTdk
=
ghelper
.
getIndexSeo
(
req
.
query
,
ret
[
1
]);
res
.
render
(
'guang/index'
,
Object
.
assign
(
seoTdk
,
{
guang
:
{
slider
:
ret
[
0
],
msgTypes
:
ret
[
1
],
...
...
@@ -66,7 +67,7 @@ exports.index = (req, res, next) => {
module
:
'guang'
,
page
:
'guang'
,
headerData
:
ret
[
6
]
&&
ret
[
6
].
headerData
});
})
)
;
}).
catch
(
next
);
};
...
...
apps/guang/models/guang-helper.js
View file @
9e44a86
...
...
@@ -88,9 +88,34 @@ const getArticleUrl = (url, id, channel) => {
return
helpers
.
urlFormat
(
`
/
$
{
id
}.
html
`
,
param
,
'guang'
);
};
const
getIndexSeo
=
(
params
,
tabs
)
=>
{
let
tdk
=
{
title
:
'逛|逛潮流,逛购物,官方授权正品潮流购物中心|YOHO!BUY有货'
,
keywords
:
'逛,逛潮流,逛购物'
,
description
:
'YOHO!BUY有货逛频道,来YOHO!玩潮流!潮搭大解析!年轻人潮流购物中心,中国潮流购物风向标,吴亦凡重磅代言!YOHO!BUY有货100%正品保证,支持货到付款。'
};
params
=
params
||
{};
if
(
params
.
hasOwnProperty
(
'type'
))
{
let
tab
=
_
.
find
(
tabs
,
{
isActive
:
true
});
if
(
tab
&&
tab
.
type
)
{
Object
.
assign
(
tdk
,
{
title
:
`潮流
$
{
tab
.
type
}
-
逛
|
YOHO
!
BUY
有货`
,
keywords
:
`潮流
$
{
tab
.
type
}
`
,
description
:
`
YOHO
!
BUY
有货潮流
$
{
tab
.
type
}
!`
});
}
}
return
tdk
;
};
module
.
exports
=
{
getGenderByCookie
,
getUdid
,
getArticleUrl
getArticleUrl
,
getIndexSeo
};
...
...
Please
register
or
login
to post a comment