Authored by yyq

品牌简介node处理

@@ -417,12 +417,18 @@ const setBrandIntro = brand => { @@ -417,12 +417,18 @@ const setBrandIntro = brand => {
417 let barndIntro = {}; 417 let barndIntro = {};
418 418
419 if (brand) { 419 if (brand) {
  420 + let text = _.replace(brand.brandIntro, /<\/?[^>]*>|\s*|(\n)|(\t)|(\r)/g, ''),
  421 + more = `... <a href="/product/shop/${brand.brandDomain}?brandIntro=true" class="blue">了解更多>></a>`;
  422 +
420 barndIntro = { 423 barndIntro = {
421 brand: { 424 brand: {
422 titleEn: 'BRAND', 425 titleEn: 'BRAND',
423 titleCn: '品牌介绍', 426 titleCn: '品牌介绍',
424 logo: brand.brandIco, 427 logo: brand.brandIco,
425 - intro: brand.brandIntro 428 + intro: _.truncate(text, {
  429 + length: 300,
  430 + omission: more
  431 + })
426 } 432 }
427 }; 433 };
428 } 434 }
@@ -265,8 +265,7 @@ @@ -265,8 +265,7 @@
265 } 265 }
266 266
267 .intro-text { 267 .intro-text {
268 - max-height: 100px;  
269 - overflow: hidden; 268 + line-height: 2;
270 } 269 }
271 } 270 }
272 271