...
|
...
|
@@ -8,6 +8,7 @@ import lazyLoad from 'yoho-jquery-lazyload'; |
|
|
import innerScroll from 'js/plugin/inner-scroll';
|
|
|
import sharePlugin from 'js/common/share';
|
|
|
const querystring = require('querystring');
|
|
|
let groupListItem = require('hbs/activity/group/group-list-product.hbs');
|
|
|
|
|
|
class Group extends Page {
|
|
|
constructor() {
|
...
|
...
|
@@ -20,7 +21,10 @@ class Group extends Page { |
|
|
groupTab: $('.group-tab'),
|
|
|
filterTab: $('.filter-nav'),
|
|
|
groupListContent: $('.goods-list'),
|
|
|
resourceList: $('.resource-collage-buy-prd-list')
|
|
|
resourceList: $('.resource-collage-buy-prd-list'),
|
|
|
resourceListC: $('.resource-collage-buy-prd-list-c'),
|
|
|
goodsList: $('.new-goods-list'),
|
|
|
guessLike: $('.guess-tab')
|
|
|
};
|
|
|
this.shareData = {
|
|
|
shareImgUrl: $('.group').data('share-img'),
|
...
|
...
|
@@ -74,6 +78,7 @@ class Group extends Page { |
|
|
this.shareInfo();
|
|
|
this.bindEvents();
|
|
|
this.swiperTop();
|
|
|
this.swiperGroup();
|
|
|
this.filterInit();
|
|
|
let self = this;
|
|
|
|
...
|
...
|
@@ -147,6 +152,9 @@ class Group extends Page { |
|
|
this.selector.filterTab.on('click', 'li', this.filterTabChange.bind(this));
|
|
|
this.selector.groupListContent.on('click', '.group-product-cell', this.checkDetail.bind(this));
|
|
|
this.selector.resourceList.on('click', '.product-item', this.checkDetail.bind(this));
|
|
|
this.selector.resourceListC.on('click', '.swiper-slide', this.checkDetail.bind(this));
|
|
|
this.selector.goodsList.on('click', '.new-index-filter-list-item', this.checkDetail.bind(this));
|
|
|
this.selector.guessLike.on('click', this.guessLikeTabChange.bind(this));
|
|
|
}
|
|
|
fixedTab() {
|
|
|
let listHeight = this.selector.groupListContent.height();
|
...
|
...
|
@@ -169,6 +177,26 @@ class Group extends Page { |
|
|
window.location.href = `/activity/group/detail?activityId=${activityId}&productSkn=${productSkn}`;
|
|
|
}
|
|
|
|
|
|
guessLikeTabChange(e) {
|
|
|
let $this = $(e.currentTarget);
|
|
|
let query = $this.data('query');
|
|
|
let queryObject = {};
|
|
|
|
|
|
query.forEach(item => {
|
|
|
queryObject = Object.assign(queryObject, item);
|
|
|
});
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/activity/group/goods-tab',
|
|
|
data: queryObject,
|
|
|
success: (data) => {
|
|
|
// $('.filter-mask').remove();
|
|
|
// $('.group').append(data);
|
|
|
this.renderMoreData(data.filterList || []);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 筛选tab切换
|
|
|
filterTabChange(e) {
|
|
|
let $this = $(e.currentTarget);
|
...
|
...
|
@@ -282,6 +310,18 @@ class Group extends Page { |
|
|
this.search();
|
|
|
}
|
|
|
|
|
|
swiperGroup() {
|
|
|
if ($('.resource-collage-buy-prd-list-c').data('prd-list-length') > 0) {
|
|
|
new Swiper('.swiper-container', {
|
|
|
slidesPerView: 3,
|
|
|
spaceBetween: 20,
|
|
|
slidesPerGroup: 3,
|
|
|
pagination: '.swiper-pagination',
|
|
|
paginationClickable: true,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 顶部swiper
|
|
|
swiperTop() {
|
|
|
if ($('.banner-swiper').find('li').size() > 1) {
|
...
|
...
|
@@ -430,6 +470,15 @@ class Group extends Page { |
|
|
}
|
|
|
}
|
|
|
|
|
|
renderMoreData(list) {
|
|
|
let appendHtml = '';
|
|
|
|
|
|
list.forEach(item => {
|
|
|
appendHtml += groupListItem(item);
|
|
|
});
|
|
|
$('.new-goods-list').html(appendHtml);
|
|
|
}
|
|
|
|
|
|
// 筛选初始化
|
|
|
filterInit() {
|
|
|
let selectedChannel = this.selectedChannel;
|
...
|
...
|
|