闫增涛
2024-04-25 48c2210b211229d377f6a42de8070789d189ba5c
详情页资源加载慢问题修改
10个文件已修改
499 ■■■■ 已修改文件
packageBookService/pages/bookServices/detail/buyResource/index.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/buyResource/index.wxss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxml 273 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/components/tree/index.wxss 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.js 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/index.wxss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageDomain/pages/teacherCertification/index.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bookServices/assort/index.wxss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/retrievalPage/index.wxss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageBookService/pages/bookServices/detail/buyResource/index.wxml
@@ -27,7 +27,7 @@
  <t-loading size="60rpx" loading="{{loading}}" />
</view> -->
  <view class="page-bottom" style="margin-bottom: 20rpx;">
  <view class="page-bottom">
    <t-button theme="primary" size="large" class="btn-buy" bindtap="batchPurchase">批量购买</t-button>
  </view>
packageBookService/pages/bookServices/detail/buyResource/index.wxss
@@ -19,7 +19,7 @@
.buy-resource {
  overflow-y: auto;
  height: calc(100vh - env(safe-area-inset-bottom) - 140px);
  height: calc(100vh - env(safe-area-inset-bottom) - 146px);
}
.flex {
@@ -40,6 +40,7 @@
}
.page-bottom {
  margin-bottom: 20rpx;
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  width: 100%;
packageBookService/pages/bookServices/detail/components/tree/index.wxml
@@ -1,29 +1,94 @@
<view class="tree">
  <t-collapse default-value="{{openIds}}" catchchange="handleChange">
    <view wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" wx:if="{{item.sysType== 'CmsItem' }}">
      <view class="listItems" wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}">
    <view
      wx:for="{{treeList}}"
      wx:for-item="item"
      wx:for-index="index"
      wx:key="id"
      wx:if="{{item.sysType== 'CmsItem' }}"
    >
      <view
        class="listItems"
        wx:if="{{item.childrenFolderCount <= 0 && item.sysType == 'CmsItem'}}"
      >
        <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}">
          <view class="contentBox" bind:tap="goPlayer" data-item="{{item}}" data-parent="{{''}}">
          <view
            class="contentBox"
            bind:tap="goPlayer"
            data-item="{{item}}"
            data-parent="{{''}}"
          >
            <!-- 教学资源 云学习 图标 -->
            <view class="box-image" style="width: 100%">
              <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap">
              <view
                class="checkBox"
                wx:if="{{isShowCheck}}"
                catchtap="catchTap"
              >
                <!-- checked="{{citem.checked}}"  -->
                <!-- <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" catch:change="checkResource" data-item="{{citem}}" /> -->
                <t-checkbox disabled="{{!citem.saleMethod[0].Id}}" icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" data-parent="{{item}}" catch:change="checkResource" />
                <t-checkbox
                  disabled="{{!citem.saleMethod[0].Id}}"
                  icon="rectangle"
                  checked="{{item.checked}}"
                  data-item="{{item}}"
                  data-parent="{{item}}"
                  catch:change="checkResource"
                />
              </view>
              <!-- 教学资源图标 -->
              <view class="teach-icon">
                <image wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" />
                <image wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" />
                <image wx:elif="{{item.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" />
                <image wx:elif="{{item.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" />
                <image wx:elif="{{item.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" />
                <image wx:elif="{{item.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" />
                <image wx:elif="{{ item.fileMap[item.file].extension == 'doc' ||  item.fileMap[item.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" />
                <image wx:elif="{{ item.fileMap[item.file].extension == 'xlsx' ||  item.fileMap[item.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" />
                <image wx:elif="{{ item.fileMap[item.file].extension == 'ppt' ||  item.fileMap[item.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" />
                <image
                  wx:if="{{item.selectType == 'audio' || item.learnSelectType == 'audio'}}"
                  src="/static/images/bookService/detail/audioIcon.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{item.selectType == 'video' || item.learnSelectType == 'video'}}"
                  src="/static/images/bookService/detail/video.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{item.selectType == 'pdf'}}"
                  src="/static/images/bookService/detail/pdf.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{item.selectType == 'webpage'}}"
                  src="/static/images/bookService/detail/net.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{item.selectType == 'picture'}}"
                  src="/static/images/bookService/detail/picture.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{item.selectType == 'zip'}}"
                  src="/static/images/bookService/detail/zip.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'doc' ||  item.fileMap[item.file].extension == 'docx'}}"
                  src="/static/images/bookService/detail/word.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'xlsx' ||  item.fileMap[item.file].extension == 'xlsx'}}"
                  src="/static/images/bookService/detail/excel.png"
                  mode="aspectFill"
                />
                <image
                  wx:elif="{{ item.fileMap[item.file].extension == 'ppt' ||  item.fileMap[item.file].extension == 'pptx'}}"
                  src="/static/images/bookService/detail/PPT.png"
                  mode="aspectFill"
                />
                <!-- 资源无文件内容图标 -->
                <image wx:else src="/static/images/bookService/detail/word.png" mode="" />
                <image
                  wx:else
                  src="/static/images/bookService/detail/word.png"
                  mode=""
                />
              </view>
              <!-- 云学习图标 -->
              <view> </view>
@@ -43,20 +108,48 @@
            </view>
            <view wx:if="{{tab == 'jsek_cloudLearning'}}">
              <!-- 云学习试看图标 -->
              <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}"></image>
              <image
                src="/static/images/bookService/detail/shikan.png"
                class="testSee"
                wx:if="{{!item.isbuy ? false : item.freeFile ? true : false}}"
              ></image>
              <!-- 云学习加入购物车图标 -->
              <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{item.isShopCar}}" class="shopCar" data-item="{{item}}" catch:tap="onCloudShoppingCart"></image>
              <image
                src="/static/images/bookService/detail/cart@2x.png"
                wx:if="{{item.isShopCar}}"
                class="shopCar"
                data-item="{{item}}"
                catch:tap="onCloudShoppingCart"
              ></image>
              <!-- 云学习购买图标 -->
              <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{item.isbuy }}"></image>
              <image
                src="/static/images/bookService/detail/need-buy.png"
                class="need-buy"
                wx:if="{{item.isbuy }}"
              ></image>
            </view>
          </view>
        </view>
      </view>
    </view>
    <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{item.id}}" wx:if="{{item.sysType == 'CmsFolder' }}">
    <t-collapse-panel
      wx:for="{{treeList}}"
      wx:for-item="item"
      wx:for-index="index"
      wx:key="id"
      value="{{item.id}}"
      wx:if="{{item.sysType == 'CmsFolder' }}"
    >
      <view slot="header" class="header-title">
        <view class="title-checkBox" catchtap="catchTap">
          <t-checkbox style="align-items: center" icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" catchchange="checkResourceTitle" wx:if="{{isShowCheck}}" />
          <t-checkbox
            style="align-items: center"
            icon="rectangle"
            checked="{{item.checked}}"
            data-item="{{item}}"
            catchchange="checkResourceTitle"
            wx:if="{{isShowCheck}}"
          />
          <!-- 章节名 -->
          <view class="title-box">
            <view class="title-name">{{item.name}} </view>
@@ -66,40 +159,112 @@
          </view>
        </view>
      </view>
      <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex">
      <view
        class="list"
        wx:for="{{item.children}}"
        wx:for-item="citem"
        wx:for-index="cindex"
        wx:key="cindex"
      >
        <!-- // 判断 无子项 且为商品item 直接显示 -->
        <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}">
        <view
          class="listItems"
          wx:if="{{citem.childrenFolderCount <= 0 && citem.sysType == 'CmsItem'}}"
        >
          <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}">
            <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}">
            <view
              class="contentBox"
              bind:tap="goPlayer"
              data-item="{{citem}}"
              data-parent="{{item}}"
            >
              <!-- 教学资源 云学习 图标 -->
              <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}">
                <view class="checkBox" wx:if="{{isShowCheck}}" catchtap="catchTap">
              <view class="box-image">
                <view
                  class="checkBox"
                  wx:if="{{isShowCheck}}"
                  catchtap="catchTap"
                >
                  <!-- checked="{{citem.checked}}"  -->
                  <!-- <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" catch:change="checkResource" data-item="{{citem}}" /> -->
                  <t-checkbox disabled="{{!citem.saleMethod[0].Id}}" icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" data-parent="{{item}}" catch:change="checkResource" />
                  <t-checkbox
                    disabled="{{!citem.saleMethod[0].Id}}"
                    icon="rectangle"
                    checked="{{citem.checked}}"
                    data-item="{{citem}}"
                    data-parent="{{item}}"
                    catch:change="checkResource"
                  />
                </view>
                <!-- 教学资源图标 -->
                <view class="teach-icon">
                  <image wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" />
                  <image wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" />
                  <image wx:elif="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" />
                  <image wx:elif="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" />
                  <image wx:elif="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" />
                  <image wx:elif="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" />
                  <image wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' ||  citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" />
                  <image wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' ||  citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" />
                  <image wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' ||  citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" />
                  <image
                    wx:if="{{citem.selectType == 'audio' || citem.learnSelectType == 'audio'}}"
                    src="/static/images/bookService/detail/audioIcon.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{citem.selectType == 'video' || citem.learnSelectType == 'video'}}"
                    src="/static/images/bookService/detail/video.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{citem.selectType == 'pdf'}}"
                    src="/static/images/bookService/detail/pdf.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{citem.selectType == 'webpage'}}"
                    src="/static/images/bookService/detail/net.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{citem.selectType == 'picture'}}"
                    src="/static/images/bookService/detail/picture.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{citem.selectType == 'zip'}}"
                    src="/static/images/bookService/detail/zip.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'doc' ||  citem.fileMap[citem.file].extension == 'docx'}}"
                    src="/static/images/bookService/detail/word.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'xlsx' ||  citem.fileMap[citem.file].extension == 'xlsx'}}"
                    src="/static/images/bookService/detail/excel.png"
                    mode="aspectFill"
                  />
                  <image
                    wx:elif="{{ citem.fileMap[citem.file].extension == 'ppt' ||  citem.fileMap[citem.file].extension == 'pptx'}}"
                    src="/static/images/bookService/detail/PPT.png"
                    mode="aspectFill"
                  />
                  <!-- 资源无文件内容图标 -->
                  <image wx:else src="/static/images/bookService/detail/word.png" mode="" />
                  <image
                    wx:else
                    src="/static/images/bookService/detail/word.png"
                    mode=""
                  />
                </view>
                <!-- 云学习图标 -->
                <view> </view>
                <!-- 名称 -->
                <text class="name" style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}">{{citem.name || '-'}}</text>
                <text
                  class="name"
                  style="{{ tab == 'jsek_teachingResources' ? 'width: 420rpx;' : 'width: 400rpx;'}}"
                  >{{citem.name || '-'}}</text
                >
              </view>
              <!-- 教学资源类型 -->
              <view class="teachClass"> {{citem.resourceClass}} </view>
              <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}">
              <view
                class="teach-btn"
                wx:if="{{tab == 'jsek_teachingResources'}}"
              >
                <!--  下载按钮 -->
                <!-- <image
                  src="/static/images/bookService/detail/download-icon.png"
@@ -110,17 +275,41 @@
              </view>
              <view wx:if="{{tab == 'jsek_cloudLearning'}}">
                <!-- 云学习试看图标 -->
                <image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"></image>
                <image
                  src="/static/images/bookService/detail/shikan.png"
                  class="testSee"
                  wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"
                ></image>
                <!-- 云学习加入购物车图标 -->
                <image src="/static/images/bookService/detail/cart@2x.png" wx:if="{{citem.isShopCar}}" class="shopCar" data-item="{{citem}}" catch:tap="onCloudShoppingCart"></image>
                <image
                  src="/static/images/bookService/detail/cart@2x.png"
                  wx:if="{{citem.isShopCar}}"
                  class="shopCar"
                  data-item="{{citem}}"
                  catch:tap="onCloudShoppingCart"
                ></image>
                <!-- 云学习购买图标 -->
                <image src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{citem.isbuy }}"></image>
                <image
                  src="/static/images/bookService/detail/need-buy.png"
                  class="need-buy"
                  wx:if="{{citem.isbuy }}"
                ></image>
              </view>
            </view>
          </view>
        </view>
        <!-- // 判断 不是商品 有子项 递归组件 -->
        <tree wx:if="{{ citem.sysType == 'CmsFolder' }}" isShowCheck="{{isShowCheck}}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" learnList="{{learnList}}" itemId="{{itemId}}" tab="{{tab}}" buyIds="{{buyIds}}" openIds="{{openIds}}"></tree>
        <tree
          wx:if="{{ citem.sysType == 'CmsFolder' }}"
          isShowCheck="{{isShowCheck}}"
          bookInfo="{{bookInfo}}"
          treeList="{{[citem]}}"
          learnList="{{learnList}}"
          itemId="{{itemId}}"
          tab="{{tab}}"
          buyIds="{{buyIds}}"
          openIds="{{openIds}}"
        ></tree>
      </view>
      <!-- 暂无数据 -->
      <view wx:if="{{!item.children || !item.children.length}}" class="noData">
packageBookService/pages/bookServices/detail/components/tree/index.wxss
@@ -45,7 +45,8 @@
}
.contentBox {
  padding: 0 26rpx;
  margin: 0 26rpx;
  padding: 0 20rpx;
  height: 88rpx;
  background-color: #FFF6F0;
  margin-top: 24rpx;
@@ -60,7 +61,6 @@
}
.box-image {
  width: 350rpx;
  display: flex;
}
@@ -103,6 +103,10 @@
  height: 18rpx;
}
.listItems {
  padding-bottom: 20rpx;
}
/* .t-collapse-panel__content {
  padding: var(--td-collapse-content-padding, 0rpx) !important;
} */
packageBookService/pages/bookServices/detail/index.js
@@ -522,7 +522,6 @@
          this.setData({
            noFile: true,
          });
          // debugger
          if (this.data.bookDetail.pdf) {
            this.setData({
              "fileInfo.bookName": this.data.bookDetail.name,
@@ -671,15 +670,23 @@
            "buyResourceData.refCode": checkData.refCode,
          });
        }
        if (
          (e.detail.value == "jsek_teachingResources" &&
            !this.data.teach.length) ||
          (e.detail.value == "jsek_cloudLearning" && !this.data.learn.length) ||
          (e.detail.value == "questionBank" && !this.data.test.length)
        ) {
        // if (
        //   (e.detail.value == "jsek_teachingResources" &&
        //     !this.data.teach.length) ||
        //   (e.detail.value == "jsek_cloudLearning" && !this.data.learn.length) ||
        //   (e.detail.value == "questionBank" && !this.data.test.length)
        // ) {
        //   if (e.detail.value == "jsek_teachingResources") {
        //     wx.setStorageSync('teachResourcesPath', checkData.productLinkPath)
        //   }
        //   this.getResourceData(checkData);
        // }
        if ((e.detail.value == "jsek_teachingResources" && !this.data.teach.length) || (e.detail.value == "jsek_cloudLearning" && !this.data.learn.length)) {
          if (e.detail.value == "jsek_teachingResources") {
            wx.setStorageSync('teachResourcesPath', checkData.productLinkPath)
          }
          this.getResourceDataList(checkData)
        } else if (e.detail.value == "questionBank" && !this.data.test.length) {
          this.getResourceData(checkData);
        }
        if (e.detail.value == "questionBank" && token) this.getMockData();
@@ -718,7 +725,173 @@
      });
    });
  },
  //  获取教学资源  云学习  云测试
  // 扁平化数据转换tree
  getTreeList(rootList, pathLength, newArr, path) {
    for (const item of rootList) {
      if (item.productLinkPath.length == pathLength && item.productLinkPath.includes(path)) {
        if (item.sysType == 'CmsItem') {
          if (item.selectType == 'webpage') {
            item.disabled = true
          } else {
            if (item.isDownload != 1) {
              item.disabled = true
            }
          }
          if (item.file && item.fileMap && item.fileMap[item.file]) {
            if (item.fileMap[item.file].protectType == 'Private') item.disabled = true
          }
        }
        // newArr.push(item)
        // 在插入过程中对数据进行排序
        newArr = this.insertAndSortObjectsByProductLinkPath(newArr, item)
      }
    }
    //给数组里面再添加一个children的空数组
    for (const i of newArr) {
      i.children = []
      this.getTreeList(rootList, pathLength + 6, i.children, i.productLinkPath)
      if (i.children.length == 0) {
        delete i.children
      }
    }
    return newArr
  },
  // 去除树结构多余项
  ensureTreeConsistency(tree) {
    for (let index = 0; index < tree.length; index++) {
      const item = tree[index];
      if (item.children && item.children.length) {
        const isFloder = item.children.findIndex(citem => citem.sysType == 'CmsFolder')
        const isItem = item.children.findIndex(citem => citem.sysType == 'CmsItem')
        if (isFloder > -1 && isItem > -1) {
          item.children = item.children.filter(ditem => ditem.sysType == 'CmsItem')
        }
        this.ensureTreeConsistency(item.children)
      }
    }
    return tree
  },
  // 排序数组 按照productLinkPath
  insertAndSortObjectsByProductLinkPath(array, newObj) {
    // 查找新对象应该插入的位置
    let insertIndex = array.findIndex(obj => Number(newObj.productLinkPath.substring(newObj.productLinkPath.length - 6, newObj.productLinkPath.length)) < Number(obj.productLinkPath.substring(obj.productLinkPath.length - 6, obj.productLinkPath.length)));
    // 如果没有找到合适的位置,则放在数组末尾
    if (insertIndex === -1) {
      insertIndex = array.length;
    }
    // 插入新对象到数组
    array.splice(insertIndex, 0, newObj);
    // 测试6 正式5
    // 对数组进行排序
    array.sort((a, b) => {
      if (Number(a.productLinkPath.substring(a.productLinkPath.length - 5, a.productLinkPath.length)) < Number(b.productLinkPath.substring(b.productLinkPath.length - 5, b.productLinkPath.length))) {
        return -1;
      }
      if (Number(a.productLinkPath.substring(a.productLinkPath.length - 5, a.productLinkPath.length)) > Number(b.productLinkPath.substring(b.productLinkPath.length - 5, b.productLinkPath.length))) {
        return 1;
      }
      // a must be equal to b
      return 0;
    });
    // 返回更新后的数组
    return array;
  },
  // 教学资源 云学习 获取
  getResourceDataList(type) {
    this.setData({
      loading: true,
      noResources: false,
    });
    let query = {
      path: '*',
      queryType: '*',
      productId: this.data.bookDetail.id,
      cmsPath: type.productLinkPath,
      cmsType: '*',
      itemFields: {
        SysType: 'CmsFolder',
        // 资源类型,试读文件,是否允许下载等参数
        selectType: [],
        freeFile: [],
        file: [],
        protectedFile: [],
        resourcesClassification: [],
        isDownload: [],
        jsek_resourceBrief: [],
        jsek_link: [],
        jsek_questionBank: []
      },
      pading: {
        start: 0,
        size: 999
      },
    }
    app.MG.store.getProductDetail(query).then((res) => {
      if (!res.datas.cmsDatas[0].datas.length) {
        return this.setData({
          noResources: true,
          loading: false,
        });
      }
      let list = []
      // 测试 6位// 正式 5位//  测试调用传20,内部7  正式调用传17 内部传6
      //教学资源 云学习
      if (
        type.refCode == "jsek_teachingResources" ||
        type.refCode == "jsek_cloudLearning"
      ) {
        res.datas.cmsDatas[0].datas.forEach((item) => {
          item.checked = false;
          if (item.sysType == 'CmsItem') {
            // 教学资源 类型名称赋值
            this.data.resourceClassList.forEach((type) => {
              if (type.value == item.resourcesClassification)
                item.resourceClass = type.name;
            });
            if (this.data.tabValue == "jsek_teachingResources") {} else if (this.data.tabValue == "jsek_cloudLearning") {
              item.isbuy = this.isShowNeedBuy(item);
              item.isShopCar = this.isShoppingCart(item);
            }
          }
        });
        this.getTreeList(res.datas.cmsDatas[0].datas, 17, list, '\\')
        list = this.ensureTreeConsistency(list)
        console.log('修改后云', list);
        let result = [];
        if (type.refCode == "jsek_teachingResources") {
          this.findChildIds(list, result);
          this.setData({
            teach: list,
            loading: false,
            openTeachids: result,
          });
        } else if (type.refCode == "jsek_cloudLearning") {
          let arr = this.handleTreeData(list).filter(
            (item) => item.saleMethod[0]
          );
          let freeIds = arr.filter((item) => {
            return item.saleMethod[0].Price == 0;
          });
          if (!freeIds.length)
            this.setData({
              isshowDrawBtn: false,
            });
          this.findChildIds(list, result);
          this.setData({
            learn: list,
            loading: false,
            openLearnids: result,
          });
        }
      }
    })
  },
  //  获取 云测试
  getResourceData(type) {
    this.setData({
      loading: true,
@@ -1410,10 +1583,7 @@
    const checkData = this.data.cmsDatas.find(
      (item) => item.refCode == "jsek_cloudLearning"
    );
    this.getResourceData(checkData);
    this.getResourceDataList(checkData);
  },
  // 遍历树结构转换为数组方法
  handleTreeData(array) {
@@ -1800,8 +1970,6 @@
      });
      return false;
    }
    // debugger
    wx.navigateTo({
      url: "/packageBookService/pages/components/webView/index?md5=" +
        this.data.fileInfo.md5 +
packageBookService/pages/bookServices/detail/index.wxss
@@ -410,10 +410,10 @@
}
.t-tabs .t-tabs__item--active {
  background-repeat: no-repeat;
  background-size: 45% 45%;
  /* background-position: 65% 50%; */
  background-position: 50% center;
  background-size: 35%;
  background-position: 50% 40%;
  background-image: url(https://jsek.bnuic.com/home/image/click-icon.png);
}
packageDomain/pages/teacherCertification/index.wxss
@@ -233,7 +233,7 @@
.btn-area {
  width: 80%;
  margin: 0 auto;
  padding-bottom: 20rpx;
}
.submit {
pages/bookServices/assort/index.wxss
@@ -94,10 +94,9 @@
  display: inline-block;
}
.myScroll .row:last-child {
  /* 选择最后一个子件 清零边距 */
/* .myScroll .row:last-child {
  margin-right: 240rpx;
}
} */
.class-list {
  /* overflow-y: auto; */
pages/home/home.wxss
@@ -262,7 +262,7 @@
  color: #ff6d00;
  font-size: 30rpx;
  background-repeat: no-repeat;
  background-size: 40% 64%;
  background-size: 40%;
  background-position: right;
  background-image: url(https://jsek.bnuic.com/home/image/click-icon.png);
}
pages/retrievalPage/index.wxss
@@ -388,7 +388,7 @@
  background-repeat: no-repeat;
  background-image: url(https://jsek.bnuic.com/home/image/click-icon.png);
  background-position: 83% center;
  background-size: 45% 70%;
  background-size: 40%;
  /* 将背景图片位置设置为靠右 */
}