litian
2024-09-07 ce3a08b28c16f5cce2185167f8a9030ee16898ed
pages/digitalCourses/digitalCoursesDetails/components/tree/index.js
@@ -17,6 +17,10 @@
      type: Array,
      value: [],
    },
    isBuy: {
      type: Boolean,
      value: false,
    },
  },
  data: {
    sonPurchaseSaleMethodId: "",
@@ -28,13 +32,15 @@
    shoppingCart: true,
    stop: false,
    cart: true,
    canExecute: true
    canExecute: true,
    isBuy: false,
  },
  ready() {},
  onLoad() {
    this.setData({
      sonPurchaseSaleMethodId: [],
      isBuy: this.properties.isBuy
    });
  },
  methods: {
@@ -59,14 +65,21 @@
      // 检查登录状态
      const token = wx.getStorageSync(app.config.tokenKey);
      if (token) {
        const item = e.currentTarget.dataset.item;
        const parent = e.currentTarget.dataset.parent;
        console.log('item', item);
        const isTry = e.currentTarget.dataset.istry;
        const parentProductLinkPath = parent ?
          parent.productLinkPath :
          wx.getStorageSync("teachResourcesPath");
        const parentName = parent ? parent.name : "教学资源";
        let url;
        if (!isTry && !this.data.isBuy) {
          return wx.showToast({
            icon: 'error',
            title: '请先购买该课程',
          })
        }
        if (item.selectType == 'zip') {
          if (this.properties.applyState == 'Normal') {
            return wx.showToast({