Authored by 郭成尧

Merge branch 'feature/seo2' into 'gray'

guang 详情页去channel



See merge request !1107
... ... @@ -314,15 +314,19 @@ const indexRedirect = (req, res, next) => {
if (id) {
let redirectUrl = '/guang/';
if (req.yoho.channel !== req.cookies._Channel) {
redirectUrl += `${req.yoho.channel}-`;
}
// if (req.yoho.channel !== req.cookies._Channel) {
// redirectUrl += `${req.yoho.channel}-`;
// }
delete req.query.id;
delete req.query.channel;
let param = qs.stringify(req.query);
if (param) {
param = '?' + param;
}
redirectUrl += `${id}.html${param}`;
res.redirect(301, redirectUrl);
} else {
... ...
... ... @@ -53,11 +53,11 @@
{{/ tags}}
</div>
<div class="good-detail-img">
<a class="good-thumb" href="{{url}}" title="{{seoTitle}}">
<a class="good-thumb" href="{{url}}" title="{{imgAlt}}">
{{#if @root._noLazy}}
<img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/>
<img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
{{else}}
<img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/>
<img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
{{/if}}
</a>
{{# is_soon_sold_out}}
... ... @@ -79,7 +79,7 @@
</div>
<div class="good-detail-text">
<div class="name">
<a href="{{url}}" title="{{seoTitle}}">{{product_name}}</a>
<a href="{{url}}" title="{{imgAlt}}">{{product_name}}</a>
</div>
<div class="price">
{{#if @root.saleViplogin}}
... ...
... ... @@ -314,13 +314,6 @@ function search(opt) {
loading.hideLoadingMask();
window.rePosFooter();
$('.good-detail-text .name').each(function() {
let $this = $(this),
$title = $this.find('a');
$title[0].mlellipsis(2);
});
},
error: function() {
tip.show('网络断开连接了~');
... ...
... ... @@ -233,10 +233,6 @@ exports.processProductList = (list, options) => {
product.similar = true;
}
let seoGender = product.gender ? GENDER[product.gender] + '|' : '';
product.seoTitle = `${product.brand_name}|${seoGender}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line
product.imgAlt = _.compact([product.brand_name, (product.gender ? GENDER[product.gender] : false), product.small_sort_name, product.product_name]).join('|'); // eslint-disable-line
pruductList.push(product);
... ...