yiming
2024-04-28 1845fc66deb7676c7cf8a1b73ac1f72517557861
pages/bookExhibitionList/index.js
@@ -87,7 +87,7 @@
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(this.data.multipleSelect.options.length, '44444');
    // this.setData({
    //   'product.value': '*',
    // });
@@ -127,7 +127,7 @@
   * 生命周期函数--监听页面显示
   */
  onShow() {
    // debugger
    this.bookExhibitionGet()
    this.keyProjectsGet(this.data.newPrice)
@@ -309,14 +309,11 @@
  },
  //重点项目接口
  keyProjectsGet() {
    // debugger
    if (this.data.multipleSelect.options.length !== 0) {
      console.log('张一鸣');
  keyProjectsGet(newPrice) {
      this.setData({
        'multipleSelect.options': [],
      filteredItems: [] // 如果存在子项则赋值,否则赋值为空数组
      });
    }
    //骨架屏
    this.setData({
      loading: true,
@@ -336,13 +333,8 @@
      // 循环然后判断相匹配的数据赋值给filteredItems
      checkData.option.forEach(item => {
        if (this.data.newPrice == item.value) {
        if (newPrice == item.value) {
          if (this.data.filteredItems.length !== 0) {
            this.setData({
              filteredItems: [] // 如果存在子项则赋值,否则赋值为空数组
            });
          }
          this.setData({
@@ -351,13 +343,8 @@
        }
      })
      this.setData({
        'multipleSelect.options': [],
      });
      let singleSelectOptions = []
      const singleSelectOptions = []
      console.log(this.data.multipleSelect.options, 'multipleSelect.options');
      console.log(singleSelectOptions, 'singleSelectOptions');
      // 单列选择器选项
      // 单列选择器选项
      this.data.filteredItems.forEach(item => {
@@ -381,6 +368,7 @@
      this.setData({
        'multipleSelect.options': singleSelectOptions,
      });
      // 取消骨架屏
      this.setData({
@@ -407,33 +395,36 @@
  // 总分类
  onChange(e) {
    this.setData({
      'multipleSelect.options': [],
    });
    console.log(this.data.multipleSelect.options);
    const newValue = e.detail.value;
    console.log(newValue);
    this.setData({
      'product.value': newValue,
      newValue: newValue
    });
    // let newPrice = ''
    let newPrice = ''
    if (newValue == 'jsek_bFHigherEducation') {
      this.setData({
        newPrice: 'jsek_higherEducation'
      })
      newPrice = 'jsek_higherEducation'
      // this.setData({
      //   newPrice: 'jsek_higherEducation'
      // })
    } else if (newValue == 'jsek_bFVocationalEducation') {
      this.setData({
        newPrice: 'jsek_vocationalEducation'
      })
      // this.setData({
      //   newPrice: 'jsek_vocationalEducation'
      // })
      newPrice = 'jsek_vocationalEducation'
    } else if (newValue == 'jsek_bFTeacherEducation') {
      this.setData({
        newPrice: 'jsek_teacherEducation'
      })
      // this.setData({
      //   newPrice: 'jsek_teacherEducation'
      // })
      newPrice = 'jsek_teacherEducation'
    } else {
      newPrice = ''
    }
    this.keyProjectsGet(this.data.newPrice)
    this.keyProjectsGet(newPrice)
    this.bookExhibitionGet(newValue);
    if (this.data.keynoteValue) {
      //如果有数据就清空并刷新页面