litian
2024-09-07 ce3a08b28c16f5cce2185167f8a9030ee16898ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<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.children }}">
      <view class="listItems" wx:if="{{!item.children}}">
        <view class="itemsInfo" data-item="{{item}}" data-index="{{index}}">
          <view class="contentBox" >
            <view class="box-image fl-cn" style="width: 80%" bind:tap="goTest" data-item="{{item}}" data-parent="{{''}}">
              <!-- 测试题 -->
              <view class="teach-icon fl-cn">
                <image src="/static/images/bookService/detail/test-icon.png" mode="" />
              </view>
              <!-- 名称 -->
              <text class="name" style="width: 100%">{{item.name || '-'}}</text>
            </view>
            <view wx:if="{{!isBuy && item.istry ? true : false}}" bind:tap="goTest" data-item="{{item}}" data-parent="{{''}}" data-isTry="{{true}}">
              <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></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.children}}">
      <view slot="header" class="header-title">
        <view class="title-checkBox">
          <!-- 章节名 -->
          <view class="title-box">
            <view class="title-name">{{item.name}} </view>
          </view>
        </view>
      </view>
      <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.children}}">
          <view class="itemsInfo" data-item="{{citem}}" data-index="{{cindex}}">
            <view class="contentBox" >
              <view class="box-image fl-cn" bind:tap="goTest" data-item="{{citem}}" data-parent="{{item}}">
                <!-- 云测试图标 -->
                <view class="teach-icon fl-cn">
                  <image src="/static/images/bookService/detail/test-icon.png" mode="" />
                </view>
                <!-- 名称 -->
                <text class="name">{{citem.name || '-'}}</text>
              </view>
              <view wx:if="{{!isBuy && citem.istry ? true : false}}" bind:tap="goTest" data-item="{{citem}}" data-parent="{{item}}" data-isTry="{{true}}">
                <image src="/static/images/bookService/detail/lianxi-icon.png" class="testSee"></image>
              </view>
            </view>
          </view>
        </view>
        <!-- // 判断 不是商品 有子项 递归组件 -->
        <tree wx:if="{{ citem.children }}" bookInfo="{{bookInfo}}" treeList="{{[citem]}}" tab="{{tab}}" openIds="{{openIds}}" isBuy="{{isBuy}}"></tree>
      </view>
    </t-collapse-panel>
  </t-collapse>
</view>