yiming
2024-04-02 312fd09aaf90c0e52ab61bde22d0edbf105baa5e
pages/bookExhibitionList/index.js
@@ -26,8 +26,7 @@
    },
    product: {
      value: '*',
      options: [
        {
      options: [{
          value: '*',
          label: '总分类',
        },
@@ -58,17 +57,36 @@
    navBarHeight: '',
    barHeight: '',
    windowHeight: '',
    sorter: {
      value: 'timeAsc',
      options: [{
          value: 'nameAsc',
          label: '名称从高到低',
        },
        {
          value: 'nameDesc',
          label: '名称从低到高',
        },
        {
          value: 'timeAsc',
          label: '创建时间从高到低',
        },
        {
          value: 'timeDesc',
          label: '创建时间从底到高',
        },
      ],
    },
  },
  /**
    * 生命周期函数--监听页面加载
    */
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    console.log(this.data.keynoteDisabled, 'keynoteDisabled');
    // console.log(this.data.filteredItems, 88888);
    const systInfo = wx.getSystemInfoSync();
    const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息
@@ -199,9 +217,30 @@
      '||subtitle*': this.data.keyword
    }
    // console.log(this.data.keynoteValue);
    let sort = {
      Name: this.data.nameSort || 'Desc'
    }
    let sort = {};
    const sortOptions = {
      '*': {
        CreateDate: 'Asc'
      },
      'nameAsc': {
        Name: 'Asc'
      },
      'nameDesc': {
        Name: 'Desc'
      },
      'timeAsc': {
        CreateDate: 'Asc'
      },
      'timeDesc': {
        CreateDate: 'Desc'
      }
    };
    sort = sortOptions[this.data.product.value] || {};
    console.log(sort);
    app.MG.store.getProductList({
      storeInfo: 'jsek_bookFair',
      path: newValue,
@@ -219,6 +258,9 @@
      // },
    }).then(res => {
      res.datas.forEach((item) => {
        if (item.subtitle == undefined) {
          item.subtitle = ''
        }
        item.subtitleName = item.subtitle + item.name
      })
      console.log(res, 'item');
@@ -287,14 +329,20 @@
    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
      })
    } else {
    }
    if (!newPrice) {
      this.setData({
        keynoteDisabled: true
      })
@@ -313,9 +361,6 @@
      this.bookExhibitionGet(newValue)
      this.onLoad()
    }
  },
  // 重点项目
@@ -327,7 +372,9 @@
  },
  handleConfirm(event) {
    const { value } = event.detail;
    const {
      value
    } = event.detail;
    // 确认操作的处理逻辑
    console.log('确认操作,选中的值为:', value);
@@ -342,10 +389,6 @@
    this.bookExhibitionGet()
  },
  onSwapRight() {
    // console.log('xxxxxx');
    // this.data.nameSort = 'Asc'
    if (!this.data.nameSort) {
      this.setData({
        nameSort: 'Desc',
@@ -386,4 +429,11 @@
  goBack() {
    wx.navigateBack();
  },
  onSort(e) {
    this.setData({
      'product.value': e.detail.value,
    });
    console.log(e.detail.value, 'e.detail.value');
    this.bookExhibitionGet()
  }
})