longCourse.wxml
5.22 KB
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
<!--packageStudyCenter/pages/longCourse/longCourse.wxml-->
<view class="detail-box">
<!-- 课程详情 -->
<view class="course-detail-box">
<view class="course-detail-img-box">
<image class="course-detail-img"
src="{{ IMG_URL }}usedCar/course-default-bg.png"
mode="scaleToFill" />
<view class="time-limit-tag"
wx:if="{{ completeStatus == 0 && rowData.punishType == 1 }}"></view>
</view>
<view class="course-detail-content">
<view class="course-title">
{{ rowData.taskTitle || rowData.taskName }}
</view>
<!-- 任务进度 -->
<view class="course-info course-progress">
<view class="info-label">
任务进度
</view>
<view wx:if="{{ completeStatus == 1 }}" class="info-progress-text green">
<view class="dot-value"></view>已完成
</view>
<view class="info-progress" wx:else>
<view class="info-progress-bar" style="width: {{ progressWidth }}"></view>
<view class="info-progress-text">
{{ progressText }}
</view>
</view>
</view>
<!-- 课程信息 -->
<view class="course-info">
<view class="info-label">
课程数
</view>
<view class="info-value">
{{ (rowData.courseTotalCount || rowData.courseTotalCount === 0) ? rowData.courseTotalCount + '节' : '-' }}|
{{ (rowData.totalDuration || rowData.totalDuration === 0) ? rowData.totalDuration + 'min' : '-' }}
</view>
</view>
<!-- 完成时间 -->
<view class="course-info">
<view class="info-label">
完成时间
</view>
<view class="info-value">
{{ completeStatus == 0 ? rowData._taskDeadline : rowData._finishDate }}
</view>
</view>
</view>
<!-- 倒计时 -->
<view class="time-limit-countdown"
wx:if="{{ completeStatus == 0 && rowData.punishType == 1 }}">
<block wx:if="{{ !isTimeout }}">
<view class="countdown-label">
仅剩
</view>
<view class="countdown-num">
{{ countdown.days < 10 ? '0' + countdown.days : countdown.days }}
</view>
<view class="countdown-separator">
天
</view>
<view class="countdown-num">
{{ countdown.hours < 10 ? '0' + countdown.hours : countdown.hours }}
</view>
<view class="countdown-separator">
:
</view>
<view class="countdown-num">
{{ countdown.minutes < 10 ? '0' + countdown.minutes : countdown.minutes }}
</view>
<view class="countdown-separator">
:
</view>
<view class="countdown-num">
{{ countdown.seconds < 10 ? '0' + countdown.seconds : countdown.seconds }}
</view>
</block>
<block wx:else>
<view class="countdown-label" style="color:#B87A11;">
已超时
</view>
</block>
</view>
</view>
<!-- 课程列表 -->
<view class="course-list-box-wrapper">
<view class="course-list-box-title">
课程列表
</view>
<scroll-view class="course-list-box"
scroll-y
style="height: calc(100% - var(--fontSize92));"
enhanced="{{ true }}"
show-scrollbar="{{ false }}">
<view class="course-list-item-wrapper">
<view class="course-list-item"
wx:for="{{ courseList }}"
wx:key="index"
bindtap="startStudy"
data-item="{{ item }}"
data-index="{{ index }}">
<image class="course-img" src="{{ IMG_URL }}usedCar/long-course-default.png" />
<view class="item-content">
<view class="item-title">
{{ item.courseName }}
</view>
<!-- 当前状态 -->
<view class="item-info">
<view class="item-info-label">
当前状态
</view>
<view class="item-info-value {{ item.status === 5 ? 'green' : item.status == 4 ? 'red' : 'orange' }}">
<view class="dot-value {{ item.status === 5 ? 'green' : item.status == 4 ? 'red' : 'orange' }}"></view>
{{ item.status !== 5 ? (statusMap[item.status] + '(' + (item.progress === 0 ? 0 : item.progress || 0) + '%)') : '已完成' }}
</view>
</view>
<!-- 考试成绩 -->
<view class="item-info">
<view class="item-info-label">
考试成绩
</view>
<view class="item-info-value">
<block wx:if="{{ item.status !== 5 && item.totalScore == null }}">
待考核
</block>
<block wx:elif="{{ item.status !== 5 && item.totalScore != null }}">
{{ item.totalScore }}分
</block>
<block wx:elif="{{ item.status === 5 && item.totalScore == null }}">
无需考核
</block>
<block wx:elif="{{ item.status === 5 && item.totalScore != null }}">
{{ item.totalScore }}分
</block>
</view>
</view>
<!-- 课程时长 -->
<view class="item-info">
<view class="item-info-label">
课程时长
</view>
<view class="item-info-value">
{{ (item.learnDuration || item.learnDuration === 0) ? item.learnDuration + 'min' : '-' }}
</view>
</view>
<!-- 完成状态背景或按钮 -->
<block wx:if="{{ item.status === 5 }}">
<image class="completed-bg" src="{{ IMG_URL }}usedCar/completed-bg.png" />
</block>
<block wx:else>
<view class="item-btn">
开始学习
</view>
</block>
</view>
</view>
</view>
</scroll-view>
</view>
</view>