yiming
2024-07-08 c6abdfaf883e35e9c930dbdbe533d36e2966eb23
pages/retrievalPage/index.js
@@ -19,7 +19,6 @@
    showTextAndTitleWithInput: false,
    downloadLoadin: false,
    isMore: null,
    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
    navBarHeight: '',
    barHeight: '',
    searchVal: '',
@@ -39,7 +38,41 @@
      page: 1,
      total: 0,
    },
    tabValue: '0'
    tabValue: 0,
    tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
    // tab选项
    tabList: [{
        title: "图书",
        index: "0",
        // bookTotal: this.data.bookTotal
      },
      {
        title: "课程",
        index: "1",
        // bookTotal: this.data.courseTotal
      },
      {
        title: "数字教材",
        index: "2",
        // bookTotal: this.data.digitalTextbooksTotal
      }, {
        title: "专题",
        index: "3",
        // bookTotal: this.data.seminarTotal
      },
      {
        title: "书目",
        index: "4",
        // bookTotal: this.data.bookFairTotal
      },
      {
        title: "书展",
        index: "5",
        // bookTotal: this.data.biblioClassificationTotal
      },
    ],
    tabsId: 0, //默认选型为装备
  },
  /**
@@ -57,12 +90,12 @@
    })
    this.retrievalPageGet()
    this.bibliographyGet()
    let event = {
    let e = {
      detail: {
        value: "0"
      }
    }
    // this.onTabsChange(event)
    this.onTabsChange(e)
  },
  /**
@@ -129,37 +162,15 @@
  onTabsChange(event) {
    const value = event.detail.value
    console.log(value);
    if (value === '0') {
      this.setData({
        tabValue: value,
        isMore: false
      })
    } else if (value === '1') {
      console.log(value, 'tab');
      this.setData({
        tabValue: value,
        isMore: false
      })
    } else if (value === '2') {
      this.setData({
        tabValue: value,
        isMore: false
      })
    } else if (value === '3') {
      this.setData({
        tabValue: value,
        isMore: false
      })
    } else if (value === '4') {
      this.setData({
        tabValue: value,
        isMore: false
      })
    } else if (value === '5') {
      this.setData({
        tabValue: value,
        isMore: false
      })
    this.setData({
      tabValue: value,
      isMore: false
    })
    if (value === '4') {
      this.bibliographyGet()
    } else {
      this.retrievalPageGet()
    }
  },
@@ -572,6 +583,7 @@
   * 页面上拉触底事件的处理函数
   */
  onReachBottom(e) {
    console.log(this.data.tabValue);
    if (this.data.tabValue == 0) {
      console.log(0);
      if (this.data.bookData.length < this.data.bookTotal) {
@@ -885,4 +897,26 @@
      }
    }
  },
  onTabsClick(event) {
    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
  },
  tabClick() {
    console.log(2323);
  },
  // 滑动时触发的事件
  slideOn(e) {
    // 拿到当前索引并动态改变
    this.setData({
      tabsId: e.detail.current
    })
  },
  //点击tab时触发
  tabsOn(e) {
    this.setData({
      //拿到当前索引并动态改变
      tabsId: e.currentTarget.dataset.idx
    })
  },
})