| | |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | // storeInfo: this.data.options.storeInfo, |
| | | productId: this.data.bookDetail.id, |
| | | cmsPath: type.productLinkPath, |
| | | cmsType: '*', |
| | |
| | | file: [], |
| | | protectedFile: [], |
| | | resourcesClassification: [], |
| | | isDownload: [], |
| | | // isDownload: [], |
| | | jsek_resourceBrief: [], |
| | | jsek_link: [], |
| | | jsek_questionBank: [] |
| | | }, |
| | | pading: { |
| | | start: 0, |
| | |
| | | }, |
| | | } |
| | | app.MG.store.getProductDetailNoChildren(query).then((res) => { |
| | | console.log('未处理资源', res.datas.cmsDatas[0].datas); |
| | | if (!res.datas.cmsDatas[0].datas.length) { |
| | | return this.setData({ |
| | | noResources: true, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | // 云学习全部购买 |
| | | async buyCloudLearnClass() { |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | debugger |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests: [{ |
| | | saleMethodId: cloundMenu.saleMethod.find((eitem) => eitem.SaleType == 'Normal').Id, |
| | | count: 1 |
| | | }] |
| | | } |
| | | const initOrderRes = await app.MG.store.initOrder(query) |
| | | // 检查订单号是否存在 |
| | | if (initOrderRes.orderNumber) { |
| | | // bookService: orderNumber.value, 少传这个 ,暂时不知道有什么用 |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNumber=${initOrderRes.orderNumber}`, |
| | | }); |
| | | } else { |
| | | // 订单号不存在,显示警告消息 |
| | | wx.showToast({ |
| | | icon: "error", |
| | | title: "请重试", |
| | | }); |
| | | } |
| | | }, |
| | | // 云学习字段购买 |
| | | async buyCloundMenu() { |
| | | const cloundData = this.data.resourceCodeList.find(item => item.refCode == 'jsek_cloudLearning') |
| | |
| | | return childrenList |
| | | }, |
| | | uploadFile(e) { |
| | | const userInfo = JSON.parse(wx.getStorageSync(app.config.userInfoKey)) |
| | | if (userInfo.role != 'Teacher') return wx.showToast({ |
| | | icon: 'error', |
| | | title: '请先进行教师认证', |
| | | }) |
| | | this.setData({ |
| | | dialogBox: true, |
| | | isShowUp: true |