闫增涛
2025-03-31 04c7b0163caeae4ab1c5da62e301fa993101cfad
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!--packageCourse/pages/course/detail/index.wxml-->
<view class="contentTabBox">
  <view class="showInfo">
    <!-- 基本信息 -->
    <view class="baseInfoBox" wx:if="{{tabVal == 'base'}}">
      <view wx:if="{{!courseLoading}}">
        <view class="ID-State">
          <text class="ID">ID: {{detail.id}}</text>
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'WaitAudit'}}" variant="light" theme="warning">审核中</t-tag>
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'Reject'}}" variant="light" theme="danger">未通过</t-tag>
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'Normal'}}" variant="light" theme="success">使用中</t-tag>
        </view>
        <view class="statics">
          <view class="classCout">
            <text>班级总量</text>
            <text style="color: #ff6d00">{{classCount}}</text>
          </view>
        </view>
        <view class="courseInfo">
          <view class="intro">
            <view class="descTitle">课程简介</view>
            <view class="descCon">{{detail.description}}</view>
          </view>
          <view class="bookInfo">
            <view class="title">课程教材</view>
            <view class="bookData">
              <view class="bookText">
                <text>{{bookData.name}}</text>
                <text>作者:{{bookData.author}}</text>
                <text>ISBN:{{bookData.isbn}}</text>
              </view>
              <image wx:if="{{bookData.icon}}" class="bookIcon" src="{{bookData.icon}}" mode="" />
              <image wx:else class="bookIcon" src="/static/images/default-book-img.png" mode="" />
            </view>
          </view>
        </view>
      </view>
      <view class="block" wx:if="{{courseLoading}}">
        <view wx:for="{{4}}" wx:for-item="themeItem" wx:key="index">
          <view class="demo-section__content">
            <t-skeleton animation="gradient" theme="text"></t-skeleton>
            <t-skeleton animation="gradient" theme="paragraph"></t-skeleton>
          </view>
        </view>
      </view>
    </view>
    <!-- 班级管理 -->
    <view class="classBox" wx:else>
      <view class="header">
        <t-search style="flex: 1" value="{{searchKey}}" bind:clear="changeHandle" bind:submit="changeHandle" placeholder="搜索班级名称" clearable />
        <t-button bindtap="newClass" size="small" style="margin-left: 15rpx">开班</t-button>
      </view>
      <view class="contentList" wx:if="{{classList.length > 0 && !classLoading}}">
        <scroll-view class="scroll" class="content" bind:scroll="onPageScroll" model:scroll-top="{{setScrollValue}}" scroll-y refresher-enabled="{{true}}" lower-threshold="{{80}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bindrefresherpulling="{{refresh.onPulling}}" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom">
          <view slot="refresher" class="refresh-container">
            <view class="loading">
              <t-loading theme="circular" size="40rpx" text="正在刷新..." class="wrapper" />
            </view>
          </view>
          <view class="listClass" wx:for="{{classList}}" wx:key="index" data-class-id="{{item.id}}" data-item="{{item}}" bindtap="todetail">
            <view class="titleBox">
              <text class="className">{{item.name}}</text>
              <text class="classId" style="color: #999; font-size: 12px">ID: {{item.id}}</text>
            </view>
            <view class="infoBox">
              <text class="classTag" wx:if="{{item.applyState == 'WaitAudit'}}" style="color: #ef9f29">状态: 审核中</text>
              <text class="classTag" wx:if="{{item.applyState == 'Normal'}}" style="color: #1dbd11">状态: 进行中</text>
              <text class="classTag" wx:if="{{item.applyState == 'Reject'}}" style="color: red">状态: 未通过</text>
              <t-icon bindtap="delClass" data-del-id="{{item.id}}" class="delete" wx:if="{{item.applyState == 'Reject'}}" name="delete" color="red" size="18px" />
              <view wx:if="{{item.applyState == 'Reject'}}" class="reason">
                <text> 拒绝原因:</text>
                <t-tag style="margin-left: 0" bind:tap="showDialog" data-item="{{item}}" class="margin-16 replay" theme="danger">点击查看</t-tag>
              </view>
              <!-- <text class="classTag" wx:if="{{item.applyState == 'Reject'}}" style="color: red">拒绝原因:{{ item.reason != '' ? item.reason : '-' }}</text> -->
              <text class="classTag">班级人数: {{ item.memberCount }} / {{ item.maxUserCount
                }}</text>
              <text class="classTag">有效期:{{ item.beginDate }} - {{ item.endDate }}</text>
            </view>
          </view>
          <view class="bottom-loading" wx:if="{{bottomLoading}}">
            <t-loading theme="circular" size="40rpx" text="加载中..." class="wrapper" />
          </view>
          <view class="bottom-loading" style="color: #ccc; font-size: 28rpx" wx:if="{{isMoreData}}">
            <text>没有更多了</text>
          </view>
        </scroll-view>
      </view>
      <view class="content" wx:if="{{classList.length == 0 && !classLoading}}">
        <empty />
      </view>
      <view class="block" wx:if="{{classLoading}}">
        <view wx:for="{{4}}" wx:for-item="themeItem" wx:key="index">
          <view class="demo-section__content">
            <t-skeleton animation="gradient" theme="text"></t-skeleton>
            <t-skeleton animation="gradient" theme="paragraph"></t-skeleton>
          </view>
        </view>
      </view>
      <t-popup visible="{{visible}}" usingCustomNavbar placement="bottom">
        <view class="block-title">申请开班</view>
        <view class="block">
          <view class="classInfo">
            <view class="c-name">
              <text>班级名称</text>
              <t-input value="{{className}}" bindchange="onCourseNameInput" borderless clearable placeholder="请输入班级名称" />
            </view>
            <view class="c-desc">
              <text>班级人数</text>
              <t-input value="{{count}}" type="number" bindchange="onCourseDescInput" borderless placeholder="请输入班级人数" />
            </view>
            <view class="c-date">
              <text>班级有效期</text>
              <view class="dateBox">
                <view>
                  <t-input style="display:{{isShow}}" value="{{startTime}}" readonly borderless bindtap="openDateStart" placeholder="请选择开始时间" />
                  <t-calendar visible="{{visibleStart}}" bind:confirm="handleConfirmStart" bind:close="calendarClose"/>
                </view>
                <view>~</view>
                <view>
                  <t-input value="{{endTime}}" style="display:{{isShow}}" readonly borderless bindtap="openDateEnd" placeholder="请选择结束时间" />
                  <t-calendar visible="{{visibleEnd}}" bind:confirm="handleConfirmEnd" bind:close="calendarClose"/>
                </view>
              </view>
            </view>
          </view>
          <view class="classSubmit">
            <t-button style="padding: 0 25px; margin: 0 15px" size="small" bindtap="cancle" variant="outline">取消</t-button>
            <t-button style="padding: 0 25px; margin: 0" size="small" bindtap="submitClass">确认</t-button>
          </view>
        </view>
      </t-popup>
      <t-dialog visible="{{showContentOnly}}" bind:confirm="closeDialog" close-on-overlay-click>
        <scroll-view slot="content" type="list" scroll-y class="long-content">
          <view class="reasonContent">
            {{reason}}
          </view>
        </scroll-view>
        <view slot="confirm-btn" style="width: 100%">
          <t-button style="color: #ff6d00; border-top: 1px solid #eee" variant="text" bindtap="closeDialog" size="large" block t-class="external-class">知道了</t-button>
        </view>
      </t-dialog>
    </view>
  </view>
  <view class="tabbar-bottom">
    <view class="{{tabVal == 'base'?'tab-pubItem activeTab':'tab-pubItem'}}" data-str="base" bindtap="tabActive">
      <t-icon class="tabIcon" name="home" size="24px" />
      <text class="text">基本信息</text>
    </view>
    <view class="{{tabVal == 'class'?'tab-pubItem activeTab':'tab-pubItem'}}" data-str="class" bindtap="tabActive">
      <t-icon class="tabIcon" name="file-setting" size="24px" />
      <text class="text">班级管理</text>
    </view>
  </view>
</view>