...
|
...
|
@@ -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;
|
|
|
});
|
|
|
|
...
|
...
|
|