| | |
| | | }, |
| | | }); |
| | | } |
| | | // if (!this.data.isBuyBank) return wx.showToast({ |
| | | // icon: 'error', |
| | | // title: '请先购买题库', |
| | | // }) |
| | | if (!this.data.isBuyBank) return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买题库', |
| | | }) |
| | | wx.showLoading({ |
| | | title: "加载中", |
| | | }); |
| | |
| | | if (value.refCode == "psychology") { |
| | | const listName = value.name |
| | | const listId = value.id |
| | | const bookId = this.data.bookInfo.id |
| | | const bookName = this.data.bookInfo.name |
| | | const formPath = this.data.tab |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/psychologyAnswer/psychologyAnswer?listName=${ |
| | | listName |
| | | }&listId=${listId}` |
| | | listName}&listId=${listId}&bookId=${bookId}&bookName=${bookName}&formPath=${formPath}` |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | |
| | | onLoad(options) { |
| | | // 在此进行是否购买的查询 |
| | | const questionId = options.listId; |
| | | const bookId = options.bookId |
| | | const bookName = options.bookName |
| | | const formPath = options.formPath |
| | | const query = { |
| | | "cmsItemId": Number(questionId) |
| | | }; |
| | | |
| | | app.MG.file.checkCmsItem(query) |
| | | .then((res) => { |
| | | const isBuys = res; |
| | |
| | | wx.showModal({ |
| | | icon: 'error', |
| | | title: '温馨提示', |
| | | content: '请购买题库,即将返回首页', |
| | | content: '请购买题库,即将返回购买页', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', // 替换为你的首页路径 |
| | | }); |
| | | wx.navigateTo({ |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + bookId + '&name=' + bookName + '&tabValue=' + formPath, |
| | | }) |
| | | } |
| | | } |
| | | }); |