...
|
...
|
@@ -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() {
|
...
|
...
|
@@ -23,6 +24,7 @@ class Group extends Page { |
|
|
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'),
|
...
|
...
|
@@ -152,6 +154,7 @@ class Group extends Page { |
|
|
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();
|
...
|
...
|
@@ -174,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);
|
...
|
...
|
@@ -447,6 +470,16 @@ class Group extends Page { |
|
|
}
|
|
|
}
|
|
|
|
|
|
renderMoreData(list) {
|
|
|
console.log(list);
|
|
|
let appendHtml = '';
|
|
|
|
|
|
list.forEach(item => {
|
|
|
appendHtml += groupListItem(item);
|
|
|
});
|
|
|
$('.new-goods-list').html(appendHtml);
|
|
|
}
|
|
|
|
|
|
// 筛选初始化
|
|
|
filterInit() {
|
|
|
let selectedChannel = this.selectedChannel;
|
...
|
...
|
|