litian
2024-09-07 ce3a08b28c16f5cce2185167f8a9030ee16898ed
pages/digitalCourses/digitalCoursesDetails/components/testTree/index.js
@@ -17,12 +17,21 @@
      type: Array,
      value: [],
    },
    isBuy: {
      type: Boolean,
      value: false,
    },
  },
  data: {},
  data: {
    isBuy: false,
  },
  ready() {},
  onLoad() {
    console.log(this.properties.openIds, "1111")
    this.setData({
      isBuy: this.properties.isBuy
    });
  },
  methods: {
@@ -38,6 +47,7 @@
      console.log(e, 666)
      const value = e.currentTarget.dataset.item;
      const parent = e.currentTarget.dataset.parent;
      const isTry = e.currentTarget.dataset.istry;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
@@ -47,6 +57,12 @@
          },
        });
      }
      if (!isTry && !this.data.isBuy) {
        return wx.showToast({
          icon: 'error',
          title: '请先购买该课程',
        })
      }
      // 获取章节下是否有题目
      let idPathList = [];
      let query = {