Authored by zhangxiaoru

merge feature/brandsTree

... ... @@ -164,7 +164,6 @@ const _getBrandListOriginData = (channel) => {
} else {
return {};
}
});
};
... ... @@ -246,12 +245,12 @@ const indexData = (gender, brandCode, cateCode) => {
if (result[1]) {
_.forEach(result[1], function(data) {
if (data.focus_type && data.focus_type === '1') {
//brandList.bannerTop = _dealBrandUrl(data);
// brandList.bannerTop = _dealBrandUrl(data);
brandList.bannerTop = data;
} else if (data.focus_type && data.focus_type === '2') {
//brandList.focusData = _dealBrandUrl(data).data;
// brandList.focusData = _dealBrandUrl(data).data;
brandList.focusData = data.data;
} else if (data.template_intro === '一张图片') {
} else if (data.template_name === 'single_image') {
brandList.bannerTop = data;
}
});
... ... @@ -296,12 +295,12 @@ const brandListData = (code, gender) => {
if (result[0]) {
_.forEach(result[0], function(data) {
if (data.focus_type && data.focus_type === '1') {
//brandList.bannerTop = _dealBrandUrl(data);
// brandList.bannerTop = _dealBrandUrl(data);
brandList.bannerTop = data;
} else if (data.focus_type && data.focus_type === '2') {
//brandList.focusData = _dealBrandUrl(data).data;
// brandList.focusData = _dealBrandUrl(data).data;
brandList.focusData = data.data;
} else if (data.template_intro === '一张图片') {
} else if (data.template_name === 'single_image') {
brandList.bannerTop = data;
}
});
... ...
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper2');
var bannerSwiper,
categoryHeight = $('.tab-box').height(),
var categoryHeight = $('.tab-box').height(),
gender,
isBrand;
... ... @@ -16,7 +15,25 @@ function channels(key) {
'women': 2,
'lifestyle': 4
}[key];
};
}
function initialize() {
$('.banner-swiper').each(function() {
if ($(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
new Swiper(this, {
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li'
});
}
});
}
function loadData(channel, isBrand) {
var preUrl;
... ... @@ -39,18 +56,20 @@ function loadData(channel, isBrand) {
} else {
$('.category-content').html(data);
}
initialize();
}
});
}
$('.channel-tab').find('li').click(function() {
gender = $(this).find('span').text().replace(/[^A-Za-z]+/g, '').toLowerCase(),
gender = $(this).find('span').text().replace(/[^A-Za-z]+/g, '').toLowerCase();
isBrand = $('.brand-tab').find('.brand').hasClass('active');
$(this).addClass('focus').siblings().removeClass('focus');
loadData(channels(gender), isBrand);
})
});
// 点击字母,页面滚动到相关区域
$intercept.click(function() {
... ... @@ -75,21 +94,7 @@ $('.brand-tab').find('li').click(function() {
$('.cate-cha').removeClass('hide').siblings().addClass('hide');
}
$('.banner-swiper').each(function() {
if ($(this).hasClass('swiper-container-horizontal') === false && $(this).find('li').length > 1) {
new Swiper(this, {
preloadImages: false,
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li'
});
}
});
initialize();
});
$(function() {
... ...