| | |
| | | const app = getApp() |
| | | import SparkMD5 from 'spark-md5' |
| | | import FormData from '../../../utils/formdata/index.js'; |
| | | import Wxml2Canvas from 'wxml2canvas'; |
| | | // import Wxml2Canvas from 'wxml2canvas'; |
| | | import { |
| | | worksDataBytool |
| | | } from "../../../assets/js/toolClass.js"; |
| | |
| | | selectActive: 'learn', |
| | | learnList: [], |
| | | testList: [], |
| | | testCount: 0, |
| | | openTeachids: [], |
| | | onlineQuestionsList: [], |
| | | //分页 |
| | |
| | | res.datas.cmsDatas[0].datas.forEach((item) => { |
| | | if (item.type == 'questionBankFolder' || item.type == 'questionBankItem') { |
| | | test.push(item) |
| | | |
| | | } else if (item.type != "resourceItem") { |
| | | this.data.playerList.forEach(pItem => { |
| | | if (pItem.cmsItemId == item.id) { |
| | |
| | | const data = test.filter( |
| | | (item) => item.type == 'questionBankFolder' && item.childrenFolderCount > 0 |
| | | ) |
| | | |
| | | if (data.length > 0) { |
| | | let list = [] |
| | | let addNum = query.cmsPath.length > 5 ? 7 : query.cmsPath.length > 6 ? 8 : 6 |
| | |
| | | list = this.ensureTreeConsistency(list) |
| | | let result = []; |
| | | this.findChildIds(list[0].children, result) |
| | | this.countLeafNodes(list[0].children) |
| | | this.setData({ |
| | | testList: list[0].children, |
| | | openTeachids: result, |
| | |
| | | } |
| | | }, |
| | | |
| | | //在线测试获取最后一个节点数量 |
| | | countLeafNodes(tree) { |
| | | tree.forEach(node => { |
| | | if (!node.children || node.children.length === 0) { |
| | | this.setData({ |
| | | testCount: this.data.testCount + 1 |
| | | }) |
| | | } else { |
| | | this.countLeafNodes(node.children); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //获取关联子商品/数字教材 |
| | | getRelationBook() { |
| | | app.MG.store.getProductList({ |