Authored by shuaiguo

girls无法获取新的类目

... ... @@ -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}}
... ...