| | |
| | | |
| | | // 通过code查询班级 |
| | | getClassDetail() { |
| | | if (this.data.refCode == '') { |
| | | if (!this.data.refCode) { |
| | | wx.showToast({ |
| | | title: '请输入邀请码', |
| | | duration: 1000, |
| | | icon: "none", |
| | | }) |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | return false |
| | | } |
| | |
| | | app.MG.edu |
| | | .getCourseClass(data) |
| | | .then(res => { |
| | | if (res) { |
| | | if (res.linkProductDto) { |
| | | res.classTime = moment(res.beginDate).format('YYYY-MM-DD') + '--' + moment(res.endDate).format('YYYY-MM-DD') |
| | | this.setData({ |
| | | classDetail: res |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | wx.showToast({ |
| | | title: '邀请码无效', |
| | | icon: "none" |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | wx.showToast({ |
| | | title: '邀请码无效', |
| | | icon: "none" |
| | | }) |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | console.log(err) |
| | | }) |
| | | }, |
| | |
| | | // 关闭申请 |
| | | cancle() { |
| | | this.setData({ |
| | | visible: false |
| | | visible: false, |
| | | classDetail: null, |
| | | refCode: '' |
| | | }) |
| | | }, |
| | | |
| | |
| | | classList: list, |
| | | totalSize: totalSize, |
| | | visible: false, |
| | | classDetail: null, |
| | | refCode: '', |
| | | skeletonLoding: false, |
| | | bottomLoading: false |
| | | }) |
| | |
| | | }, |
| | | |
| | | // 获取教材详情 |
| | | async getBookDetail(shopId) { |
| | | async getBookDetail(shopId, path) { |
| | | let query = { |
| | | path: 'jsek_digitalTextbooks', |
| | | path, |
| | | queryType: '*', |
| | | productId: String(shopId), |
| | | storeInfo: 'jsek_digitalTextbooks', |
| | | storeInfo: path, |
| | | coverSize: { |
| | | height: 300, |
| | | width: 210 |
| | |
| | | classId, |
| | | item |
| | | } = e.currentTarget.dataset |
| | | const bookData = await this.getBookDetail(item.linkProductDto?.product?.id) |
| | | const bookRefCode = item.linkProductDto?.product?.refCode |
| | | const path = bookRefCode ? 'jsek_digitalTextbooks' : 'defaultGoodsStore3' |
| | | const bookData = await this.getBookDetail(item.linkProductDto?.product?.id, path) |
| | | if (item.userState == 'WaitValid' || item.userState == 'Reject') { |
| | | wx.showToast({ |
| | | title: item.userState == 'WaitValid' ? '审核中' : '未通过', |
| | |
| | | return false |
| | | } |
| | | wx.navigateTo({ |
| | | url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&bookId=' + bookData.id + '&author=' + bookData.author + '&isbn=' + bookData.isbn + '&rootCmsItemId=' + bookData.rootCmsItemId, |
| | | url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&bookId=' + bookData.id + '&author=' + bookData.author + '&isbn=' + bookData.isbn + '&rootCmsItemId=' + bookData.rootCmsItemId + '&bookRefCode=' + bookRefCode, |
| | | }) |
| | | }, |
| | | |