闫增涛
2025-03-28 38cd76c5f05fd55855038e2d393074e27909c63d
pages/digitalCourses/digitalCoursesDetails/index.js
@@ -167,8 +167,9 @@
      bookId: options.id,
      bookPath: parentPath.join('\\')
    })
    const token = wx.getStorageSync(app.config.tokenKey)
    this.digitalCoursesDetailsGet(options.id)
    this.getPlayerList()
    if (token) this.getPlayerList()
    this.getType()
  },
  logInFun(callback) {
@@ -193,7 +194,8 @@
   */
  onShow() {
    if (this.data.tabValue == 2 && this.data.selectActive == 'learn') {
      this.getPlayerList()
      const token = wx.getStorageSync(app.config.tokenKey)
      if (token) this.getPlayerList()
      this.getResource()
      this.getRelationBook()
    }
@@ -506,7 +508,8 @@
      pading: {
        start: 99,
        size: 0
      }
      },
    }
    app.MG.store.getProductDetail(query).then((res) => {
      let test = []
@@ -742,30 +745,32 @@
  },
  readTextBook() {
    wx.navigateTo({
      url: '/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index?refCode=' + this.data.relationTextBook.refCode + '&tryPageCount=' + this.data.relationTextBook.probationPage + '&isTextBookBuy=' + this.data.isTextBookBuy
    })
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      this.logInFun(() => {})
    } else {
      wx.navigateTo({
        url: '/pages/digitalCourses/digitalCoursesDetails/components/digitalRead/index?refCode=' + this.data.relationTextBook.refCode + '&tryPageCount=' + this.data.relationTextBook.probationPage + '&isTextBookBuy=' + this.data.isTextBookBuy
      })
    }
  },
  //在线测试我的收藏、我的错题
  goMycollect(e) {
    const answertype = e.currentTarget.dataset.answertype;
    const token = wx.getStorageSync("jsek-token");
    const token = wx.getStorageSync(app.config.tokenKey)
    if (!token) {
      return wx.getUserProfile({
        desc: "用户登录",
        success: (res) => {
          console.log(res);
        },
      this.logInFun(() => {})
    } else {
      const answertype = e.currentTarget.dataset.answertype;
      wx.navigateTo({
        url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
          this.data.digitalsData.id
        }&rootCmsItemId=${this.data.digitalsData.rootCmsItemId}&answerTitle=${
          answertype == "collectQuestion" ? "我的收藏" : "我的错题"
        }&answerType=${answertype}&storeInfo=${app.config.digitalCourses}`,
      });
    }
    wx.navigateTo({
      url: `/packageBookService/pages/bookServices/examination/examination?bookId=${
        this.data.digitalsData.id
      }&rootCmsItemId=${this.data.digitalsData.rootCmsItemId}&answerTitle=${
        answertype == "collectQuestion" ? "我的收藏" : "我的错题"
      }&answerType=${answertype}&storeInfo=${app.config.digitalCourses}`,
    });
  },
  onCorrelationBook(e) {