...
|
...
|
@@ -8,6 +8,7 @@ import dialog from 'js/plugin/dialog'; |
|
|
import lazyLoad from 'yoho-jquery-lazyload';
|
|
|
import yoSdk from 'yoho-activity-sdk';
|
|
|
let yoho = require('js/yoho-app');
|
|
|
let recItem = require('hbs/activity/group/progress-rec-item.hbs');
|
|
|
|
|
|
class GroupProgress extends Page {
|
|
|
constructor() {
|
...
|
...
|
@@ -30,6 +31,7 @@ class GroupProgress extends Page { |
|
|
groupPrice: '',
|
|
|
shareImgUrl: ''
|
|
|
};
|
|
|
this.page = 2;
|
|
|
this.loading = false;
|
|
|
this.loadedAll = false;
|
|
|
|
...
|
...
|
@@ -50,7 +52,6 @@ class GroupProgress extends Page { |
|
|
let self = this;
|
|
|
|
|
|
window.onscroll = function() {
|
|
|
|
|
|
if (timeout !== null) {
|
|
|
clearTimeout(timeout);
|
|
|
}
|
...
|
...
|
@@ -82,7 +83,7 @@ class GroupProgress extends Page { |
|
|
}
|
|
|
|
|
|
bindEvents() {
|
|
|
this.selector.$productItem.on('click', this.goDetail.bind(this));
|
|
|
$(document).on('click', '.product-item', this.goDetail.bind(this));
|
|
|
this.selector.$goJoin.on('click', this.goJoin.bind(this));
|
|
|
this.selector.$joinGroup.on('click', this.joinGroup.bind(this));
|
|
|
this.selector.$inviteJoin.on('click', this.inviteJoin.bind(this));
|
...
|
...
|
@@ -326,7 +327,7 @@ class GroupProgress extends Page { |
|
|
}
|
|
|
|
|
|
loadMoreData() {
|
|
|
if (this.loading && !this.loadedAll) {
|
|
|
if (this.loading || this.loadedAll) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -334,15 +335,35 @@ class GroupProgress extends Page { |
|
|
this.ajax({
|
|
|
url: '/activity/group/groupResultRec',
|
|
|
data: {
|
|
|
page: 2,
|
|
|
limit: 2
|
|
|
page: this.page,
|
|
|
limit: 4
|
|
|
}
|
|
|
}).then(result => {
|
|
|
if (!result.collageProductVoList) {
|
|
|
this.loading = false;
|
|
|
this.loadedAll = true;
|
|
|
return;
|
|
|
}
|
|
|
}).then(() => {
|
|
|
|
|
|
this.page = this.page + 1;
|
|
|
this.renderMoreData(result.collageProductVoList);
|
|
|
this.loading = false;
|
|
|
}).catch(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
renderMoreData(list) {
|
|
|
console.log('render data');
|
|
|
|
|
|
let appendHtml = '';
|
|
|
|
|
|
list.forEach(item => {
|
|
|
appendHtml += recItem(item);
|
|
|
});
|
|
|
|
|
|
$('.recommend').append(appendHtml);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$(() => {
|
...
|
...
|
|