闫增涛
2025-03-28 38cd76c5f05fd55855038e2d393074e27909c63d
pages/digitalCourses/digitalCoursesDetails/components/testTree/index.js
@@ -1,4 +1,7 @@
const app = getApp();
import {
  loginInfo
} from '../../../../../assets/js/login';
Component({
  properties: {
    treeList: {
@@ -43,20 +46,12 @@
        openIds: e.detail.value,
      });
    },
    async goTest(e) {
      console.log(e, 666)
    goTest(e) {
      const gotoPageFun = async () => {
      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({
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          },
        });
      }
      if (!isTry && !this.data.isBuy) {
        return wx.showToast({
          icon: 'error',
@@ -103,6 +98,14 @@
            value.name
          }&answerType=${"option"}&storeInfo=${app.config.digitalCourses}`,
      });
      }
      const token = wx.getStorageSync(app.config.tokenKey)
      if (!token) {
        loginInfo(app, () => {})
      } else {
        gotoPageFun()
      }
    },
  },
});