| | |
| | | resourceClassList: [], // 资源所属分类 |
| | | applyState: "", // 教学资源申请状态 |
| | | deadline: "", // 教学资源申请有效日期, |
| | | isShowBuyCloundBtn: false, |
| | | isshowDrawBtn: true, // 云学习领取查看按钮是否显示 |
| | | isShowBuyCloundMenu: false, // 云学习全部购买按钮是否显示 |
| | | isCloundHaveSaleMethod: false, // 云学习是否有销售方式 |
| | | cloundMenuIsBuy: false, |
| | | learnTaskData: {}, |
| | | rejectCause: "", // 下载拒绝原因 |
| | | buyIdList: [], |
| | | shoppingCartGetId: [], // 已购买id列表 |
| | |
| | | fileList: [], |
| | | isShowUp: true, |
| | | protocolShow: false, |
| | | protocolTxt: '' |
| | | protocolTxt: '', |
| | | learnMenu: null, |
| | | md5List: [] |
| | | }, |
| | | |
| | | resetTree: function (e) { |
| | |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | this.setData({ |
| | | resourceCodeList: res.datas.cmsDatas[0].datas, |
| | | learnTaskData: res.datas.cmsDatas[0].datas.filter((item) => item.refCode == 'jsek_learningTasks')[0] |
| | | }) |
| | | console.log('refcode', this.data.resourceCodeList); |
| | | if (res.datas.cmsDatas[0].datas.length) this.setData({ |
| | | learnMenu: res.datas.cmsDatas[0].datas.find(item => item.refCode == 'jsek_cloudLearning') |
| | | }) |
| | | }) |
| | | }, |
| | | //请求子商品的文件 |
| | |
| | | cloundSaleMethod && |
| | | new Date().getTime() <= new Date(cloundSaleMethod.EndDate).getTime() && |
| | | new Date().getTime() >= new Date(cloundSaleMethod.BeginDate).getTime() |
| | | let md5s = [] |
| | | 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) |
| | | } |
| | | this.setData({ |
| | | md5List: md5s, |
| | | }); |
| | | } |
| | | if (flags) 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 |
| | | 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) |
| | | // 判断购物车按钮和锁按钮是否显示 |
| | | this.handleTreeData(list).forEach(item => { |
| | | item.isbuy = this.resourceIsBuy(item); |
| | |
| | | this.setData({ |
| | | isshowDrawBtn, |
| | | isShowBuyCloundMenu, |
| | | isShowBuyCloundBtn, |
| | | isCloundHaveSaleMethod: flags, |
| | | learn: list, |
| | | loading: false, |
| | |
| | | app.MG.ugc.newTopicMessage(query).then((res) => { |
| | | wx.showToast({ |
| | | icon: "success", |
| | | title: "请上传资源文件", |
| | | title: "上传成功", |
| | | }); |
| | | this.closeDialog() |
| | | }) |
| | |
| | | this.setData({ |
| | | cloundMenuIsBuy: flag |
| | | }) |
| | | } |
| | | }, |
| | | /** |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() {}, |
| | | onShareTimeline() {} |
| | | }) |