闫增涛
2024-04-02 aef06b129be7a3a12ac097db8e372b0cb33c6c42
packageBookService/pages/bookServices/list/index.js
@@ -262,6 +262,15 @@
      },
    };
    app.MG.store.getStoreChannelList(query).then((res) => {
      if (!res.datas.length) {
        this.setData({
          disabledSecondList: true
        })
      } else {
        this.setData({
          disabledSecondList: false
        })
      }
      for (let index = 0; index < res.datas.length; index++) {
        const item = res.datas[index];
        options.push({
@@ -375,7 +384,6 @@
        BaseType: 'DateTime'
      }
    } else if (this.data.sortList.value == 'time-desc') {
      debugger
      sort = {
        PublicationDate: 'Desc',
        BaseType: 'DateTime'
@@ -438,16 +446,6 @@
        this.setData({
          noData: true,
        })
        if (!this.data.pathList.length) {
          // 未选择二级分类,且无图书
          this.setData({
            disabledSecondList: true
          })
        } else {
          this.setData({
            disabledSecondList: false
          })
        }
      }
      if (this.data.triggered) {
        this.setData({
@@ -465,6 +463,7 @@
      `${this.data.assortCheck.code}\\${e.detail.value}` :
      this.data.assortCheck.code;
    console.log(this.data.path);
    this.setData({
      pathList: [],
      stairCode: e.detail.value,
@@ -472,17 +471,15 @@
      path: path,
      'stairList.value': e.detail.value,
    });
    this.getBookList(path);
    this.getSecondList(path);
    if (e.detail.value == '') {
      this.setData({
        disabledSecondList: true
      })
      });
    } else {
      this.setData({
        disabledSecondList: false
      })
      this.getSecondList(path);
    }
    this.getBookList(path);
    console.log(this.data.disabledSecondList);
  },
  // 二级分类切换