From 38cd76c5f05fd55855038e2d393074e27909c63d Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 28 三月 2025 15:28:01 +0800 Subject: [PATCH] 剩余页面登录迁移 --- pages/digitalCourses/digitalCoursesDetails/index.js | 45 +++++++++++++++++++++++++-------------------- 1 files changed, 25 insertions(+), 20 deletions(-) diff --git a/pages/digitalCourses/digitalCoursesDetails/index.js b/pages/digitalCourses/digitalCoursesDetails/index.js index 36a5698..1212ec1 100644 --- a/pages/digitalCourses/digitalCoursesDetails/index.js +++ b/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) { -- Gitblit v1.9.1