...
|
...
|
@@ -34,6 +34,14 @@ Page(Object.assign({ |
|
|
}],
|
|
|
tabIndex: 0,
|
|
|
|
|
|
my_zero_list: [{
|
|
|
page: 1,
|
|
|
data: []
|
|
|
}, {
|
|
|
page: 1,
|
|
|
data: []
|
|
|
}],
|
|
|
|
|
|
footText: '',
|
|
|
hasUnionID: false,
|
|
|
uid: 0,
|
...
|
...
|
@@ -83,26 +91,30 @@ Page(Object.assign({ |
|
|
this.setData({
|
|
|
footText: '内容加载中...'
|
|
|
});
|
|
|
|
|
|
let tabIndex = this.data.tabIndex;
|
|
|
let page = this.data.list[tabIndex].page;
|
|
|
let pageKey = `list[${tabIndex}].page`;
|
|
|
let productsKey = `list[${tabIndex}].products`
|
|
|
|
|
|
this._getPage(page).then((list) => {
|
|
|
let oldList = this.data.list[tabIndex].products;
|
|
|
|
|
|
if (list.length > 0) {
|
|
|
if (tabIndex !== 3) {
|
|
|
let page = this.data.list[tabIndex].page;
|
|
|
let pageKey = `list[${tabIndex}].page`;
|
|
|
let productsKey = `list[${tabIndex}].products`
|
|
|
|
|
|
this._getPage(page).then((list) => {
|
|
|
let oldList = this.data.list[tabIndex].products;
|
|
|
|
|
|
if (list.length > 0) {
|
|
|
this.setData({
|
|
|
[productsKey]: oldList.concat(list),
|
|
|
[pageKey]: page + 1,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
[productsKey]: oldList.concat(list),
|
|
|
[pageKey]: page + 1,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
footText: '暂无更多内容'
|
|
|
});
|
|
|
})
|
|
|
footText: '暂无更多内容'
|
|
|
});
|
|
|
})
|
|
|
} else {
|
|
|
console.log('++++++++++++++++++++');
|
|
|
this._getReleaseData();
|
|
|
}
|
|
|
},
|
|
|
|
|
|
_getPage(page) {
|
...
|
...
|
@@ -125,6 +137,9 @@ Page(Object.assign({ |
|
|
footText: '内容加载中...'
|
|
|
})
|
|
|
|
|
|
this._getProceedingData();
|
|
|
this._getReleaseData();
|
|
|
|
|
|
return this._getPage(page).then(list => {
|
|
|
if (list.length === 0) {
|
|
|
this.setData({
|
...
|
...
|
@@ -197,6 +212,49 @@ Page(Object.assign({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
_getProceedingData() {
|
|
|
let type = 0;
|
|
|
let page = 1;
|
|
|
let limit = 1000;
|
|
|
let key = `my_zero_list[${type}].data`
|
|
|
this.service.getMyList({type, page, limit}).then(res => {
|
|
|
let data = []
|
|
|
if (res && res.code === 200) {
|
|
|
data = res.data;
|
|
|
}
|
|
|
this.setData({
|
|
|
[key]: data
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
|
|
|
_getReleaseData() {
|
|
|
let type = 1;
|
|
|
let my_zero_list = this.data.my_zero_list;
|
|
|
let page = my_zero_list[type].page;
|
|
|
let oldData = my_zero_list[type].data;
|
|
|
let key = `my_zero_list[${type}].data`;
|
|
|
let keyPage = `my_zero_list[${type}].page`;
|
|
|
this.service.getMyList({type, page}).then(res => {
|
|
|
let data = []
|
|
|
if (res && res.code === 200) {
|
|
|
data = res.data;
|
|
|
}
|
|
|
this.setData({
|
|
|
[key]: oldData.concat(data),
|
|
|
[keyPage]: ++page
|
|
|
})
|
|
|
this.setData({
|
|
|
footText: ''
|
|
|
})
|
|
|
if (data.length === 0) {
|
|
|
this.setData({
|
|
|
footText: '暂无更多内容'
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
_jumpBanner() {
|
|
|
if (this.data.bannerUrl == null) {
|
|
|
return;
|
...
|
...
|
|