111
QYF-GitLab1
2024-12-23 a2b6203372280be42530c6eaee2bffb6cf3c74d3
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
<!--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 />
    <t-button bindtap="newCourse" size="small" style="margin-left: 15rpx;">新建</t-button>
  </view>
  <view class="contentList" wx:if="{{courseList.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="listCourse" wx:for="{{courseList}}" wx:key="index" data-item="{{item}}" data-course-id="{{item.id}}" bindtap="todetail">
        <image wx:if="{{item.icon}}" class="courseIcon" src="{{item.icon}}" mode="aspectFit" />
        <image wx:else class="courseIcon" src="/static/images/default-book-img.png" mode="aspectFit" />
        <view class="courseInfo">
          <view class="title">
            <text>{{item.name}}</text>
            <!-- <t-icon wx:if="{{item.applyState == 'Reject'}}" name="delete" color="red" size='18px' /> -->
          </view>
          <view class="courseId">
            <text>ID: {{item.id}}</text>
            <t-tag class="margin-16" wx:if="{{item.applyState == 'WaitAudit'}}" variant="light" theme="warning">审核中</t-tag>
            <view wx:if="{{item.applyState == 'Reject'}}">
              <t-tag class="margin-16" variant="light" theme="danger">未通过</t-tag>
              <t-tag bindtap="replayCourse" data-item="{{item}}" class="margin-16 replay" theme="danger">重新申请</t-tag>
            </view>
            <t-tag class="margin-16" wx:if="{{item.applyState == 'Normal'}}" variant="light" theme="success">使用中</t-tag>
          </view>
          <view wx:if="{{item.applyState == 'Reject'}}" class="reason">
            <text> 拒绝原因:</text>
            <t-tag style="margin-left: 0;" bind:tap="showDialog" class="margin-16 replay" theme="danger">点击查看</t-tag>
            <t-dialog visible="{{showContentOnly}}" bind:confirm="closeDialog" close-on-overlay-click>
              <view slot="content" class="reasonContent">
                {{item.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 class="desc">描述:{{item.description}}</view>
        </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="{{courseList.length == 0}}">
    <empty />
  </view>
  <t-popup visible="{{visible}}" style="top: 55px;" usingCustomNavbar placement="bottom">
    <view class="block">
      <view class="courseData">
        <view class="c-name">
          <text>课程名称</text>
          <t-input value="{{courseName}}" bindchange="onCourseNameInput" borderless clearable placeholder="请输入文字" />
        </view>
        <view class="c-desc">
          <text>课程描述</text>
          <t-textarea value="{{courseDesc}}" bindchange="onCourseDescInput" bordered maxlength="50" indicator autosize placeholder="请输入文字" />
        </view>
      </view>
      <view class="courseBook">
        <view class="selectBox">
          <text>选择教材</text>
          <t-button style="margin: 0;" bindtap="selectedBook" icon="add" content="选择教材" size="extra-small"></t-button>
        </view>
        <view class="selectedBook">
          <view class="selectTitle">已选教材</view>
          <view class="selectItem" wx:if="{{selectedBook}}">
            <image wx:if="{{item.icon}}" class="selectedIcon" src="{{selectedBook.icon}}" mode="heightFix" />
            <image wx:else class="selectedIcon" src="/static/images/default-book-img.png" mode="heightFix" />
            <view class="selectedItem">
              <text class="name">{{selectedBook.product.name}}</text>
            </view>
          </view>
          <view class="selectItemNot" wx:else>
            <image class="not-icon" src="/static/images/empty.png" mode="heightFix"></image>
            <view class="text">暂无数据</view>
          </view>
        </view>
      </view>
      <view class="courseSubmit">
        <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="submitCourse">确认</t-button>
      </view>
    </view>
    <view class="block" wx:if="{{pageBook.loading}}">
      <view wx:for="{{3}}" 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-toast id="t-toast" />
    <t-popup visible="{{visibleCart}}" style="top: 0;" usingCustomNavbar placement="right">
      <view class="wall">
        <view class="cartTilte">
          <text class="cartText">选择教材</text>
          <t-search value="{{selectName}}" bind:clear="changeHandleBook" bind:submit="changeHandleBook" placeholder="搜索教材名称" clearable />
        </view>
        <view class="cartBox">
          <view class="cartList" wx:if="{{cartList.length > 0}}">
            <scroll-view class="scroll" class="content" scroll-y bindrefresherpulling="{{refresh.onPulling}}">
              <view wx:for="{{cartList}}" bindtap="onChange" data-index="{{index}}" wx:key="index" class="card {{radioVal == index ? 'card--active' : ''}}">
                <t-icon wx:if="{{radioVal == index}}" name="check" t-class="card__icon" />
                <t-radio value="{{index}}" label="{{item.product.name}}" icon="none" borderless>
                  <view class="radioCon" slot='content'>
                    <image wx:if="{{item.icon}}" class="radioIcon" src="{{item.icon}}" mode="aspectFit" />
                    <image wx:else class="radioIcon" src="/static/images/default-book-img.png" mode="aspectFit" />
                  </view>
                </t-radio>
              </view>
            </scroll-view>
          </view>
          <view wx:else>
            <empty />
          </view>
        </view>
        <view class="radioSubmit">
          <t-button style="padding:0 25px;margin: 0;" size="extra-small" bindtap="radioCancle" variant="outline">关闭</t-button>
          <t-button style=" padding:0 25px;margin: 0 16px;" size="extra-small" bindtap="radioSubmit">确认</t-button>
        </view>
      </view>
    </t-popup>
  </t-popup>
</view>
 
<!-- 骨架屏 -->
<import src="./index.skeleton.wxml" />
<template is="skeleton" wx:if="{{skeletonLoding}}"></template>
 
 
<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>