litian
2024-09-02 cc670c2b2aa7256c82b8895a1e405cdad7912923
ceshi
2个文件已修改
21 ■■■■■ 已修改文件
pages/digitalCourses/digitalCoursesDetails/index.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/digitalCourses/digitalCoursesDetails/index.js
@@ -2,7 +2,7 @@
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";
@@ -66,6 +66,7 @@
    selectActive: 'learn',
    learnList: [],
    testList: [],
    testCount: 0,
    openTeachids: [],
    onlineQuestionsList: [],
    //分页
@@ -401,6 +402,7 @@
        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) {
@@ -438,6 +440,7 @@
          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
@@ -446,6 +449,7 @@
            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,
@@ -579,6 +583,19 @@
    }
  },
  //在线测试获取最后一个节点数量
  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({
pages/digitalCourses/digitalCoursesDetails/index.wxml
@@ -139,7 +139,7 @@
              </view>
              <view wx:if="{{selectActive == 'test'}}">
                <view class="testBtnBox">
                  <view class="textTile">共{{}}个</view>
                  <view class="textTile">共{{testCount}}个</view>
                  <view class="note-btn">
                    <t-button theme="primary" class="make-note" bind:tap="goMycollect" data-answerType="errorQuestion" style="width: 220rpx">
                      <view slot="content" class="btn-content">