litian
2024-04-08 e6a156a6a8bb6f1d3a17e9310269f53c56e10b42
packageBookService/pages/bookServices/detail/index.js
@@ -812,6 +812,7 @@
      },
    };
    let data = await app.MG.store.getProductDetail(query);
    // 如果item层级里有floder,删除floder
    const flag = data.datas.cmsDatas[0].datas.findIndex(
      (item) => item.sysType == "CmsItem"
    );
@@ -953,8 +954,7 @@
        remarks: "电子书",
        requests: [{
          saleMethodId: this.data.bookItemDetail.defaultSaleMethodId ?
            this.data.bookItemDetail.defaultSaleMethodId :
            this.data.bookDetail.defaultSaleMethodId,
            this.data.bookItemDetail.defaultSaleMethodId : this.data.bookDetail.defaultSaleMethodId,
          count: 1,
        }, ],
      };
@@ -1847,14 +1847,7 @@
          });
          return false;
        }
        if (this.data.electronicBookList.length >= 2) {
          wx.showToast({
            title: "每次最多只可申请2本样书",
            icon: "none",
            duration: 1000,
          });
          return false;
        }
        let isHas = this.data.electronicBookList.find(
          (eitem) => eitem.id == this.data.bookDetail.id
        );
@@ -1872,6 +1865,14 @@
        if (isApply) {
          wx.showToast({
            title: "该书已申请!",
            icon: "none",
            duration: 1000,
          });
          return false;
        }
        if (this.data.electronicBookList.length >= 2) {
          wx.showToast({
            title: "每次最多只可申请2本样书",
            icon: "none",
            duration: 1000,
          });
@@ -1916,14 +1917,18 @@
          });
          return false;
        }
        if (this.data.paperBookList.length >= 2) {
        let isApply = this.data.alreadyPaperBookList.find(
          (pitem) => pitem.id == this.data.bookDetail.id
        );
        if (isApply) {
          wx.showToast({
            title: "每次最多只可申请2本样书",
            title: "该书已申请!",
            icon: "none",
            duration: 1000,
          });
          return false;
        }
        let isHas = this.data.paperBookList.find(
          (pitem) => pitem.id == this.data.bookDetail.id
        );
@@ -1935,12 +1940,9 @@
          });
          return false;
        }
        let isApply = this.data.alreadyPaperBookList.find(
          (pitem) => pitem.id == this.data.bookDetail.id
        );
        if (isApply) {
        if (this.data.paperBookList.length >= 2) {
          wx.showToast({
            title: "该书已申请!",
            title: "每次最多只可申请2本样书",
            icon: "none",
            duration: 1000,
          });