Authored by baoss

标题改变tab显示问题 review by guoshuai

... ... @@ -32,7 +32,10 @@ module.exports = class extends global.yoho.BaseModel {
super(ctx);
this.searchApi = new SearchApi(ctx);
this.getGoodsFloor = {
最新上架: 'newArrivls',
新增导航: 'newFloor'
};
this.floorMap = {
slide: this._getSlideData.bind(this),
hot: this._getHotGoodsFloorData.bind(this),
... ... @@ -42,7 +45,8 @@ module.exports = class extends global.yoho.BaseModel {
'BOY KIDS': this._getSingleHotFloorData.bind(this),
ACCESSORIES: this._getSingleHotFloorData.bind(this),
优选品牌: this._getPreBrandTopData.bind(this),
最新上架: this._getNewGoodsFloorData.bind(this),
最新上架: this._getGoodsFloorData.bind(this),
新增导航: this._getGoodsFloorData.bind(this),
ad: this._getadbannerData.bind(this),
category: this._getCategoryFloorData.bind(this),
accordion: this._getAccordionFloorData.bind(this),
... ... @@ -585,6 +589,25 @@ module.exports = class extends global.yoho.BaseModel {
return this._getGirlsSingleHot(args, type);
}
}
_getGoodsFloorData(args) {
console.log(args);
let name = args[0].data.text;
let floorKey = this.getGoodsFloor[name];
const data = {};
if (!_.isEmpty(args)) {
data[floorKey] = {
floorId: args[0].template_id,
name: name === '最新上架' ? _.replace(name, '最新', '新品') : name,
templateName: floorKey,
navs: []
};
data[floorKey].navs = args[1] ? args[1].data : {};
}
return data;
}
/**
* 组装最新上架楼层数据
... ... @@ -593,6 +616,7 @@ module.exports = class extends global.yoho.BaseModel {
* return obj
*/
_getNewGoodsFloorData(args) {
console.log(args);
const data = {};
if (!_.isEmpty(args)) {
... ... @@ -628,7 +652,7 @@ module.exports = class extends global.yoho.BaseModel {
}
if (resData.floorHeader.name.indexOf('最新上架') >= 0) {
resData = this._getNewGoodsFloorData(args);
resData = this._getGoodsFloorData(args);
}
return resData;
}
... ... @@ -1215,6 +1239,7 @@ module.exports = class extends global.yoho.BaseModel {
* @return {Object}
*/
getContent(type, isJKChannel, poolId) {
let that = this;
let params = {new_device: 'Y'};
const headerModelCtx = new HeaderModel(this.ctx);
... ... @@ -1237,11 +1262,14 @@ module.exports = class extends global.yoho.BaseModel {
data.pageType = type;
data.footerTop = true;
data.channel = processResult.floors.map(function(elem) {
let keyArr = Object.values(that.getGoodsFloor);
let tarKey = Object.keys(elem)[0];
if (elem.newArrivls) {
elem.newArrivls.goods = res[2];
if (keyArr.includes(tarKey)) {
console.log(tarKey);
elem[tarKey].goods = res[2];
console.log(elem[tarKey]);
}
return elem;
});
... ...
... ... @@ -86,6 +86,10 @@
{{# newArrivls}}
{{> commodity}}
{{/ newArrivls}}
{{! 新分类楼层}}
{{# newFloor}}
{{> new-category}}
{{/ newFloor}}
{{! 七个类别列表}}
{{# sevenCategory}}
{{> seven-product}}
... ...
<div class="commodity clearfix" id="newarrivals">
{{> common/floor-header}}
<div class="goods-container clearfix">
{{> product/new-arrivis}}
</div>
</div>
... ...
... ... @@ -24,11 +24,11 @@
</div>
<div id="tab-box">
<ul class="tabs" id="tabs">
{{!-- <ul class="tabs" id="tabs">
{{# pay}}
<li{{#if selected}} class="active"{{/if}}>{{name}}</li>
{{/pay}}
</ul>
</ul> --}}
<ul class="tab-conbox">
{{# pay}}
... ...
... ... @@ -52,6 +52,7 @@ const getMenuData = () => (
* @return {array} 导航数组
*/
const getNavBar = (data, type) => {
// 统一默认为boys
let navBars = [];
_.forEach(data, item => {
... ... @@ -59,16 +60,18 @@ const getNavBar = (data, type) => {
let lowEn = _.camelCase(item.sort_name_en).toLowerCase();
Object.assign(obj, {
type: lowEn,
// type: lowEn,
type: 'boys',
link: item.sort_url,
cn: item.sort_name,
en: item.sort_name_en,
isNewPage: item.is_new_page === 'Y'
});
if (type === lowEn) {
obj.active = true;
}
// if (type === lowEn) {
// obj.active = true;
// }
obj.active = true;
// 奥莱频道显示图片,特殊处理
if (lowEn === 'outlets') {
... ... @@ -169,9 +172,11 @@ const getSubNavGroup = (data, type) => {
let lowEn = _.camelCase(it.sort_name_en).toLowerCase();
subNavGroup.push({
subType: lowEn,
// subType: lowEn,
subType: 'boys',
subNav: subNav,
active: lowEn === type
active: true
// active: lowEn === type
});
});
... ...
... ... @@ -6,9 +6,9 @@
<li style="{{#if bgColor}}background:{{bgColor}}{{/if}}">
<a href="{{url}}" rel="nofollow" target= "_blank" title="{{title}}">
{{#if @first}}
<img src="{{image2 src w=1150 h=450}}" alt="{{title}}-YOHO!BUY有货">
<img src="{{image2 src w=1125 h=420}}" alt="{{title}}-YOHO!BUY有货">
{{^}}
<img class="lazy" data-original="{{image2 src w=1150 h=450}}" alt="{{title}}-YOHO!BUY有货">
<img class="lazy" data-original="{{image2 src w=1125 h=420}}" alt="{{title}}-YOHO!BUY有货">
{{/if}}
</a>
{{# tips}}
... ...
... ... @@ -44,9 +44,7 @@ if ($.inArray(homePage, ['boys', 'girls', 'kids', 'lifestyle']) > -1) {
lazyLoad($('img.lazy'));
if (homePage === 'boys') {
$('.slide-container').slider({
pagination: '.thumb-pagination'
});
$('.slide-container').slider();
} else {
$('.center-col').slider();
$('.slide-container').slider();
... ...
... ... @@ -988,6 +988,6 @@ $(function() {
});
});
actionCover();
// actionCover(); //首次进入去除弹框
actionAddKeyWords();
... ...
... ... @@ -6,7 +6,7 @@
position: absolute;
left: 0;
right: 0;
height: 450px;
height: 430px;
}
.slide-thumb-container {
... ... @@ -15,7 +15,7 @@
.slide-wrapper {
position: relative;
height: 450px;
height: 430px;
overflow: hidden;
ul {
... ... @@ -54,7 +54,7 @@
}
.slide-container-placeholder {
height: 450px;
height: 430px;
width: 100%;
}
... ...
... ... @@ -4,7 +4,7 @@
/* 大banner */
.slide-container {
height: 387px;
height: 370px;
img {
display: block;
... ... @@ -16,7 +16,7 @@
}
.slide-container-placeholder {
height: 387px;
height: 370px;
}
.slide-thumb-container-placeholder {
... ... @@ -25,7 +25,7 @@
/* 大banner大图 */
.slide-wrapper {
height: 387px;
height: 370px;
li {
a {
... ...