111
QYF-GitLab1
2025-01-02 c5b6f319a21021892a299036c22862b1a3b2ad53
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
<!--packageCourse/pages/course/index.wxml-->
<view class="contentBox" wx:if="{{!skeletonLoding}}">
  <view class="header">
    <t-search style="flex:1" value="{{searchKey}}" bind:clear="changeHandle" bind:submit="changeHandle" placeholder="搜索名称" clearable />
  </view>
  <view class="tabComtyent">
    <t-tabs class="custom-tabs" defaultValue="{{currentState}}" bind:change="onTabsChange" t-class="custom-tabs">
      <t-tab-panel label="已通过" value="Normal" />
      <t-tab-panel label="待审核" value="WaitValid" />
      <t-tab-panel label="未通过" value="Reject" />
    </t-tabs>
  </view>
  <view class="contentList" wx:if="{{userList.length > 0}}">
    <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="userList" wx:for="{{userList}}" wx:key="index">
        <view class="userInfo" bindtap="selectUser" data-index="{{index}}">
          <t-checkbox wx:if="{{item.linkType != 'Creator'}}" block="{{false}}" checked="{{item.isCheck}}" />
          <t-avatar class="avatar-example" size="small" image="{{item.appUser.icon}}" />
          <text class="user">{{item.appUser.name}}</text>
        </view>
        <view>
          <text style="color: #ff6d00;" wx:if="{{item.linkType == 'Creator'}}">创建人</text>
          <t-button bindtap="selectIdentity" data-item="{{item}}" style="margin: 0;color: #67c23a;" size="extra-small" wx:if="{{item.state != 'Normal' && item.linkType != 'Creator' && item.state != 'Reject'}}" variant="text">通过</t-button>
          <t-button bindtap="removeStudent" data-item="{{item}}" style="margin: 0;color: red;" size="extra-small" wx:if="{{item.linkType != 'Creator' && (item.state == 'Normal' || item.state == 'Reject')}}" variant="text">移除</t-button>
          <t-button bindtap="updateStateReject" data-item="{{item}}" style="margin: 0;color: #ff6d00;" size="extra-small" wx:if="{{item.linkType != 'Creator' && item.state != 'Normal' && item.state != 'Reject' }}" variant="text">拒绝</t-button>
        </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="{{userList.length == 0}}">
    <empty />
  </view>
  <view class="navBottom">
    <view class="navBottom-check">
      <t-checkbox block="{{false}}" label="全选" disabled="{{userList.length == 1 && currentState == 'Normal' }}" checked="{{isAll}}" bind:change="selectAll" />
    </view>
    <view class="navBtn">
      <t-button class="custom-css" wx:if="{{currentState == 'WaitValid'}}" disabled="{{!isEnbled}}" style="margin-right:10px;" size="extra-small" bindtap="updateStateNormalDatas">批量通过</t-button>
      <t-button wx:if="{{currentState != 'WaitValid'}}" disabled="{{!isEnbled}}" size="extra-small" theme="danger" bindtap="removeStudentDatas">批量移除</t-button>
      <t-button wx:if="{{currentState == 'WaitValid'}}" disabled="{{!isEnbled}}" size="extra-small" theme="danger" bindtap="updateStateRejectDatas">批量拒绝</t-button>
    </view>
  </view>
</view>
<t-popup visible="{{showConfirm}}" usingCustomNavbar bind:visible-change="onVisibleChange" placement="center">
  <view class="block--select">
    <view class="block-select-title">设置用户角色</view>
    <view class="block-select-radio">
      <t-radio-group class="groupRadio" value="{{radioVal}}" borderless t-class="box" bind:change='onChangeVal'>
        <view wx:for="{{roleList}}" wx:key="index">
          <t-radio class="radioItem" style="font-size: 30rpx;" block="{{false}}" label="{{item.name}}" value="{{item.value}}" />
        </view>
      </t-radio-group>
    </view>
    <view class="block-select-confirm">
      <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="updateStateNormal">确认</t-button>
    </view>
  </view>
</t-popup>
 
<!-- 骨架屏 -->
<view wx:if="{{skeletonLoding}}">
  <view class="group" wx:for="{{10}}" wx:key="index">
    <t-skeleton class="group-avatar" rowCol="{{[{ size: '96rpx', type: 'circle' }]}}" loading></t-skeleton>
    <t-skeleton class="group-content" rowCol="{{[{ width: '50%' }, { width: '100%' }]}}" loading></t-skeleton>
  </view>
</view>
 
 
<wxs module="refresh">
  module.exports = {
    onPulling: function (evt, instance) {
      var p = Math.min(evt.detail.dy / 80, 1)
      var view = instance.selectComponent('.refresh-container')
      view.setStyle({
        opacity: p,
        transform: "scale(" + p + ")"
      })
    }
  }
 
</wxs>