闫增涛
2024-04-03 5e649be819c7297c79c21c6dc120b4b6b362db9e
packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -1,5 +1,7 @@
const util = require("./components/util"); // 引入封装过的加载提示
import { loginInfo } from "../../../../../../assets/js/login";
import {
  loginInfo
} from "../../../../../../assets/js/login";
const app = getApp();
Component({
  // checked: false,
@@ -87,8 +89,7 @@
    handleList(tree) {
      for (let index = 0; index < tree.length; index++) {
        const item = tree[index];
        if (item.sysType == "CmsItem" && !item.checked) {
        }
        if (item.sysType == "CmsItem" && !item.checked) {}
        if (item.children && item.children.length > 0) {
          this.handleList(item.children);
        }
@@ -425,6 +426,8 @@
      });
      if (shoppingCartGetId.includes(saleMethodId)) {
        console.log(111);
        // this.data.updateShoppingCartHidden();
        // this.data.updateCloudLearning();
        wx.showToast({
          icon: "error",
@@ -435,13 +438,11 @@
        });
      } else {
        let query = {
          requests: [
            {
          requests: [{
              saleMethodId: saleMethodId,
              storeEventId: null,
              // agentCode: '电子书'
            },
          ],
          }, ],
        };
        const addRes = await app.MG.store.addShoppingCart(query);
        console.log(addRes, "addRes");
@@ -451,7 +452,14 @@
        });
      }
    },
    sadd() {
      this.triggerEvent('updateShoppingCartHidden');
      this.triggerEvent('updateCloudLearning');
      console.log(789);
  },
  catchtap() {},
});
  },
  catchtap() {}
})