| | |
| | | protocolShow: false, |
| | | protocolTxt: '', |
| | | learnMenu: null, |
| | | md5List: [] |
| | | md5List: [], |
| | | editDialog: false |
| | | }, |
| | | |
| | | resetTree: function (e) { |
| | |
| | | this.setData({ |
| | | tabValue: options.tabValue, |
| | | }); |
| | | |
| | | |
| | | } |
| | | }, |
| | | |
| | |
| | | }, |
| | | // 获取图书详情 |
| | | getBookInfo(id) { |
| | | console.log(id, "id") |
| | | this.setData({ |
| | | "mockData'.id": 0, |
| | | "mockData.price": 0, |
| | |
| | | protectedEpub: [], |
| | | probationPage: [], //pdf试读页数 |
| | | freeEpubPage: [], //epub试读百分比 |
| | | bookEditor: [], //图书编辑 |
| | | contactInformation: [], //联系方式 |
| | | }, |
| | | }; |
| | | app.MG.store.getProductDetail(query).then(async (res) => { |
| | | this.getResourceCode(id, res.datas.rootCmsItemId) |
| | | console.log(res.datas, "res.datas") |
| | | res.datas.bookEditor = res.datas.bookEditor ? res.datas.bookEditor : '-' |
| | | res.datas.contactInformation = res.datas.contactInformation ? res.datas.contactInformation : '-' |
| | | this.setData({ |
| | | bookDetail: res.datas, |
| | | buyIdList: res.datas.purchasedSaleMethodIdList, |
| | |
| | | } |
| | | await this.getBookClass(classData); |
| | | } |
| | | } |
| | | // 扫码从题库跳转回图书详情 |
| | | const localData = wx.getStorageSync('tabValue') |
| | | if (localData) { |
| | | this.setData({ |
| | | tabValue: localData |
| | | }) |
| | | wx.removeStorage({ |
| | | key: 'tabValue', |
| | | }) |
| | | } |
| | | if (this.data.tabValue == 'questionBank' || this.data.tabValue == 'jsek_cloudLearning' || this.data.tabValue == 'jsek_teachingResources') { |
| | | const checkData = this.data.cmsDatas.find( |
| | |
| | | "bookDetail.paperPrice": this.numFormat( |
| | | this.data.bookDetail.paperPrice |
| | | ), |
| | | |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 联系 |
| | | editPhone() { |
| | | this.setData({ |
| | | editDialog: true |
| | | }) |
| | | }, |
| | | |
| | | // 我要建议 |
| | | suggestBtn() { |
| | | // 检查登录状态 |
| | |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | // 云学习上有销售方式,去掉云学习下所有销售方式 |
| | | if (this.data.tabValue == "jsek_teachingResources") { |
| | | |
| | | if (item.file || item.freeFile) { |
| | | let md5 = item.file ? item.file : item.freeFile |
| | | md5s.push(md5) |
| | |
| | | md5List: md5s, |
| | | }); |
| | | } |
| | | if (flags) item.saleMethod = [] |
| | | if (flags && cloundSaleMethod.Price > 0) item.saleMethod = [] |
| | | item.checked = false; |
| | | if (item.sysType == 'CmsItem') { |
| | | // 教学资源 类型名称赋值 |
| | |
| | | new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime() |
| | | ) || (flags && cloundSaleMethod.Price == 0) |
| | | // 判断云学习全部购买按钮是否显示 |
| | | let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) |
| | | let isShowBuyCloundMenu = flags && cloundSaleMethod.Price > 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id) |
| | | // 判断资源购买按钮是否显示 |
| | | let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0) |
| | | // 判断购物车按钮和锁按钮是否显示 |
| | |
| | | isshowDrawBtn, |
| | | isShowBuyCloundMenu, |
| | | isShowBuyCloundBtn, |
| | | isCloundHaveSaleMethod: flags, |
| | | isCloundHaveSaleMethod: flags && cloundSaleMethod.Price > 0, |
| | | learn: list, |
| | | loading: false, |
| | | openLearnids: result, |
| | |
| | | (item) => item == saleData.Id |
| | | ); |
| | | // 已经购买 |
| | | if (isShow) return false |
| | | if (isShow || saleData.Price == 0) return false |
| | | // 未购买,查看销售方式是否过期 |
| | | if (!isShow) { |
| | | const flag = new Date(saleData.EndDate).getTime() >= new Date().getTime() && |
| | |
| | | // 云学习全部购买 |
| | | async buyCloudLearnClass() { |
| | | const cloundMenu = this.data.resourceCodeList.find((item) => item.refCode == 'jsek_cloudLearning') |
| | | debugger |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests: [{ |