| | |
| | | productLinkPath: '', |
| | | refCode: '', |
| | | haider: false, |
| | | naData: false |
| | | naData: false, |
| | | bookRefCode: [] |
| | | }, |
| | | |
| | | /** |
| | |
| | | // 扁平化数据转换tree |
| | | getTreeList(rootList, pathLength, newArr, path) { |
| | | for (const item of rootList) { |
| | | if (item.productLinkPath.length == pathLength && item.productLinkPath.includes(path)) { |
| | | if ((pathLength - item.productLinkPath.length >= 0 && pathLength - item.productLinkPath.length <= 3) && item.productLinkPath.includes(path)) { |
| | | if (item.sysType == 'CmsItem') { |
| | | if (item.selectType == 'webpage') { |
| | | item.disabled = true |
| | |
| | | itemFields: { |
| | | SysType: 'CmsFolder', |
| | | // 资源类型,试读文件,是否允许下载等参数 |
| | | learnSelectType: [], |
| | | selectType: [], |
| | | freeFile: [], |
| | | file: [], |
| | |
| | | // }) |
| | | // } |
| | | // debugger |
| | | this.getTreeList(res.datas.cmsDatas[0].datas, 17, list, '\\') |
| | | const num = query.cmsPath.length + 6 |
| | | this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\') |
| | | list = this.ensureTreeConsistency(list) |
| | | list = this.changeResourceChildren(list) |
| | | console.log('修改后云', list); |
| | |
| | | // productLinkPath: this.data.productLinkPath, |
| | | // refCode: this.data.refCode, |
| | | // }); |
| | | // this.getResourceCode( |
| | | // res.datas.id, |
| | | // res.datas.rootCmsItemId |
| | | // ) |
| | | this.getResourceDataList({ |
| | | productLinkPath: this.data.productLinkPath, |
| | | refCode: this.data.refCode, |
| | | }) |
| | | }); |
| | | |
| | | }, |
| | | getResourceCode(bookId, cmsId) { |
| | | let query = { |
| | | path: '*', |
| | | queryType: '*', |
| | | productId: bookId, |
| | | cmsPath: cmsId, |
| | | itemFields: { |
| | | SysType: 'Cms' |
| | | }, |
| | | pading: { |
| | | start: 99, |
| | | size: 0 |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then(res => { |
| | | console.log('图书资源', res.datas.cmsDatas[0].datas); |
| | | }) |
| | | }, |
| | | // 获取已购买商品 |
| | | getShoppingCartProductGet() { |
| | |
| | | if (isSHow) { |
| | | return false; |
| | | } else { |
| | | return data.saleMethod[0].price > 0 ? true : false; |
| | | return data.saleMethod[0].Price > 0 ? true : false; |
| | | } |
| | | return !isSHow; |
| | | } else { |
| | |
| | | this.setData({ |
| | | resourceClassList: JSON.parse(res[0].config).option, |
| | | }); |
| | | |
| | | }); |
| | | }, |
| | | checkAll() { |