| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isMore: null, |
| | | higherList: [], |
| | | vocationalList: [], |
| | | teacherList: [], |
| | |
| | | value: '', |
| | | BarHeight: '', |
| | | navBarHeight: '', |
| | | |
| | | start: 1, |
| | | tabValue: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | |
| | | let event = |
| | | { |
| | | detail: { value: "0" } |
| | | } |
| | | |
| | | this.onTabsChange(event) |
| | | |
| | | |
| | | |
| | |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | console.log(`Change tab, tab-panel value is ${event.detail.value}.`); |
| | | |
| | | const value = event.detail.value |
| | | |
| | | if (value === '0') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '1') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '2') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | console.log(`Click tab, tab-panel value is ${event.detail.value}.`); |
| | | }, |
| | | |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | let searchObj = { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | console.log(this.data.higherList, '5555'); |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // 职业教育 |
| | | teacherGet(keyword) { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | downloadData(event) { |
| | |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.higherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.teacherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.vocationalGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onPullDownRefresh() { |
| | | |
| | | |
| | | this.setData({ |
| | | start: 1 |
| | | }) |
| | | this.vocationalGet() |
| | | this.higherGet() |
| | | this.teacherGet() |
| | | |
| | | }, |
| | | |
| | | }) |