Authored by yyq

品牌介绍

... ... @@ -22,7 +22,7 @@ const helpers = global.yoho.helpers;
* @param brand 品牌相关数据
* @return Object
*/
const setBrandBanner = (brand) => {
const _setBrandBanner = (brand) => {
let data = {
bgColor: '#93897d',
brandLogo: {
... ... @@ -34,7 +34,9 @@ const setBrandBanner = (brand) => {
}
};
return data;
return {
brandBanner: data
};
};
/**
... ... @@ -42,7 +44,7 @@ const setBrandBanner = (brand) => {
* @param base 商品基础数据
* @return Object
*/
const setProductData = (base) => {
const _setProductData = (base) => {
let data = {
name: base.productName,
brandName: _.has(base, 'brand.brandName') ? base.brand.brandName : '',
... ... @@ -150,8 +152,25 @@ const setProductData = (base) => {
return data;
};
const _setBrandIntro = (brand) => {
let barndIntro = {};
if (brand) {
barndIntro = {
brand: {
titleEn: 'BRAND',
titleCn: '品牌介绍',
logo: brand.brandIco,
intro: brand.brandIntro
}
}
}
return barndIntro;
}
let getProductItemData = (params) => {
let pid = params[0];
// let gid = params[1];
return Promise.all([
... ... @@ -166,15 +185,17 @@ let getProductItemData = (params) => {
}
if (result[0].brand) {
Object.assign(data, {
brandBanner: setBrandBanner(result[0].brand)
});
Object.assign(data, _setBrandBanner(result[0].brand));
Object.assign(data, _setBrandIntro(result[0].brand));
}
Object.assign(data, {
goodInfo: setProductData(result[0])
goodInfo: _setProductData(result[0])
});
console.log(data);
return data;
});
};
... ...
... ... @@ -96,15 +96,21 @@
{{/ goodInfo}}
<div class="other-info">
{{# brand}}
<div class="info-block">
<div class="block-title">
<label class="title-wrapper">
<span class="en">BRAND</span><br>
<span class="cn">品牌介绍</span>
<span class="en">{{titleEn}}</span><br>
<span class="cn">{{titleCn}}</span>
</label>
</div>
品牌介绍
<div class="intro-block">
<img src="{{image logo 250 84}}">
<div class="intro-text">{{{intro}}}</div>
</div>
</div>
{{/ brand}}
{{# description}}
<div class="info-block">
<div class="block-title">
... ...
... ... @@ -49,7 +49,7 @@
.option-content {
width: 226px;
margin: 0 auto;
padding: 40px 0;
padding: 40px 0 30px;
> p {
line-height: 50px;
... ... @@ -79,6 +79,7 @@
float: left;
padding: 0 12px;
margin-right: 10px;
margin-bottom: 10px;
text-align: center;
border: 1px solid #f0f0f0;
font-weight: bold;
... ... @@ -111,8 +112,25 @@
font-size: 14px;
padding-bottom: 40px;
.intro-block {
padding-left: 270px;
position: relative;
> img {
position: absolute;
top: 50%;
left: 0;
margin-top: -42px;
}
.intro-text img {
display: none;
}
}
.des-basic {
width: 1140px;
li {
float: left;
width: 380px;
... ...