zhongshujie
15 小时以前 e2bf73079051769b7b7cdc9627fc32ce64226144
packageBookService/pages/bookServices/detail/components/testResource/testResource.js
@@ -1,4 +1,7 @@
// pages/bookServices/detail/components/testResource/testResource.js
import {
  loginInfo
} from "../../../../../../assets/js/login";
const app = getApp();
Component({
  /**
@@ -79,10 +82,10 @@
          },
        });
      }
      if (!this.data.isBuyBank) return wx.showToast({
        icon: 'error',
        title: '请先购买题库',
      })
      // if (!this.data.isBuyBank) return wx.showToast({
      //   icon: 'error',
      //   title: '请先购买题库',
      // })
      wx.showLoading({
        title: "加载中",
      });
@@ -127,10 +130,11 @@
      wx.hideLoading();
      if (value.refCode == "psychology") {
        const listName = value.name
        const listId = value.id
        wx.navigateTo({
          url: `/packageBookService/pages/psychologyAnswer/psychologyAnswer?listName=${
            listName
        }`
        }&listId=${listId}`
        })
      } else {
        wx.navigateTo({
@@ -145,23 +149,25 @@
      }
    },
    goMycollect(e) {
      const answertype = e.currentTarget.dataset.answertype;
      const token = wx.getStorageSync("jsek-token");
      if (!token) {
        return wx.getUserProfile({
          desc: "用户登录",
          success: (res) => {
            console.log(res);
          },
      const gotoPage = () => {
        wx.navigateTo({
          url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
            this.properties.bookInfo.id
          }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${
            answertype == "collectQuestion" ? "我的收藏" : "我的错题"
          }&answerType=${answertype}`,
        });
      }
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
          this.properties.bookInfo.id
        }&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${
          answertype == "collectQuestion" ? "我的收藏" : "我的错题"
        }&answerType=${answertype}`,
      });
      const answertype = e.currentTarget.dataset.answertype;
      const token = wx.getStorageSync("jsek-token");
      if (token) {
        gotoPage()
      } else {
        loginInfo(app, (data) => {
          if (data) {}
        })
      }
    },
    // 练习 组件切换
    onRadioChange(e) {