| | |
| | | openTeachids: [], |
| | | openLearnids: [], |
| | | openTestids: [], |
| | | isGoBuyResource: true, |
| | | learnPath: '', |
| | | applyResourceState: false, // 申请教学资源按钮防抖 |
| | | resourceClassList: [], // 资源所属分类 |
| | | applyState: "", // 教学资源申请状态 |
| | |
| | | this.setData({ |
| | | showIndex: '1' |
| | | }) |
| | | console.log(this.data.bookDetail.icon, '0111111'); |
| | | console.log(this.data.bookDetail.name, '45688'); |
| | | }, |
| | | // 跳转网店 |
| | | goShop(e) { |
| | |
| | | return num |
| | | }, |
| | | |
| | | // 给·目录添加子项数量 |
| | | // 给目录添加子项数量 |
| | | changeResourceChildren(list) { |
| | | const changeList = (list) => { |
| | | for (let index = 0; index < list.length; index++) { |
| | |
| | | } |
| | | } |
| | | }); |
| | | if (type.refCode == "jsek_cloudLearning") { |
| | | this.setData({ |
| | | learnPath: type.productLinkPath |
| | | }) |
| | | const dataList = res.datas.cmsDatas[0].datas |
| | | if (dataList.length) { |
| | | const tag = dataList.findIndex(item => item.saleMethod.length && item.saleMethod[0].Price > 0) |
| | | this.setData({ |
| | | isGoBuyResource: tag > -1 ? true : false |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | isGoBuyResource: false |
| | | }) |
| | | } |
| | | } |
| | | const num = query.cmsPath.length + 6 |
| | | this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\') |
| | | list = this.ensureTreeConsistency(list) |
| | |
| | | if (isSHow) { |
| | | return false; |
| | | } else { |
| | | return data.saleMethod[0].price > 0 ? true : false; |
| | | return data.saleMethod[0].Price > 0 ? true : false; |
| | | } |
| | | return !isSHow; |
| | | } else { |
| | |
| | | }; |
| | | // 确认订单 |
| | | const confirmOrderRes = await app.MG.store.confirmOrder(parameter); |
| | | console.log(confirmOrderRes.orderNumber, 'confirmOrderRes.orderNumber'); |
| | | |
| | | if (confirmOrderRes.orderNumber) { |
| | | child.changeReceive(false); |
| | | wx.showToast({ |
| | | title: "领取成功", |
| | | }); |
| | | this.getBookInfo(this.data.bookId); |
| | | this.getResourceDataList({ |
| | | refCode: 'jsek_cloudLearning', |
| | | productLinkPath: this.data.learnPath |
| | | }) |
| | | this.setData({ |
| | | successOrderNumber: confirmOrderRes.orderNumber |
| | | }) |
| | | |
| | | |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | |
| | | this.data.bookBuy + |
| | | "&bookId=" + |
| | | this.data.bookDetail.id, |
| | | |
| | | }); |
| | | }, |
| | | |
| | |
| | | const smBook = list.find(item => item.content[0].id == this.data.bookDetail.id) |
| | | console.log('已申请', smBook); |
| | | if (smBook && smBook.state == 'Normal') { |
| | | const flag = new Date(JSON.parse(smBook.feedBack).endDate + '23:59:59').getTime() > new Date().getTime() |
| | | const flag = new Date(smBook.feedBack.endDate + '23:59:59').getTime() > new Date().getTime() |
| | | if (flag) { |
| | | this.setData({ |
| | | applicationState: 'Normal' |
| | |
| | | }); |
| | | return false; |
| | | } else if (isApply.state == 'Normal') { |
| | | const flag = new Date(JSON.parse(isApply.feedBack).endDate + '23:59:59').getTime() > new Date().getTime() |
| | | const flag = new Date(isApply.feedBack.endDate + '23:59:59').getTime() > new Date().getTime() |
| | | if (flag) { |
| | | wx.showToast({ |
| | | title: "该书已申请!", |