|
@@ -13,6 +13,7 @@ Page({
|
|
|
loading: false,
|
|
|
isSearch: false,
|
|
|
state: true,
|
|
|
+ maxPage:false,
|
|
|
fetcherData: {
|
|
|
type: 32,
|
|
|
address: '',
|
|
@@ -105,13 +106,14 @@ Page({
|
|
|
})
|
|
|
try {
|
|
|
const res = await util.request(api.roomChatList, this.data.fetcherData, 'POST', 'application/json')
|
|
|
- console.log('roomData', res.data.list);
|
|
|
// debugger
|
|
|
if (res.code === 200) {
|
|
|
- if (res.data.list.length != 0) {
|
|
|
+ if (res.data.data.length != 0) {
|
|
|
+ let { totalPages } = res.data
|
|
|
this.setData({
|
|
|
- roomList: this.data.roomList.concat(res.data.list),
|
|
|
- 'fetcherData.page': this.data.fetcherData.page + 1
|
|
|
+ roomList: this.data.roomList.concat(res.data.data),
|
|
|
+ 'fetcherData.page': this.data.fetcherData.page + 1,
|
|
|
+ maxPage:totalPages == this.data.fetcherData.page,
|
|
|
})
|
|
|
|
|
|
} else {
|
|
@@ -123,7 +125,7 @@ Page({
|
|
|
this.setData({
|
|
|
loading: false
|
|
|
})
|
|
|
- console.log('roomList', this.data.roomList);
|
|
|
+ console.log('roomList', this.data.roomList,this.data.fetcherData.page);
|
|
|
|
|
|
} catch (error) {
|
|
|
this.setData({
|
|
@@ -160,7 +162,7 @@ Page({
|
|
|
wx.hideLoading()
|
|
|
if (res.errno === 0) {
|
|
|
this.setData({
|
|
|
- roomList: res.data.list,
|
|
|
+ roomList: res.data.data,
|
|
|
})
|
|
|
}
|
|
|
}).catch(err => {
|
|
@@ -263,7 +265,7 @@ Page({
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function () {
|
|
|
- if (!this.data.isSearch) {
|
|
|
+ if (!this.data.isSearch && !this.data.maxPage) {
|
|
|
this.getRoomList()
|
|
|
}
|
|
|
},
|