| | |
| | | import Message from 'tdesign-miniprogram/message/message'; |
| | | const util = require('./components/util') // 引入封装过的加载提示 |
| | | import { |
| | | loginInfo |
| | | } from '../../../../../../assets/js/login' |
| | | const app = getApp() |
| | | Component({ |
| | | // checked: false, |
| | |
| | | }, |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | if (this.properties.isShowCheck) return true |
| | | const item = e.currentTarget.dataset.item |
| | | const parent = e.currentTarget.dataset.parent |
| | |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`, |
| | | }) |
| | | |
| | | |
| | | if (item.selectType == 'document' || item.selectType == 'pdf') { |
| | | const fileLink = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file |
| | | console.log(fileLink, 'fileLink'); |
| | |
| | | util.hideLoadingWithErrorTips() |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | if (item.selectType == 'webpage') { |
| | | console.log(11); |
| | | this.setData({ |
| | | webpageSrc: item.jsek_link |
| | | }) |
| | | console.log(this.data.webpageSrc, 'webpageSrc'); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | }, |
| | | // 拿到所有项 |
| | | getAllChildren(id) { |