yiming
2024-04-19 56b70cdad0a96691eaf37e04a79ef5e92b892480
pages/bookExhibitionList/index.js
@@ -8,6 +8,8 @@
   * 页面的初始数据
   */
  data: {
    loading: true,
    hidden: true,
    totalSize: '',
    start: 0,
    isMore: null,
@@ -64,19 +66,19 @@
      value: 'timeAsc',
      options: [{
          value: 'nameAsc',
          label: '名称从高到低',
          label: '名称正序',
        },
        {
          value: 'nameDesc',
          label: '名称从低到高',
          label: '名称倒序',
        },
        {
          value: 'timeAsc',
          label: '创建时间从高到低',
          label: '出版时间正序',
        },
        {
          value: 'timeDesc',
          label: '创建时间从底到高',
          label: '出版时间倒序',
        },
      ],
    },
@@ -218,7 +220,7 @@
        // 'page.start': currentPage,
        'page.size': newSize
      });
      this.bookExhibitionGet(); // 调用方法加载更多数据
      // this.bookExhibitionGet(); // 调用方法加载更多数据
@@ -318,33 +320,42 @@
      //取消
      wx.hideLoading()
      // console.log(this.data.bookExhibitionList, '数据');
      this.setData({
        loading: false,
        hidden: false,
      })
    })
  },
  //重点项目接口
  keyProjectsGet(newPrice) {
    this.setData({
      loading: true,
      hidden: true,
    })
    // console.log(newPrice, 'newPrice');
    let parms = {
      refCodes: ['bookClassification']
    }
    app.MG.store.getProductTypeField(parms).then(res => {
      const checkData = JSON.parse(res[0].config)
      checkData.option.forEach(item => {
        if (newPrice == item.value) {
          this.setData({
            filteredItems: item.child || [] // 如果存在子项则赋值,否则赋值为空数组
          });
          // console.log(this.data.filteredItems);
        }
      })
      this.onLoad();
      this.setData({
        loading: false,
        hidden: false,
      })
    })
  },
@@ -354,6 +365,16 @@
  // 总分类
  // 总分类
  onChange(e) {
    // e.stopImmediatePropagation();
    this.data.page.size = 16 //更改显示的值
    const newValue = e.detail.value;
@@ -377,6 +398,7 @@
        keynoteDisabled: true
      })
    }
    console.log(newValue);
    this.setData({
      'product.value': newValue,
      'product.price': newPrice, // 将选中的 price 值保存在数据中
@@ -391,6 +413,8 @@
      this.bookExhibitionGet(newValue)
      this.onLoad()
    }
    // e.stopImmediatePropagation()
  },
  // 重点项目
@@ -398,10 +422,8 @@
    this.setData({
      'multipleSelect.value': e.detail.value,
    });
  },
  handleConfirm(event) {
    const {
      value
    } = event.detail;
@@ -411,11 +433,12 @@
    this.data.keynoteValue = value
    this.bookExhibitionGet()
  },
  handleReset() {
  handleReset(e) {
    // 重置操作的处理逻辑
    this.data.keynoteValue = []
    console.log('重置操作');
    this.bookExhibitionGet()
  },
  onSwapRight() {
@@ -442,12 +465,14 @@
    this.bookExhibitionGet()
  },
  onBookExhibitionDetails: function (event) {
    console.log(456);
    const item = event.currentTarget.dataset.item;
    console.log(item);
    wx.navigateTo({
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name + '&subtitleName=' + item.subtitleName // 假设跳转到详情页面,并传递了id参数
    });
  },
  // 搜索框
  onSearchSubmit(e) {
    this.setData({
@@ -466,5 +491,7 @@
    console.log(e.detail.value, 'e.detail.value');
    this.bookExhibitionGet()
  },
  onOpend() {
    console.log(7555);
  }
})