From abbd7d18ea431ee8b6b8e634abf3e8ccb1fbb1b3 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 28 三月 2025 18:43:33 +0800 Subject: [PATCH] 登录迁移 --- packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js | 81 +++++++++++++++++++++++++++++++++------- 1 files changed, 67 insertions(+), 14 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js index 9fbe534..5ee8695 100644 --- a/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js +++ b/packageBookService/pages/bookServices/detail/components/learnResource/learnResource.js @@ -1,4 +1,7 @@ // pages/bookServices/detail/components/learnResource/learnResource.js +import { + loginInfo +} from "../../../../../../assets/js/login"; Component({ /** * 缁勪欢鐨勫睘鎬у垪琛� @@ -9,7 +12,27 @@ }, bookId: { type: Number - } + }, + isshowDrawBtn: { + type: Boolean + }, + successOrderNumber: { + type: Number, + }, + isGoBuyResource: { + type: Boolean + }, + isShowBuyCloundMenu: { + type: Boolean, + default: false + }, + isShowBuyCloundBtn: { + type: Boolean, + default: true + }, + learnTaskData: { + type: Object, + }, }, /** @@ -32,19 +55,26 @@ } // 瑙﹀彂浜嬩欢鐨勯�夐」 this.triggerEvent('getFreeResource', myEventDetail, myEventOption) }, - // allAddShoppiingCar() { - // var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 - // var myEventOption = { - // bubbles: true, - // composed: true - // } // 瑙﹀彂浜嬩欢鐨勯�夐」 - // this.triggerEvent('allAddShoppiingCar', myEventDetail, myEventOption) - // }, + // 璺宠浆璧勬簮璐拱椤� goBuyResource() { - wx.navigateTo({ - url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, - }) - + const token = wx.getStorageSync(app.config.tokenKey); + if (token) { + gotoPageFun() + } else { + loginInfo(app, (data) => { + }) + } + const gotoPageFun = () => { + if (!this.properties.isGoBuyResource) { + return wx.showToast({ + icon: 'error', + title: '鏆傛棤鍙喘涔拌祫婧�', + }) + } + wx.navigateTo({ + url: `/packageBookService/pages/bookServices/detail/buyResource/index?productLinkPath=${this.properties.buyResourceData.productLinkPath}&refCode=${this.properties.buyResourceData.refCode}&bookId=${this.properties.bookId}`, + }) + } }, changeReceive(type) { @@ -56,6 +86,29 @@ this.setData({ buy: type }) + }, + goLearnTask() { + const token = wx.getStorageSync(app.config.tokenKey); + if (token) { + gotoPageFun() + } else { + loginInfo(app, (data) => { + if (data) gotoPageFun() + }) + } + const gotoPageFun = () => { + wx.navigateTo({ + url: `/packageBookService/pages/bookServices/detail/components/learnTask/index?bookId=${this.properties.bookId}&cmsPath=${this.properties.learnTaskData?.productLinkPath}`, + }) + } + }, + buyCloudLearnClass() { + var myEventDetail = {} // detail瀵硅薄锛屾彁渚涚粰浜嬩欢鐩戝惉鍑芥暟 + var myEventOption = { + bubbles: true, + composed: true + } // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent('buyCloudLearnClass', myEventDetail, myEventOption) } } -}) +}) \ No newline at end of file -- Gitblit v1.9.1