闫增涛
2024-03-22 88d80c9f40935c6ce7ea51683c6cdc1a80d1997b
pages/bibliographyList/index.js
@@ -7,6 +7,7 @@
     * 页面的初始数据
     */
    data: {
      isMore: null,
      higherList: [],
      vocationalList: [],
      teacherList: [],
@@ -16,7 +17,8 @@
      value: '',
      BarHeight: '',
      navBarHeight: '',
      start: 1,
      tabValue: ''
    },
    /**
@@ -35,7 +37,12 @@
        barHeight: systInfo.statusBarHeight,
      })
      let event =
      {
        detail: { value: "0" }
      }
      this.onTabsChange(event)
@@ -92,12 +99,28 @@
    },
    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 = {
@@ -112,7 +135,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -139,7 +162,7 @@
        })
        console.log(this.data.higherList, '5555');
      })
      wx.stopPullDownRefresh()
    },
@@ -156,7 +179,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -181,6 +204,7 @@
        })
      })
      wx.stopPullDownRefresh()
    },
    // 职业教育
    teacherGet(keyword) {
@@ -195,7 +219,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -220,7 +244,7 @@
        })
      })
      wx.stopPullDownRefresh()
    },
    downloadData(event) {
@@ -267,5 +291,82 @@
    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()
    },
  })