| | |
| | | */ |
| | | onLoad(options) { |
| | | console.log(options) |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | // 如果不是第一次登录,会执行回调 |
| | | if (data) { |
| | | // 登录成功,自动记录token和用户信息,并返回true |
| | | } else { |
| | | // 出现错误,返回false |
| | | } |
| | | }) |
| | | } else { |
| | | // 如果是第一次登录,会跳转至绑定用户信息页面,填写完用户信息后进行登录并储存token和用户信息,结束后跳转回当前页面(携带页面参数) |
| | | } |
| | | if (options && options.link) { |
| | | this.setData({ |
| | | src: decodeURIComponent(options.link), |
| | |
| | | src: '' |
| | | }) |
| | | if (options) { |
| | | console.log(options) |
| | | wx.setNavigationBarTitle({ |
| | | title: options.fileName, |
| | | skeletonLoding: true |
| | |
| | | "&token=" + |
| | | wx.getStorageSync(app.config.tokenKey) + |
| | | "&recordLocation=" + |
| | | that.data.currentPage + "&freeEpubPage=" + data.freePage |
| | | that.data.currentPage + "&isPreview=true&freeEpubPage=" + data.freePage |
| | | } |
| | | that.setData({ |
| | | src: url, |
| | |
| | | const src = app.config.requestCtx + '/file/GetPdfPageImage?md5=' + data.md5 + '&index=' + (i + 1) + '&dpi=300' |
| | | list.push(src) |
| | | } |
| | | console.log(list) |
| | | that.setData({ |
| | | pdfList: list, |
| | | skeletonLoding: false, |
| | | }) |
| | | |
| | | } |
| | | }) |
| | | } |