yiming
2024-03-22 1e0ffc1deed2044f96bab70e10d5c5544f6a23bf
pages/bibliographyList/index.js
@@ -7,6 +7,7 @@
     * 页面的初始数据
     */
    data: {
      isMore: null,
      higherList: [],
      vocationalList: [],
      teacherList: [],
@@ -15,7 +16,9 @@
      teacherTotal: 0,
      value: '',
      BarHeight: '',
      navBarHeight: ''
      navBarHeight: '',
      start: 1,
      tabValue: ''
    },
    /**
@@ -34,7 +37,12 @@
        barHeight: systInfo.statusBarHeight,
      })
      let event =
      {
        detail: { value: "0" }
      }
      this.onTabsChange(event)
@@ -91,12 +99,31 @@
    },
    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,
          isMore: false
        })
      } else if (value === '1') {
        console.log(value);
        this.setData({
          tabValue: value,
          isMore: false
        })
      } else if (value === '2') {
        console.log(value);
        this.setData({
          tabValue: value,
          isMore: false
        })
      }
    },
    onTabsClick(event) {
      console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
    },
    //高等教育
    higherGet(keyword) {
      let searchObj = {
@@ -111,7 +138,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -138,7 +165,7 @@
        })
        console.log(this.data.higherList, '5555');
      })
      wx.stopPullDownRefresh()
    },
@@ -155,7 +182,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -180,6 +207,7 @@
        })
      })
      wx.stopPullDownRefresh()
    },
    // 职业教育
    teacherGet(keyword) {
@@ -194,7 +222,7 @@
        queryType: '*',
        paging: {
          start: '0',
          size: '999'
          size: this.data.start * 9
        },
        coverSize: {
          width: 260
@@ -219,16 +247,16 @@
        })
      })
      wx.stopPullDownRefresh()
    },
    downloadData(event) {
      console.log(111);
      const item = event.currentTarget.dataset.item;
      // console.log(item.datas.freeFile.Value);
      const URL = 'http://182.92.203.7:3001/file/api/ApiDownload?md5=' + item.datas.freeFile.Value
      const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value
      item.determine = false
      console.log(URL, 'URL');
      setTimeout(() => {
        if (URL) {
          item.determine = true
@@ -266,5 +294,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()
    },
  })