| | |
| | | showDialog: false, |
| | | }); |
| | | }, |
| | | |
| | | // 初始化函数 |
| | | async init() { |
| | | // 获取图书详情,判断题库是否购买 |
| | | const query = { |
| | | path: "*", |
| | | queryType: "*", |
| | | productId: this.data.bookId, |
| | | favoriteTypes: "FavoriteBookCity", |
| | | itemFields: { |
| | | "SysType=": "CmsFolder", |
| | | }, |
| | | coverSize: { |
| | | height: 300, |
| | | }, |
| | | fields: {}, |
| | | }; |
| | | const res = await app.MG.store.getProductDetail(query) |
| | | const saleData = res.datas.saleMethod.find(item => item.Name.includes('题库')) |
| | | if (saleData && !res.datas.purchasedSaleMethodIdList.includes(saleData.Id)) return wx.showModal({ |
| | | title: '提示', |
| | | content: '请先购买题库再答题', |
| | | complete: (res) => { |
| | | this.setData({ |
| | | submitStatus: true |
| | | }) |
| | | wx.navigateBack() |
| | | } |
| | | }) |
| | | this.setData({ |
| | | loading: true, |
| | | subjectiveTotal: 0, |
| | |
| | | path: this.data.productLinkPath, |
| | | content |
| | | }), |
| | | type: 'Normal', |
| | | type: 'Public', |
| | | cmsTypeRefCode: '', |
| | | newDataListRequest: [] |
| | | } |