| | |
| | | mockList: [] // 用户组卷提交信息 |
| | | }, |
| | | flag: true, |
| | | applyResourceLoading: false, |
| | | noResources: false, |
| | | selectedIds: "",//商品或子商品销售方式 |
| | | bookBuy: false, //商品或子商品是否购买 |
| | |
| | | // 格式化日期 |
| | | formatDate(dateString) { |
| | | if (!dateString) { |
| | | return 'Invalid date'; |
| | | return ''; |
| | | } |
| | | const match = dateString.match(/^(\d{4})\/(\d{1,2})\/(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/); |
| | | if (!match) { |
| | |
| | | }); |
| | | this.getSubTtem(); |
| | | // 获取图书分类 |
| | | const iconType = JSON.parse(res.datas.bookClassification)[0][0]; |
| | | const classType = JSON.parse(res.datas.bookClassification)[0][1]; |
| | | const className = await this.getBookClass(iconType, classType) |
| | | let className = '' |
| | | if (Array.isArray(res.datas.bookClassification) && res.datas.bookClassification.length) { |
| | | const iconType = JSON.parse(res.datas.bookClassification)[0][0]; |
| | | const classType = JSON.parse(res.datas.bookClassification)[0][1]; |
| | | className = await this.getBookClass(iconType, classType) |
| | | } |
| | | // 获取组卷销售id |
| | | if (res.datas.saleMethod && res.datas.saleMethod.length) { |
| | | res.datas.saleMethod.forEach((item) => { |
| | |
| | | }) |
| | | } |
| | | }) |
| | | this.setData({ |
| | | applyResourceLoading: false |
| | | }) |
| | | wx.hideLoading() |
| | | }, |
| | | // 申请教学资源 |
| | | applyResource() { |
| | | this.setData({ |
| | | applyResourceLoading: true |
| | | wx.showLoading({ |
| | | title: '加载中', |
| | | }) |
| | | // let role = userStore.userInfo ? userStore.userInfo.role : null |
| | | // if (role) { |
| | |
| | | keys: [this.data.bookId] |
| | | }) |
| | | .then((res) => { |
| | | console.log(JSON.parse(res[0].value)); |
| | | if (res && res.length) { |
| | | const mock = JSON.parse(res[0].value) |
| | | mock.forEach(item => { |
| | |
| | | appplyElectronicBook() { |
| | | console.log(this.data.bookDetail) |
| | | if (this.data.bookDetail.isApplyBook == 2 || this.data.bookDetail.isApplyBook == 4) { |
| | | |
| | | let role = this.data.userInfo != null ? this.data.userInfo.role : null |
| | | if (role) { |
| | | if (role == 'Teacher') { |
| | |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书不能申请电子样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | }, |
| | | //申请纸质样书 |
| | |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | wx.showToast({ |
| | | title: "该书不能申请纸质样书", |
| | | icon: 'none', |
| | | duration: 1000, |
| | | }) |
| | | } |
| | | }, |
| | | //获取当前已申请次数(纸质) |