Authored by yyq

folder series

... ... @@ -20,6 +20,8 @@ const needParams = ['query', 'msort', 'misort', 'gender', 'shelveTime'];
// 品牌页folder名称
const brandFolderSeries = '经典系列';
const folderTitle = '经典款型';
const seriesTitle = '经典系列';
// 经典店铺list url
const shopListUrl = '/product/shoplist';
... ... @@ -507,23 +509,37 @@ const getAdnav = (params) => {
let resData = {};
return Promise.all([searchApi.getBrandShopFolder(params), searchApi.getBrandShopSeries(params)]).then(result => {
let list = [];
let flist = [];
let slist = [];
if (result[0].code === 200 && result[0].data) {
list = _.concat(list, searchHandler.handleFolderData(result[0].data, params));
flist = searchHandler.handleFolderData(result[0].data, params);
}
if (result[1].code === 200 && result[1].data) {
list = _.concat(list, searchHandler.handleSeriesData(result[1].data, params));
slist = searchHandler.handleSeriesData(result[1].data, params);
}
if (list.length) {
Object.assign(resData, {
picTitle: brandFolderSeries,
list: list
});
}
if (params.shopId) {
resData.floder = flist.length ? {
picTitle: folderTitle,
list: flist
} : {};
resData.series = slist.length ? {
picTitle: seriesTitle,
list: slist
} : {};
} else {
let list = _.concat(flist, slist);
if (list.length) {
Object.assign(resData, {
picTitle: brandFolderSeries,
list: list
});
}
}
return resData;
});
... ...
... ... @@ -223,10 +223,21 @@ $productListNav.find('h3').click(function() {
url: '/product/index/getAdnav',
data: adData
}).then(function(data) {
var $adBox = $('#brand-shop-ad');
var hbc;
if (data) {
$('#brand-shop-ad').html(Handlebars.compile(html)({
picLink: data
}));
hbc = Handlebars.compile(html);
if (adData.shopId) {
$adBox.addClass('shop-ad-nav').html(hbc({
picLink: [data.series, data.floder]
}));
} else {
$adBox.html(hbc({
picLink: data
}));
}
}
});
}
... ...
... ... @@ -85,10 +85,17 @@ $('.shop-query-submit').on('click', function() {
url: '/product/index/getAdnav',
data: {shopId: shopId}
}).then(function(data) {
var $sellRed = $('.sell-recommend');
if (data) {
$adBox.parent().append($adBox);
if ($sellRed && $sellRed.length) {
$sellRed.before($adBox);
} else {
$adBox.parent().append($adBox);
}
$adBox.html(Handlebars.compile(html)({
picLink: data
picLink: [data.series, data.floder]
}));
}
});
... ...
... ... @@ -97,11 +97,23 @@
height: 35px;
line-height: 35px;
color: #000;
font-weight: bold;
border-bottom: 1px solid #ebebeb;
font-size: 12px;
}
.shop-ad-nav > .nav-pic-title {
width: 100%;
height: 25px;
line-height: 25px;
background: #000;
font-size: 14px;
color: #fff;
font-family: "黑体";
padding-left: 14px;
box-sizing: border-box;
margin-bottom: 4px;
}
.pic-nav {
display: block;
... ...
... ... @@ -552,6 +552,25 @@
}
}
.brand-shop-ad {
width: 160px;
margin-top: 16px;
float: left;
.nav-pic-title {
width: 100%;
height: 25px;
line-height: 25px;
background: #000;
font-size: 14px;
color: #fff;
font-family: "黑体";
padding-left: 14px;
box-sizing: border-box;
margin-bottom: 4px;
}
}
.left-modular {
width: 160px;
font-size: 14px;
... ...