Authored by hongweigao

处理左轮播右2图样式,调接口

... ... @@ -69,7 +69,11 @@ const index = (req) => {
ctyList: []
},
firstLook: {
name: '精彩抢先看'
name: '精彩抢先看',
lookBanner: {
list: []
},
lookTwoImg: []
}
};
... ... @@ -95,9 +99,14 @@ const index = (req) => {
Object.assign(respData.recommond.dataList, dataList);
_.forEach(result[1].data.ads, ads => {
//banner
if (ads.template_name === 'focus') {
Object.assign(respData.slide.list, ads.data);
}
//精彩想先看,左轮播右2图
if (ads.template_name === 'NL2R') {
Object.assign(respData.firstLook.lookTwoImg, ads.data.right);
}
});
}
... ... @@ -139,16 +148,6 @@ const index = (req) => {
// 列表数据
Object.assign(respData.newProduct, _proListHandler(result[3].data, Object.assign({}, params, {channel: channel}) ));
}
respData.firstLook = {
name: '精彩抢先看',
leftUrl: '',
leftSrc: '//img13.static.yhbimg.com/goodsimg/2016/11/08/16/0209f4293037c2c5ca85bf67991b691c9a.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
rtUrl: '',
rtSrc: '//img13.static.yhbimg.com/goodsimg/2016/11/08/16/0209f4293037c2c5ca85bf67991b691c9a.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
rbUrl: '',
rbSrc: '//img13.static.yhbimg.com/goodsimg/2016/11/08/16/0209f4293037c2c5ca85bf67991b691c9a.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90'
};
return respData;
});
};
... ...
... ... @@ -52,38 +52,39 @@
</div>
{{/newBrand}}
{{#firstLook}}
<!--<div class="firstLook-floor clearfix">-->
<!--{{> common/floor-header}}-->
<!--<div class="left-one">-->
<!--<a class="first-left-img" href="{{leftUrl}}" target="_blank">-->
<!--<img class="lazy" data-original="{{image leftSrc 785 420}}" style="display: block; opacity: 1;">-->
<!--</a>-->
<!--</div>-->
<!--<div class="right-two">-->
<!--<a class="first-right-img" href="{{rtUrl}}" target="_blank">-->
<!--<img class="lazy" data-original="{{image rtSrc 355 205}}" style="display: block; opacity: 1;">-->
<!--</a>-->
<!--<a class="first-right-img" href="{{rbUrl}}" target="_blank">-->
<!--<img class="lazy" data-original="{{image rbSrc 355 205}}" style="display: block; opacity: 1;">-->
<!--</a>-->
<!--</div>-->
<!--</div>-->
<div class="slider-wrap clearfix">
<div class="slider-left pull-left">
<div class="firstLook-floor clearfix">
{{> common/floor-header}}
{{#lookBanner}}
<div class="left-one">
<div class="slide-wrapper">
<ul>
{{#largeSlideImg}}
<li>
<a href="{{url}}"><img src="{{img}}"></a>
{{# list}}
<li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
<a href="{{url}}" target= "_blank">
{{#if @first}}
<img src="{{image src 785 420}}">
{{^}}
<img class="lazy" data-original="{{image src 785 420}}" alt="">
{{/if}}
</a>
{{# tips}}
<div class="slide-tips">
<div class="g-mark"></div>
<p>{{.}}</p>
</div>
{{/ tips}}
</li>
{{/largeSlideImg}}
{{/ list}}
</ul>
</div>
</div>
<div class="slider-right pull-right">
{{#oneRowTwoColImages}}
<a href="{{url}}" class="slider-item"><img src="{{img}}"></a>
{{/oneRowTwoColImages}}
{{/lookBanner}}
<div class="right-two">
{{#lookTwoImg}}
<a class="first-right-img" href="{{url}}" target="_blank">
<img class="lazy" data-original="{{image src 355 205}}" style="display: block; opacity: 1;">
</a>
{{/lookTwoImg}}
</div>
</div>
{{/firstLook}}
... ...
... ... @@ -18,8 +18,8 @@ module.exports = {
domains: {
favApi: 'http://192.168.102.31:8092/brower',
api: 'http://api-test2.yohops.com:9999/',
service: 'http://service-test2.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
... ...
... ... @@ -10,7 +10,7 @@ require('../plugins/slider');
require('yoho-jquery-pjax');
$('.slide-container').slider();
$('.left-one').slider();
var recSwiper = new Swiper('.rec-swiper', {
pagination: '.swiper-pagination',
paginationClickable: true,
... ...
... ... @@ -74,17 +74,25 @@
.firstLook-floor {
.left-one {
width: 785px;
height: 420px;
position: relative;
margin-right: 10px;
float: left;
.first-left-img {
.slide-wrapper {
height: 420px;
display: block;
}
> img {
width: 100%;
height: 100%;
}
.slide-wrapper li a {
width: 100%;
}
.slide-switch a.prev {
margin-left: -392px;
}
.slide-switch a.next {
margin-right: -392px;
}
}
... ... @@ -357,9 +365,18 @@
.firstLook-floor {
.left-one {
width: 675px;
height: 361px;
.slide-wrapper {
height: 361px;
}
.slide-switch a.prev {
margin-left: -328px;
}
.first-left-img {
height: 584px;
.slide-switch a.next {
margin-right: -328px;
}
}
... ... @@ -367,7 +384,7 @@
width: 305px;
.first-right-img {
height: 287px;
height: 176px;
}
}
}
... ...