Showing
2 changed files
with
8 additions
and
3 deletions
@@ -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 | } |
-
Please register or login to post a comment