yiming
2024-03-26 c5864be56488bee0c767d4b1cf157db4a0ec33c3
pages/bookExhibitionList/index.js
@@ -8,6 +8,7 @@
   * 页面的初始数据
   */
  data: {
    keynoteDisabled: true,
    value: '',
    keyword: '',
    nameSort: null,
@@ -49,17 +50,15 @@
          price: 'jsek_teacherEducation',
          label: '教师教育',
        },
      ],
    },
    multipleSelect: {
      value: [],
      options: [],
    },
    navBarHeight: '',
    barHeight: ''
    barHeight: '',
    windowHeight: '',
  },
@@ -68,6 +67,8 @@
    * 生命周期函数--监听页面加载
    */
  onLoad(options) {
    // console.log(this.data.filteredItems, 88888);
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
@@ -86,18 +87,18 @@
    if (this.data.filteredItems = []) {
      console.log(11111);
      singleSelectOptions.push({
        label: '禁用选项',
        value: 'disabled',
        disabled: true,
      });
      // singleSelectOptions.push({
      //   label: '暂无数据',
      //   value: 'disabled',
      //   disabled: true,
      // });
    } else {
      console.log(7889);
    }
    // singleSelectOptions.push({
    //   label: '禁用选项',
    //   value: 'disabled',
    //   disabled: true,
    // });
    // 更新数据
@@ -272,6 +273,18 @@
    const newValue = e.detail.value;
    const selectedOption = this.data.product.options.find(option => option.value === newValue);
    const newPrice = selectedOption ? selectedOption.price : null;
    console.log(newValue, 'newValue');
    console.log(newPrice, 'newPrice');
    if (newPrice) {
      this.setData({
        keynoteDisabled: false
      })
    } else {
      this.setData({
        keynoteDisabled: true
      })
    }
    this.setData({
      'product.value': newValue,
      'product.price': newPrice, // 将选中的 price 值保存在数据中
@@ -287,10 +300,6 @@
      this.bookExhibitionGet(newValue)
      this.onLoad()
      console.log('true');
    } else {
      // this.bookExhibitionGet(newValue);
      // this.keyProjectsGet(newPrice);
      console.log('fals');
    }
  },
@@ -300,8 +309,10 @@
    this.setData({
      'multipleSelect.value': e.detail.value,
    });
  },
  handleConfirm(event) {
    const { value } = event.detail;
    // 确认操作的处理逻辑
@@ -310,6 +321,7 @@
    this.bookExhibitionGet()
  },
  handleReset() {
    // 重置操作的处理逻辑
    this.data.keynoteValue = []
    console.log('重置操作');
@@ -341,14 +353,12 @@
    this.data.nameSort = 'Desc'
    // console.log('sssssss');
    this.bookExhibitionGet()
  },
  onBookExhibitionDetails: function (event) {
    const item = event.currentTarget.dataset.item;
    console.log(item);
    wx.navigateTo({
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数
      url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name + '&subtitleName=' + item.subtitleName // 假设跳转到详情页面,并传递了id参数
    });
  },
  // 搜索框