Authored by shuaiguo

Merge branch 'develop'

... ... @@ -2,7 +2,7 @@
<div class="home-page yoho-page brands" data-page="brands">
{{# brands}}
<div class="sit-nav">
<a href="#">BOYS首页</a><span class="sep">></span><a href="#">品牌一览</a>
<a href="#">首页</a><span class="sep">></span><a href="#">品牌一览</a>
</div>
<div class="brands-tabs height-initial">
<ul class="clearfix">
... ...
... ... @@ -41,8 +41,16 @@ exports.index = (req, res, next) => {
logger.debug(`decodeURIComponent query fail:${e.toString()}`);
}
let channel = req.query.channel || 'boys';
if (req.url.indexOf('gd2') > -1) {
channel = 'girls';
} else if (req.url.indexOf('gd1') > -1) {
channel = 'boys';
}
req.ctx(list).getListData(Object.assign(req.query, {uid: req.user.uid, prid: req.user.prid}),
req.yoho.channel).then(result => {
channel || req.yoho.channel).then(result => {
Object.assign(resData, result, {
pageClass: 'static-list-page'
});
... ... @@ -77,8 +85,10 @@ exports.index = (req, res, next) => {
*/
exports.new = (req, res, next) => {
let resData = {};
const channel = req.query.channel || 'boys';
req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), req.yoho.channel).then(result => {
// eslint-disable-next-line max-len
req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), channel || req.yoho.channel).then(result => {
Object.assign(resData, result, {
hideInfo: {from: 'newProduct'},
pageClass: 'static-list-page'
... ... @@ -100,7 +110,7 @@ exports.new = (req, res, next) => {
* @return {[type]} [description]
*/
exports.newWithChannel = (req, res, next) => {
let channel = req.pathChannel || req.yoho.channel;
let channel = req.query.channel || req.pathChannel || req.yoho.channel;
req.query = req.query || {};
... ...
... ... @@ -63,4 +63,18 @@ exports.escapeLength = function(value) {
return strs.join('');
};
exports.getHref = function(url, name) {
name = name.toLowerCase();
if (name === 'boys' || name === 'girls') {
if (url.indexOf('channel=') > -1) {
return url.replace(/(boys|girls)/ig, function() {
return name;
});
} else {
return url.indexOf('?') > -1 ? url + '&channel=' + name : url + '?channel=' + name;
}
} else {
return url;
}
};
... ...
... ... @@ -43,7 +43,7 @@
<div class="attr-content clearfix">
{{#each gender}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}" name="{{name}}">
<a class="attr {{#if checked}}checked{{/if}}" href="{{{getHref href name}}}" name="{{name}}">
{{name}}
</a>
{{/each}}
... ...
{
"name": "yohobuy-node",
"version": "6.10.1",
"version": "6.10.6",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -4,7 +4,7 @@ module.exports = function() {
var _channel = { // eslint-disable-line
boys: {
url: '//www.yohobuy.com',
name: 'BOYS首页'
name: '首页'
},
girls: {
url: '//new.yohobuy.com/woman',
... ...
... ... @@ -391,10 +391,11 @@
width: 100%;
.main-nav-list {
display: inline-block;
/* display: inline-block; */
vertical-align: top;
padding-top: 45px;
float: left;
display: none;
li {
float: left;
... ...