|
@@ -11,6 +11,10 @@ Page({
|
|
|
roomList: [],
|
|
|
hasData: true,
|
|
|
loading: false,
|
|
|
+ listNmb:{
|
|
|
+ NotStart:0,
|
|
|
+ Start:0,
|
|
|
+ },
|
|
|
isSearch: false,
|
|
|
state: true,
|
|
|
canShow: false,
|
|
@@ -124,11 +128,28 @@ Page({
|
|
|
url: `/pages/room/add`,
|
|
|
})
|
|
|
},
|
|
|
+ async getStartNum(){
|
|
|
+ const res = await util.request(api.roomChatList, {
|
|
|
+ ...this.data.fetcherData,
|
|
|
+ state:101,
|
|
|
+ }, 'POST', 'application/json')
|
|
|
+ // debugger
|
|
|
+ if (res.code === 200) {
|
|
|
+ let listNmb = this.data.listNmb
|
|
|
+ listNmb.Start = res.data.count
|
|
|
+ if (res.data.data.length != 0) {
|
|
|
+ this.setData({
|
|
|
+ listNmb
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ },
|
|
|
async getRoomList() {
|
|
|
- console.log('getRoomList')
|
|
|
if (this.data.hasData) {
|
|
|
if (!this.data.loading) {
|
|
|
-
|
|
|
this.setData({
|
|
|
loading: true
|
|
|
})
|
|
@@ -140,13 +161,15 @@ Page({
|
|
|
// debugger
|
|
|
if (res.code === 200) {
|
|
|
if (res.data.data.length != 0) {
|
|
|
- let {
|
|
|
- totalPages
|
|
|
- } = res.data
|
|
|
+ let listNmb = this.data.listNmb
|
|
|
+ let objlistNmb = { 101:'Start', 102:'NotStart', }
|
|
|
+ listNmb[objlistNmb[this.data.fetcherData.state]] = res.data.count
|
|
|
+ let { totalPages } = res.data
|
|
|
this.setData({
|
|
|
roomList: this.data.roomList.concat(res.data.data),
|
|
|
'fetcherData.page': this.data.fetcherData.page + 1,
|
|
|
maxPage: totalPages == this.data.fetcherData.page,
|
|
|
+ listNmb,
|
|
|
})
|
|
|
|
|
|
} else {
|
|
@@ -257,6 +280,7 @@ Page({
|
|
|
})
|
|
|
this.getRoomList()
|
|
|
this.getUserInfo()
|
|
|
+ this.getStartNum()
|
|
|
},
|
|
|
|
|
|
/**
|