yiming
2024-04-19 56b70cdad0a96691eaf37e04a79ef5e92b892480
pages/bookExhibitionList/index.js
@@ -8,22 +8,6 @@
   * 页面的初始数据
   */
  data: {
    product: {
      value: 'all',
      options: [{
          value: 'all',
          label: '全部产品',
        },
        {
          value: 'new',
          label: '最新产品',
        },
        {
          value: 'hot',
          label: '最火产品',
        },
      ],
    },
    loading: true,
    hidden: true,
    totalSize: '',
@@ -45,32 +29,32 @@
    sorter: {
      value: 'default',
    },
    // product: {
    //   value: '*',
    //   options: [{
    //       value: '*',
    //       label: '总分类',
    //     },
    //     {
    //       value: 'jsek_bFHigherEducation',
    //       //重点项目
    //       price: 'jsek_higherEducation',
    //       label: '高等教育',
    //     },
    //     {
    //       value: 'jsek_bFVocationalEducation',
    //       //重点项目
    //       price: 'jsek_vocationalEducation',
    //       label: '职业教育',
    //     },
    //     {
    //       value: 'jsek_bFTeacherEducation',
    //       //重点项目
    //       price: 'jsek_teacherEducation',
    //       label: '教师教育',
    //     },
    //   ],
    // },
    product: {
      value: '*',
      options: [{
          value: '*',
          label: '总分类',
        },
        {
          value: 'jsek_bFHigherEducation',
          //重点项目
          price: 'jsek_higherEducation',
          label: '高等教育',
        },
        {
          value: 'jsek_bFVocationalEducation',
          //重点项目
          price: 'jsek_vocationalEducation',
          label: '职业教育',
        },
        {
          value: 'jsek_bFTeacherEducation',
          //重点项目
          price: 'jsek_teacherEducation',
          label: '教师教育',
        },
      ],
    },
    multipleSelect: {
      value: [],
      options: [],
@@ -376,52 +360,62 @@
  },
  // 总分类
  // 总分类
  onChange(e) {
    console.log(e);
    // e.stopImmediatePropagation();
    this.data.page.size = 16 //更改显示的值
    const newValue = e.detail.value;
    const selectedOption = this.data.product.options.find(option => option.value === newValue);
    const newPrice = selectedOption ? selectedOption.price : null;
    const bookExhibitionListsubsidiary = []
    this.setData({
      bookExhibitionListsubsidiary: this.data.bookExhibitionList
    })
    console.log(bookExhibitionListsubsidiary, 'bookExhibitionListsubsidiary');
    console.log(newValue, 'newValue');
    console.log(newPrice, 'newPrice');
    if (newPrice) {
      this.setData({
        keynoteDisabled: false
      })
    }
    if (!newPrice) {
      this.setData({
        keynoteDisabled: true
      })
    }
    console.log(newValue);
    this.setData({
      'product.value': newValue,
      'product.price': newPrice, // 将选中的 price 值保存在数据中
    });
    this.bookExhibitionGet(newValue);
    this.keyProjectsGet(newPrice);
    // 调用更新页面数据的函数,传入新的 value 和 price 值
    if (this.data.keynoteValue) {
      //如果有数据就清空并刷新页面
      this.data.keynoteValue = []
      this.bookExhibitionGet(newValue)
      this.onLoad()
    }
    // e.stopImmediatePropagation()
  },
  // 总分类
  // 总分类
  // onChange(e) {
  //   this.data.page.size = 16 //更改显示的值
  //   const newValue = e.detail.value;
  //   const selectedOption = this.data.product.options.find(option => option.value === newValue);
  //   const newPrice = selectedOption ? selectedOption.price : null;
  //   const bookExhibitionListsubsidiary = []
  //   this.setData({
  //     bookExhibitionListsubsidiary: this.data.bookExhibitionList
  //   })
  //   console.log(bookExhibitionListsubsidiary, 'bookExhibitionListsubsidiary');
  //   console.log(newValue, 'newValue');
  //   console.log(newPrice, 'newPrice');
  //   if (newPrice) {
  //     this.setData({
  //       keynoteDisabled: false
  //     })
  //   }
  //   if (!newPrice) {
  //     this.setData({
  //       keynoteDisabled: true
  //     })
  //   }
  //   console.log(newValue);
  //   this.setData({
  //     'product.value': newValue,
  //     'product.price': newPrice, // 将选中的 price 值保存在数据中
  //   });
  //   this.bookExhibitionGet(newValue);
  //   this.keyProjectsGet(newPrice);
  //   // 调用更新页面数据的函数,传入新的 value 和 price 值
  //   if (this.data.keynoteValue) {
  //     //如果有数据就清空并刷新页面
  //     this.data.keynoteValue = []
  //     this.bookExhibitionGet(newValue)
  //     this.onLoad()
  //   }
  // },
  // 重点项目
  handleMultipleSelect(e) {
@@ -430,9 +424,6 @@
    });
  },
  handleConfirm(event) {
    const {
      value
    } = event.detail;
@@ -500,7 +491,7 @@
    console.log(e.detail.value, 'e.detail.value');
    this.bookExhibitionGet()
  },
  onTest() {
  onOpend() {
    console.log(7555);
  }
})