Authored by yyq

品牌介绍弹窗

... ... @@ -498,13 +498,14 @@ const setBrandIntro = brand => {
if (brand) {
let text = _.replace(brand.brandIntro, /<\/?[^>]*>|\s*|(\n)|(\t)|(\r)/g, ''),
more = `... <a href="/product/shop/${brand.brandDomain}?brandIntro=true" class="blue">了解更多>></a>`;
more = `... <a href="javascript:;" class="more-brand-intro blue">了解更多>></a>`;
barndIntro = {
brand: {
titleEn: 'BRAND',
titleCn: '品牌介绍',
logo: brand.brandIco,
fullIntro: brand.brandIntro,
intro: _.truncate(text, {
length: 300,
omission: more
... ...
... ... @@ -175,6 +175,17 @@
<img src="{{image logo 250 84}}">
<div class="intro-text">{{{intro}}}</div>
</div>
<div id="intro-full-hide" class="hide">
<div class="full-intro-title">
<h2>{{titleEn}}</h2>
<h5>{{titleCn}}</h5>
</div>
<div class="full-intro-text nano">
<div class="nano-content">
{{{fullIntro}}}
</div>
</div>
</div>
</div>
{{/ brand}}
... ...
... ... @@ -36,8 +36,10 @@ var noticeFn = handlebars.compile($('#arrival-notice-tpl').html() || ''),
noticeSuccFn = handlebars.compile($('#arrival-notice-success-tpl').html() || '');
var thumbsLoaded = [],
id = $main.data('id');
id = $main.data('id'),
introHtml;
require('yoho-jquery-nanoscroller');
require('../plugins/share');
require('../common/header');
require('../common/return-top');
... ... @@ -324,6 +326,15 @@ $('#collect-product').click(function() {
});
});
$('.more-brand-intro').click(function() {
new Dialog({
className: 'item-more-intro-dialog',
content: introHtml,
btns: []
}).show();
$('.full-intro-text').nanoScroller();
});
$sizeInfo.on('click', '.show-img', function() {
var img = $sizeInfo.data('img');
... ... @@ -334,4 +345,10 @@ $sizeInfo.on('click', '.show-img', function() {
}).show();
});
if ($(window).height() < 800) {
$('.full-intro-text').addClass('min-height');
}
introHtml = $('#intro-full-hide').html();
chooseDefaultSize(); // 如果size只有一个则默认选中
... ...
... ... @@ -523,3 +523,35 @@
width: 600px;
}
}
.item-more-intro-dialog {
.content {
width: 850px;
text-align: left;
}
.full-intro-title {
margin: 0 0 50px;
h2 {
font-size: 18px;
font-weight: 700;
padding: 10px 0;
}
}
.full-intro-text {
height: 500px;
font-size: 14px !important;
line-height: 1.5;
overflow-x: hidden;
.nano-content {
padding: 0 4px;
}
}
.min-height {
height: 250px;
}
}
... ...