| | |
| | | checkAllState: true, |
| | | productLinkPath: '', |
| | | refCode: '', |
| | | haider: false |
| | | haider: false, |
| | | naData: false |
| | | }, |
| | | |
| | | /** |
| | |
| | | getTreeList(rootList, pathLength, newArr, path) { |
| | | for (const item of rootList) { |
| | | if (item.productLinkPath.length == pathLength && item.productLinkPath.includes(path)) { |
| | | item.checked = false; |
| | | if (item.sysType == 'CmsItem') { |
| | | if (item.selectType == 'webpage') { |
| | | item.disabled = true |
| | |
| | | if (item.file && item.fileMap && item.fileMap[item.file]) { |
| | | if (item.fileMap[item.file].protectType == 'Private') item.disabled = true |
| | | } |
| | | |
| | | item.isbuy = this.isShowNeedBuy(item); |
| | | item.isShopCar = this.isShoppingCart(item); |
| | | } |
| | | // newArr.push(item) |
| | | // 在插入过程中对数据进行排序 |
| | |
| | | } |
| | | } |
| | | }); |
| | | this.getTreeList(res.datas.cmsDatas[0].datas, 17, list, '\\') |
| | | // 显示 需要购买的和需要免费领取的 |
| | | const arr = res.datas.cmsDatas[0].datas.filter(item => this.resourceIsBuy(item)) |
| | | if (!arr.length) { |
| | | return this.setData({ |
| | | loading: false, |
| | | haider: true, |
| | | noData: true |
| | | }) |
| | | } |
| | | this.getTreeList(arr, 17, list, '\\') |
| | | list = this.ensureTreeConsistency(list) |
| | | console.log('修改后云', list); |
| | | let result = []; |
| | |
| | | }, |
| | | //购买按钮 |
| | | batchPurchase() { |
| | | if (!this.data.learn.length) { |
| | | return wx.showToast({ |
| | | icon: "error", |
| | | title: '暂无数据', |
| | | }) |
| | | } |
| | | let saleMethodIds = []; |
| | | let requests = []; |
| | | let item = []; |
| | |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "tree": "/packageBookService/pages/bookServices/detail/components/tree/index", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-button": "tdesign-miniprogram/button/button" |
| | | }, |
| | | "navigationStyle": "custom", |
| | |
| | | bind:changeListChecked="changeListChecked" |
| | | bind:changeResourceChecked="changeResourceChecked" |
| | | /> |
| | | <view class="noData" wx:if="{{noData}}"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- <view class="noData" wx:if="{{loading}}"> |
| | | <t-loading size="60rpx" loading="{{loading}}" /> |
| | | </view> --> |
| | | |
| | | <view class="page-bottom"> |
| | | <t-button |
| | |
| | | goPlayer(e) { |
| | | // 检查登录状态 |
| | | const token = wx.getStorageSync(app.config.tokenKey); |
| | | |
| | | if (token) { |
| | | const item = e.currentTarget.dataset.item; |
| | | const parent = e.currentTarget.dataset.parent; |
| | |
| | | "请先购买该资源" : "请先点击领取查看按钮", |
| | | }); |
| | | } |
| | | if (item.saleMethod.length == 0 && item.sysType == 'CmsItem' && this.properties.tab == "jsek_cloudLearning") { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '暂未开始销售,请联系管理员', |
| | | }) |
| | | } |
| | | if (this.properties.tab == "jsek_teachingResources" && item.fileMap) { |
| | | if (item.file && item.fileMap[item.file].protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '资源不可用,请联系管理员', |
| | | }) |
| | | } else if (item.freeFile && item.fileMap[item.freeFile].protectType !== "Public") { |
| | | return wx.showToast({ |
| | | icon: 'error', |
| | | title: '资源不可用,请联系管理员', |
| | | }) |
| | | } |
| | | } |
| | | wx.navigateTo({ |
| | | url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}`, |
| | | }); |
| | | |
| | | |
| | | if (item.selectType == "document" || item.selectType == "pdf") { |
| | | console.log(item, 'item789'); |
| | | // freeFile |
| | | const fileLink = item.file ? |
| | | app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file : app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.freeFile |