Authored by 郭成尧

Merge branch 'feature/seo2' into 'gray'

guang 详情页去channel



See merge request !1107
@@ -314,15 +314,19 @@ const indexRedirect = (req, res, next) => { @@ -314,15 +314,19 @@ const indexRedirect = (req, res, next) => {
314 if (id) { 314 if (id) {
315 let redirectUrl = '/guang/'; 315 let redirectUrl = '/guang/';
316 316
317 - if (req.yoho.channel !== req.cookies._Channel) {  
318 - redirectUrl += `${req.yoho.channel}-`;  
319 - } 317 + // if (req.yoho.channel !== req.cookies._Channel) {
  318 + // redirectUrl += `${req.yoho.channel}-`;
  319 + // }
  320 +
320 delete req.query.id; 321 delete req.query.id;
  322 + delete req.query.channel;
  323 +
321 let param = qs.stringify(req.query); 324 let param = qs.stringify(req.query);
322 325
323 if (param) { 326 if (param) {
324 param = '?' + param; 327 param = '?' + param;
325 } 328 }
  329 +
326 redirectUrl += `${id}.html${param}`; 330 redirectUrl += `${id}.html${param}`;
327 res.redirect(301, redirectUrl); 331 res.redirect(301, redirectUrl);
328 } else { 332 } else {
@@ -53,11 +53,11 @@ @@ -53,11 +53,11 @@
53 {{/ tags}} 53 {{/ tags}}
54 </div> 54 </div>
55 <div class="good-detail-img"> 55 <div class="good-detail-img">
56 - <a class="good-thumb" href="{{url}}" title="{{seoTitle}}"> 56 + <a class="good-thumb" href="{{url}}" title="{{imgAlt}}">
57 {{#if @root._noLazy}} 57 {{#if @root._noLazy}}
58 - <img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/> 58 + <img src="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
59 {{else}} 59 {{else}}
60 - <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{seoTitle}}"/> 60 + <img class="lazy" data-original="{{image2 default_images w=235 h=314 q=60}}" alt="{{imgAlt}}"/>
61 {{/if}} 61 {{/if}}
62 </a> 62 </a>
63 {{# is_soon_sold_out}} 63 {{# is_soon_sold_out}}
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 </div> 79 </div>
80 <div class="good-detail-text"> 80 <div class="good-detail-text">
81 <div class="name"> 81 <div class="name">
82 - <a href="{{url}}" title="{{seoTitle}}">{{product_name}}</a> 82 + <a href="{{url}}" title="{{imgAlt}}">{{product_name}}</a>
83 </div> 83 </div>
84 <div class="price"> 84 <div class="price">
85 {{#if @root.saleViplogin}} 85 {{#if @root.saleViplogin}}
@@ -314,13 +314,6 @@ function search(opt) { @@ -314,13 +314,6 @@ function search(opt) {
314 loading.hideLoadingMask(); 314 loading.hideLoadingMask();
315 315
316 window.rePosFooter(); 316 window.rePosFooter();
317 -  
318 - $('.good-detail-text .name').each(function() {  
319 - let $this = $(this),  
320 - $title = $this.find('a');  
321 -  
322 - $title[0].mlellipsis(2);  
323 - });  
324 }, 317 },
325 error: function() { 318 error: function() {
326 tip.show('网络断开连接了~'); 319 tip.show('网络断开连接了~');
@@ -233,10 +233,6 @@ exports.processProductList = (list, options) => { @@ -233,10 +233,6 @@ exports.processProductList = (list, options) => {
233 product.similar = true; 233 product.similar = true;
234 } 234 }
235 235
236 - let seoGender = product.gender ? GENDER[product.gender] + '|' : '';  
237 -  
238 - product.seoTitle = `${product.brand_name}|${seoGender}${product.small_sort_name}|${product.product_name}|YOHO!BUY有货`; // eslint-disable-line  
239 -  
240 product.imgAlt = _.compact([product.brand_name, (product.gender ? GENDER[product.gender] : false), product.small_sort_name, product.product_name]).join('|'); // eslint-disable-line 236 product.imgAlt = _.compact([product.brand_name, (product.gender ? GENDER[product.gender] : false), product.small_sort_name, product.product_name]).join('|'); // eslint-disable-line
241 237
242 pruductList.push(product); 238 pruductList.push(product);