| | |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | // 检查CmsItem 权限 |
| | | checkCmsItem(data) { |
| | | return request({ |
| | | url: '/file/api/ApiCheckCmsItemAccessRights', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | }); |
| | | } |
| | | if (!this.data.isBuyBank) return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先购买题库', |
| | | }) |
| | | // if (!this.data.isBuyBank) return wx.showToast({ |
| | | // icon: 'error', |
| | | // title: '请先购买题库', |
| | | // }) |
| | | wx.showLoading({ |
| | | title: "加载中", |
| | | }); |
| | |
| | | wx.hideLoading(); |
| | | if (value.refCode == "psychology") { |
| | | const listName = value.name |
| | | const listId = value.id |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/psychologyAnswer/psychologyAnswer?listName=${ |
| | | listName |
| | | }` |
| | | }&listId=${listId}` |
| | | }) |
| | | } else { |
| | | wx.navigateTo({ |
| | |
| | | openIds: e.detail.value, |
| | | }); |
| | | }, |
| | | |
| | | goTest(e) { |
| | | const value = e.currentTarget.dataset; |
| | | var myEventDetail = { |
| | |
| | | }); |
| | | } |
| | | if (data.length > 0) { |
| | | console.log('data', data); |
| | | console.log('data01', data); |
| | | let list = [] |
| | | that.getTreeList(data, list, query.cmsPath) |
| | | list = that.ensureTreeConsistency(list) |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isBuy: false, // 是否需要购买 |
| | | questuionName: "", //试卷名称 |
| | | dataList: "", |
| | | barHeight: "", |
| | |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | const questuionName = options.listName |
| | | // 在此进行是否购买的查询 |
| | | const questionId = options.listId; |
| | | const query = { |
| | | "cmsItemId": Number(questionId) |
| | | }; |
| | | |
| | | app.MG.file.checkCmsItem(query) |
| | | .then((res) => { |
| | | const isBuys = res; |
| | | this.setData({ |
| | | questuionName: questuionName |
| | | }) |
| | | isBuy: isBuys |
| | | }); |
| | | if (!isBuys) { |
| | | wx.showModal({ |
| | | icon: 'error', |
| | | title: '温馨提示', |
| | | content: '请购买题库,即将返回首页', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.switchTab({ |
| | | url: '/pages/home/home', // 替换为你的首页路径 |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | return; // 直接返回,避免执行后续代码 |
| | | } |
| | | |
| | | // 其他逻辑 |
| | | const questuionName = options.listName; |
| | | this.setData({ |
| | | questionName: questuionName |
| | | }); |
| | | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = |
| | | (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) { |
| | |
| | | } else { |
| | | this.init(); |
| | | } |
| | | }) |
| | | }); |
| | | } else { |
| | | this.init() |
| | | this.init(); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error('检查题库失败:', err); |
| | | wx.showToast({ |
| | | icon: 'error', |
| | | title: '加载失败,请重试' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | |
| | | } |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | icon: 'none', |
| | | title: '请先返回资源所在图书详情购买视频资源', |
| | | }) |
| | | wx.showModal({ |
| | | title: '温馨提示', |
| | | content: '请先返回资源所在图书详情购买视频资源', |
| | | confirmText: '确定', |
| | | showCancel: false, // 关闭取消按钮 |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.navigateTo({ |
| | | url: `/packageBookService/pages/bookServices/detail/index?id=${this.data.bookDetail.id}&name=${this.data.bookDetail.name}&tabValue=${this.data.formPath}`, |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | this.setData({ |
| | | loading: false, |
| | | hidden: false, |
| | |
| | | "include": [] |
| | | }, |
| | | "appid": "wx7f362fe7cb6e0d1f", |
| | | "libVersion": "3.6.3", |
| | | "libVersion": "3.8.10", |
| | | "projectname": "jsek-applet" |
| | | } |