闫增涛
2024-12-23 9f8a5f2ada396ed94f18b6c30a896ceb0da41351
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!--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"
                  />
                </view>
                <view>~</view>
                <view>
                  <t-input
                    value="{{endTime}}"
                    style="display:{{isShow}}"
                    readonly
                    borderless
                    bindtap="openDateEnd"
                    placeholder="请选择结束时间"
                  />
                  <t-calendar
                    visible="{{visibleEnd}}"
                    bind:confirm="handleConfirmEnd"
                  />
                </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
      >
        <view slot="content" class="reasonContent"> {{reason}} </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>