...
|
...
|
@@ -6,8 +6,8 @@ import filter from 'js/plugin/filter'; |
|
|
let innerScroll = require('js/plugin/inner-scroll');
|
|
|
|
|
|
// import lazyLoad from 'yoho-jquery-lazyload';
|
|
|
// import tip from 'js/plugin/tip';
|
|
|
// import loading from 'js/plugin/loading';
|
|
|
import tip from 'js/plugin/tip';
|
|
|
import loading from 'js/plugin/loading';
|
|
|
|
|
|
class Group extends Page {
|
|
|
constructor() {
|
...
|
...
|
@@ -189,6 +189,10 @@ class Group extends Page { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 清除筛选页存储的数据
|
|
|
this.filterPage.newGroup = {};
|
|
|
this.filterPage.normalGroup = {};
|
|
|
|
|
|
// 根据条件重置筛选页面及商品列表
|
|
|
this.filterInit();
|
|
|
this.search();
|
...
|
...
|
@@ -217,35 +221,47 @@ class Group extends Page { |
|
|
* @param opt
|
|
|
*/
|
|
|
search() {
|
|
|
let params = this.filterTab[this.selectedChannel];
|
|
|
|
|
|
console.log('searchParam', params);
|
|
|
let params = {
|
|
|
...this.filterTab[this.selectedChannel]
|
|
|
};
|
|
|
let pageParams = this.filterPage[this.selectedChannel];
|
|
|
let groupListContent = this.selector.groupListContent;
|
|
|
|
|
|
// let setting;
|
|
|
delete params.$pre;
|
|
|
|
|
|
console.log('searchParam', params);
|
|
|
console.log('pageParams', this.filterPage[this.selectedChannel]);
|
|
|
|
|
|
// loading.showLoadingMask();
|
|
|
loading.showLoadingMask();
|
|
|
|
|
|
// $.ajax({
|
|
|
// type: 'GET',
|
|
|
// url: '/product/sale/search',
|
|
|
// data: setting,
|
|
|
// success: function() {
|
|
|
// },
|
|
|
// error: function() {
|
|
|
// tip.show('网络断开连接了~');
|
|
|
// loading.hideLoadingMask();
|
|
|
// }
|
|
|
// });
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/activity/group/search',
|
|
|
data: {
|
|
|
...params,
|
|
|
...pageParams
|
|
|
},
|
|
|
success: function(data) {
|
|
|
console.log(data);
|
|
|
groupListContent.html(data);
|
|
|
loading.hideLoadingMask();
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('网络断开连接了~');
|
|
|
loading.hideLoadingMask();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
// 筛选初始化
|
|
|
filterInit() {
|
|
|
let selectedChannel = this.selectedChannel;
|
|
|
let requestParams = {
|
|
|
...this.filterTab[this.selectedChannel]
|
|
|
...this.filterTab[selectedChannel]
|
|
|
};
|
|
|
let filterTab = this.selector.filterTab;
|
|
|
let filterPage = this.filterPage;
|
|
|
let search = this.search.bind(this);
|
|
|
|
|
|
delete requestParams.$pre;
|
...
|
...
|
@@ -260,7 +276,13 @@ class Group extends Page { |
|
|
|
|
|
// 初始化filter&注册filter回调
|
|
|
filter.initFilter({
|
|
|
fCbFn: search,
|
|
|
fCbFn: function(params) {
|
|
|
console.log(params);
|
|
|
|
|
|
// 存储筛选页数据
|
|
|
filterPage[selectedChannel][params.type] = params.id;
|
|
|
search();
|
|
|
},
|
|
|
hCbFn: function() {
|
|
|
filterTab.children('.filter').removeClass('active');
|
|
|
innerScroll.enableScroll($('body'));
|
...
|
...
|
|