trainingSignIn.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143
  1. <!-- 培训详情-扫码签到跳转至此 -->
  2. <template>
  3. <view class="training-signin-page">
  4. <!-- 顶部导航 -->
  5. <!-- <view class="topbar">
  6. <view class="topbar-back" @click="goBack">
  7. <text class="back-icon">‹</text>
  8. <text>返回</text>
  9. </view>
  10. <view class="topbar-title">培训详情</view>
  11. <view v-if="userType === 1" class="teacher-topbar">
  12. <text class="publish-label" :style="{ color: isPublished ? '#52c41a' : '#8c8c8c' }">{{ isPublished ? '已发布' : '未发布' }}</text>
  13. <view class="publish-toggle" :class="{ active: isPublished }" @click="togglePublish">
  14. <view class="publish-knob"></view>
  15. </view>
  16. </view>
  17. </view> -->
  18. <!-- 滚动内容 -->
  19. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-content">
  20. <!-- 状态标签 -->
  21. <view class="status-bar">
  22. <text class="status-tag" :class="statusClass">{{ statusText }}</text>
  23. <text class="tag tag-blue">{{ detail.trainingModeName || '知识讲座' }}</text>
  24. </view>
  25. <!-- 标题 -->
  26. <view class="title">{{ detail.trainingName }}</view>
  27. <!-- 信息卡片 -->
  28. <view class="info-card">
  29. <view class="info-row">
  30. <text class="info-label">培训时间</text>
  31. <text class="info-value">{{ detail.startDate }} 至 {{ detail.endDate }}</text>
  32. </view>
  33. <view class="info-row">
  34. <text class="info-label">培训地点</text>
  35. <!-- <text class="info-value">📍 {{ detail.locationText || '-' }}</text> -->
  36. <text class="info-value">{{ detail.locationText || '-' }}</text>
  37. </view>
  38. <view class="info-row">
  39. <text class="info-label">组织单位</text>
  40. <!-- <text class="info-value">{{ detail.categoryName || '-' }}</text> -->
  41. <text class="info-value">{{ detail.orgDeptName || '-' }}</text>
  42. </view>
  43. <view class="info-row">
  44. <text class="info-label">主讲人</text>
  45. <text class="info-value">{{ detail.speakerName || '-' }}</text>
  46. </view>
  47. <view class="info-row">
  48. <text class="info-label">培训时长</text>
  49. <!-- <text class="info-value">{{ trainingDurationMinutes ? trainingDurationMinutes + ' 分钟' : '-' }}</text> -->
  50. <text class="info-value">{{ detail.trainingDurationMinutes ? detail.trainingDurationMinutes + ' 分钟' : '-' }}</text>
  51. </view>
  52. <view class="info-row">
  53. <text class="info-label">可得学时</text>
  54. <text class="info-value info-value-blue">+ {{ detail.creditHours || 0 }} 学时</text>
  55. </view>
  56. <view class="info-row last">
  57. <text class="info-label">可得积分</text>
  58. <text class="info-value info-value-orange">+ {{ detail.points || 0 }} 奖励分</text>
  59. </view>
  60. </view>
  61. <!-- 签到二维码(老师端 + 进行中) -->
  62. <view v-if="userType == 1 && trainingStatus === 'active'" class="qr-section">
  63. <text class="qr-title">签到二维码</text>
  64. <view class="qr-box" @click="openQrModal">
  65. <uqrcode
  66. v-show="false"
  67. ref="qrcode"
  68. canvas-id="qrcode"
  69. :value="qrValue"
  70. :size="200"
  71. @complete="onQrcodeComplete">
  72. </uqrcode>
  73. <!-- 用于展示生成的二维码图片 -->
  74. <image v-if="qrImagePath" :src="qrImagePath" mode="widthFix" style="width: 200px; height: 200px;"></image>
  75. <!-- <image class="qr-image" src="/static/qr-placeholder.png" mode="aspectFit"></image> -->
  76. </view>
  77. <text class="qr-hint">学员扫码签到 · 点击可放大</text>
  78. </view>
  79. <!-- 签到人数统计(老师端) -->
  80. <view v-if="userType == 1" class="signin-stats">
  81. <text class="stats-title">签到统计</text>
  82. <view class="stats-grid">
  83. <view class="stats-card stats-card-blue">
  84. <text class="stats-num">{{ detail.totalCount || 0 }}</text>
  85. <text class="stats-label">总人数</text>
  86. </view>
  87. <view class="stats-card stats-card-green">
  88. <text class="stats-num">{{ detail.signedCount || 0 }}</text>
  89. <text class="stats-label">已签到</text>
  90. </view>
  91. <view class="stats-card stats-card-orange">
  92. <text class="stats-num">{{ detail.notSignedCount || 0 }}</text>
  93. <text class="stats-label">未签到</text>
  94. </view>
  95. </view>
  96. <!-- 进度条 -->
  97. <view class="progress-bar">
  98. <view class="progress-fill" :style="{ width: (detail.signRate || 0) + '%' }"></view>
  99. </view>
  100. <text class="progress-text">签到率 {{ detail.signRate || 0 }}%</text>
  101. </view>
  102. <!-- 签到区域(学员端 + 进行中) -->
  103. <view v-if="userType == 2 && !signType" class="signin-section">
  104. <text class="signin-title">现场签到</text>
  105. <view class="signin-btn" @click="openScanModal">
  106. <text class="signin-icon"></text>
  107. <text class="signin-btn-text">点击签到</text>
  108. </view>
  109. <view class="signin-status" :class="{ signed: isSigned }">
  110. {{ isSigned ? '✓ 已签到' : '● 未签到' }}
  111. </view>
  112. </view>
  113. <!-- 培训证明上传区域(学员端 + 进行中) -->
  114. <view v-if="userType == 2 && !upType" class="upload-section">
  115. <view class="upload-header">
  116. <text class="upload-icon">🖼️</text>
  117. <text class="upload-title">上传培训证明</text>
  118. <text class="upload-hint">(如签到截图、现场照片等)</text>
  119. </view>
  120. <!-- 已选图片预览 -->
  121. <view class="upload-preview">
  122. <view v-for="(img, idx) in previewImages" :key="idx" class="preview-item">
  123. <image class="preview-img" :src="img" mode="aspectFill" @click="previewImage(img)"></image>
  124. <view class="preview-del" @click.stop="removeImage(idx)">×</view>
  125. </view>
  126. </view>
  127. <!-- 上传按钮 -->
  128. <view class="upload-actions">
  129. <view v-if="previewImages.length < 5" class="upload-btn" @click="chooseImage">
  130. <text class="upload-btn-icon">+</text>
  131. <text>选择图片</text>
  132. </view>
  133. <view v-if="previewImages.length > 0" class="submit-btn" @click="submitProof">提交证明</view>
  134. </view>
  135. <text class="upload-tip">支持 JPG、PNG 格式,单张不超过 10MB,最多上传 5 张</text>
  136. </view>
  137. <!-- 已完成状态展示 -->
  138. <view v-if="signType">
  139. <!-- 完成状态提示 -->
  140. <view class="done-banner">
  141. <text class="done-icon">✅</text>
  142. <view class="done-info">
  143. <!-- <text class="done-title">培训已完成</text>
  144. <text class="done-desc">已签到并获得 {{ detail.creditHours || 0 }} 学时 · +{{ detail.points || 0 }} 奖励分</text> -->
  145. <text class="done-title">签到已完成</text>
  146. <!-- <text class="done-desc">已签到并获得 {{ detail.creditHours || 0 }} 学时 · +{{ detail.points || 0 }} 奖励分</text> -->
  147. </view>
  148. </view>
  149. </view>
  150. <view v-if="upType">
  151. <!-- 已上传培训证明 -->
  152. <view v-if="previewImages.length > 0" class="done-images-card">
  153. <view class="done-images-header">
  154. <text class="done-images-icon">🖼️</text>
  155. <text class="done-images-title">培训证明图片</text>
  156. </view>
  157. <view class="done-images-grid">
  158. <view v-for="(img, idx) in previewImages" :key="idx" class="done-image-item" @click="previewImage(img)">
  159. <image class="done-image" :src="img" mode="aspectFill"></image>
  160. </view>
  161. </view>
  162. <text class="done-images-tip">共 {{ previewImages.length }} 张</text>
  163. </view>
  164. </view>
  165. <!-- 签到名单(老师端) -->
  166. <view v-if="userType == 1" class="roster-section">
  167. <!-- Tab -->
  168. <view class="roster-tabs">
  169. <view class="roster-tab" :class="{ active: activeRosterTab === 1 }" @click="switchRosterTab(1)">
  170. 已签到 <text class="tab-badge tab-badge-green">{{signedCount}}</text>
  171. </view>
  172. <view class="roster-tab" :class="{ active: activeRosterTab === 0 }" @click="switchRosterTab(0)">
  173. 未签到 <text class="tab-badge tab-badge-orange">{{notSignedCount}}</text>
  174. </view>
  175. </view>
  176. <!-- 已签到名单 -->
  177. <view v-if="activeRosterTab === 1" class="roster-panel">
  178. <view v-for="(item, idx) in signedList" :key="idx" class="roster-item roster-item-green">
  179. <view class="roster-avatar" style="background: linear-gradient(135deg, #1677ff, #4096ff);">{{ item.userName[0] }}</view>
  180. <view class="roster-info">
  181. <text class="roster-name">{{ item.userName }}</text>
  182. <text class="roster-meta">{{ item.account }} · {{ item.deptName }}</text>
  183. </view>
  184. <view class="roster-status">
  185. <text class="status-text-green">✓ 已签到</text>
  186. <text class="status-time">{{ item.signTime }}</text>
  187. </view>
  188. </view>
  189. <text class="roster-more">…… 共{{signedCount}}人已签到 ……</text>
  190. </view>
  191. <!-- 未签到名单 -->
  192. <view v-if="activeRosterTab === 0" class="roster-panel">
  193. <view v-for="(item, idx) in unsignedList" :key="idx" class="roster-item roster-item-orange">
  194. <view class="roster-avatar" style="background: linear-gradient(135deg, #1677ff, #4096ff);">{{ item.userName[0] }}</view>
  195. <view class="roster-info">
  196. <text class="roster-name">{{ item.userName }}</text>
  197. <text class="roster-meta">{{ item.account }} · {{ item.deptName }}</text>
  198. </view>
  199. <view class="roster-status">
  200. <text class="status-text-orange">● 未签到</text>
  201. </view>
  202. </view>
  203. <text class="roster-more">…… 共{{notSignedCount}}人未签到 ……</text>
  204. </view>
  205. </view>
  206. </scroll-view>
  207. </view>
  208. </template>
  209. <script>
  210. import {
  211. examElTrainingTaskProgressDetail,examElTrainingTaskSignInList,
  212. examUserTrainingDetail,examUserTrainingSignIn,examUserTrainingProofUpload,
  213. } from '@/pages_basics/api/index.js'
  214. export default {
  215. data() {
  216. return {
  217. id:'',
  218. userType: 0, // 1老师 2学生(后续自行调试切换)
  219. detail: {},
  220. isPublished: true,
  221. activeRosterTab: 1,
  222. previewImages: [], // 待上传图片预览
  223. currentUserId: null, // TODO: 当前登录用户ID,需从登录态获取
  224. // 已签到名单
  225. signedList: [],
  226. // 未签到名单
  227. unsignedList: [],
  228. signedCount:0,
  229. notSignedCount:0,
  230. page:1,
  231. pageSize:10,
  232. total:0,
  233. getDataType:false,
  234. //二维码
  235. qrValue: 'https://uniapp.dcloud.io/', // 二维码内容
  236. qrImagePath: '' ,// 生成的二维码图片路径
  237. //签到状态
  238. signType:false,
  239. //上传状态
  240. upType:false,
  241. }
  242. },
  243. computed: {
  244. // 培训状态:直接取接口返回的 status(1-未开始 2-进行中 3-已结束)
  245. trainingStatus() {
  246. const status = this.detail.status
  247. if (status === 1) return 'upcoming'
  248. if (status === 3) return 'done'
  249. return 'active'
  250. },
  251. // 状态标签文字
  252. statusText() {
  253. return this.detail.statusName || '● 进行中'
  254. },
  255. // 状态标签样式类
  256. statusClass() {
  257. const map = {
  258. upcoming: 'status-upcoming',
  259. active: 'status-active',
  260. done: 'status-done'
  261. }
  262. return map[this.trainingStatus] || 'status-active'
  263. },
  264. // 格式化培训时间显示
  265. formatTime() {
  266. const { startDate, endDate } = this.detail
  267. if (!startDate || !endDate) return '-'
  268. const datePart = startDate.split(' ')[0]
  269. const startTime = startDate.split(' ')[1].substring(0, 5)
  270. const endTime = endDate.split(' ')[1].substring(0, 5)
  271. return `${datePart} ${startTime} – ${endTime}`
  272. },
  273. // 培训时长(分钟):根据起止时间计算
  274. trainingDurationMinutes() {
  275. const { startDate, endDate } = this.detail
  276. if (!startDate || !endDate) return 0
  277. const start = new Date(startDate.replace(' ', 'T')).getTime()
  278. const end = new Date(endDate.replace(' ', 'T')).getTime()
  279. const diff = end - start
  280. return diff > 0 ? Math.round(diff / (1000 * 60)) : 0
  281. },
  282. // 当前用户在 records 中的记录
  283. myRecord() {
  284. if (!this.detail.records || !this.currentUserId) return null
  285. return this.detail.records.find(r => r.userId === this.currentUserId) || null
  286. },
  287. // 是否已签到(线下 status === 1 表示已签到)
  288. isSigned() {
  289. return this.myRecord && this.myRecord.status === 1
  290. },
  291. },
  292. onLoad(option) {
  293. this.qrValue = uni.getStorageSync('codeOnlineAdd') +'?code='+option.code+'&type=offlineTraining',
  294. this.userType = uni.getStorageSync('userType');
  295. if (option.code) {
  296. this.$set(this,'id',option.code);
  297. this.examElTrainingTaskProgressDetail()
  298. this.examElTrainingTaskSignInList()
  299. if(this.userType == 2){
  300. this.examUserTrainingDetail();
  301. }
  302. }
  303. },
  304. methods: {
  305. onQrcodeComplete(res) {
  306. if (res.success) {
  307. // 生成成功后,调用 toTempFilePath 获取图片临时路径
  308. this.$refs.qrcode.toTempFilePath({
  309. success: (res) => {
  310. // console.log('二维码图片路径:', res.tempFilePath);
  311. this.qrImagePath = res.tempFilePath; // 将路径赋值给 data,用于页面展示
  312. },
  313. fail: (err) => {
  314. console.error('获取图片路径失败:', err);
  315. }
  316. });
  317. }
  318. },
  319. //查询培训详情
  320. async examElTrainingTaskProgressDetail() {
  321. const {
  322. data
  323. } = await examElTrainingTaskProgressDetail({
  324. id: this.id
  325. })
  326. if (data.code == 200) {
  327. this.detail = data.data || {};
  328. }
  329. },
  330. //查询用户培训信息
  331. async examUserTrainingDetail() {
  332. const {
  333. data
  334. } = await examUserTrainingDetail({
  335. id: this.id
  336. })
  337. if (data.code == 200) {
  338. this.$set(this,'signType',data.data.signStatus==1?true:false);
  339. this.$set(this,'upType',data.data.proofImages[0]?true:false);
  340. this.$set(this,'previewImages',data.data.proofImages);
  341. }
  342. },
  343. //滚动加载事件
  344. scrollGet() {
  345. let self = this;
  346. console.log('self.total',self.total);
  347. console.log('self.pageSize',self.pageSize);
  348. console.log('self.page',self.page);
  349. if (self.total / self.pageSize <= self.page) {
  350. this.$set(this, 'getDataType', true);
  351. } else {
  352. this.page += 1;
  353. this.$nextTick(() => {
  354. this.examElTrainingTaskSignInList();
  355. })
  356. }
  357. },
  358. async examElTrainingTaskSignInList() {
  359. let self = this;
  360. const {
  361. data
  362. } = await examElTrainingTaskSignInList({
  363. id: this.id,
  364. signStatus:this.activeRosterTab,
  365. page:this.page,
  366. pageSize:this.pageSize,
  367. })
  368. if (data.code == 200) {
  369. this.$set(this,'signedCount',data.data.signedCount);
  370. this.$set(this,'notSignedCount',data.data.notSignedCount);
  371. if(self.page == 1){
  372. if(this.activeRosterTab == 1){
  373. this.signedList = data.data.records;
  374. }else{
  375. this.unsignedList = data.data.records;
  376. }
  377. this.total = data.data.pageTotal;
  378. if (data.data.total / self.pageSize <= self.page) {
  379. this.$set(this, 'getDataType', true);
  380. }
  381. }else{
  382. if(this.activeRosterTab == 1){
  383. this.signedList = [...this.signedList, ...data.data.records]
  384. }else{
  385. this.unsignedList = [...this.unsignedList, ...data.data.records]
  386. }
  387. this.total = data.data.pageTotal;
  388. if (data.data.total / self.pageSize <= self.page) {
  389. this.$set(this, 'getDataType', true);
  390. }
  391. }
  392. }
  393. },
  394. // 返回上一页
  395. goBack() {
  396. uni.navigateBack()
  397. },
  398. // 发布开关切换(老师端)
  399. togglePublish() {
  400. this.isPublished = !this.isPublished
  401. uni.showToast({
  402. title: this.isPublished ? '培训已发布,学员可见' : '培训已取消发布',
  403. icon: 'none'
  404. })
  405. },
  406. // 打开扫码
  407. openScanModal() {
  408. this.examUserTrainingSignIn()
  409. },
  410. async examUserTrainingSignIn() {
  411. const {
  412. data
  413. } = await examUserTrainingSignIn({
  414. taskId: this.id
  415. })
  416. if (data.code == 200) {
  417. uni.showToast({ title: data.message, icon: 'none' })
  418. this.examUserTrainingDetail();
  419. }
  420. },
  421. // 扫码完成:更新本地 records 中当前用户状态
  422. completeScan() {
  423. if (this.myRecord) {
  424. this.$set(this.myRecord, 'status', 1)
  425. this.$set(this.myRecord, 'statusName', '已签到')
  426. }
  427. uni.showToast({ title: '签到成功!', icon: 'success' })
  428. },
  429. // 打开二维码放大
  430. openQrModal() {
  431. if (!this.qrImagePath) return;
  432. uni.previewImage({
  433. current: this.qrImagePath, // 当前显示图片的链接
  434. urls: [this.qrImagePath], // 需要预览的图片链接列表(这里只有一张,所以包在数组里)
  435. fail: (err) => {
  436. console.error('预览失败', err);
  437. }
  438. });
  439. },
  440. // 选择图片
  441. chooseImage() {
  442. const remaining = 5 - this.previewImages.length
  443. if (remaining <= 0) {
  444. uni.showToast({ title: '最多上传 5 张图片', icon: 'none' })
  445. return
  446. }
  447. uni.chooseImage({
  448. count: remaining,
  449. sizeType: ['compressed'],
  450. sourceType: ['album', 'camera'],
  451. success: (res) => {
  452. const tempFiles = res.tempFiles || []
  453. const oversized = tempFiles.filter(f => f.size > 10 * 1024 * 1024)
  454. if (oversized.length) {
  455. uni.showToast({ title: '图片大小不能超过 10MB', icon: 'none' })
  456. return
  457. }
  458. this.previewImages = [...this.previewImages, ...res.tempFilePaths]
  459. }
  460. })
  461. },
  462. // 移除预览图
  463. removeImage(idx) {
  464. this.previewImages.splice(idx, 1)
  465. },
  466. // 提交证明
  467. submitProof() {
  468. if (!this.previewImages.length) {
  469. uni.showToast({ title: '请先选择图片', icon: 'none' })
  470. return
  471. }
  472. this.examUserTrainingProofUpload();
  473. },
  474. //上传培训照片
  475. async examUserTrainingProofUpload() {
  476. const {
  477. data
  478. } = await examUserTrainingProofUpload({
  479. taskId: this.id,
  480. proofImagePath:this.previewImages+'',
  481. })
  482. if (data.code == 200) {
  483. uni.showToast({ title: data.message, icon: 'none' })
  484. this.examUserTrainingDetail();
  485. }
  486. },
  487. // 预览图片
  488. previewImage(url) {
  489. const urls = this.previewImages.length > 0 ? this.previewImages : this.myProofImages
  490. uni.previewImage({
  491. current: url,
  492. urls: urls.length > 0 ? urls : [url]
  493. })
  494. },
  495. // 名单Tab切换
  496. switchRosterTab(idx) {
  497. this.activeRosterTab = idx
  498. this.examElTrainingTaskSignInList();
  499. }
  500. }
  501. }
  502. </script>
  503. <style lang="stylus" scoped>
  504. // ========== 基础变量 ==========
  505. $blue = #1857d4
  506. $blue-light = #eef3fd
  507. $green = #10a37f
  508. $green-dark = #0d8f6f
  509. $green-light = #edfaf6
  510. $orange = #e67e22
  511. $orange-light = #fef6ec
  512. $red = #e53e3e
  513. $gray = #8896a7
  514. $gray-light = #f4f6fa
  515. $gray-border = #dde3ed
  516. $text-primary = #1a2233
  517. $text-hint = #8896a7
  518. $bg = #f0f4fb
  519. $white = #ffffff
  520. // ========== 页面布局 ==========
  521. .training-signin-page
  522. display flex
  523. flex-direction column
  524. height 100vh
  525. background $bg
  526. // ========== 顶部导航 ==========
  527. .topbar
  528. background $white
  529. padding 13px 16px
  530. display flex
  531. align-items center
  532. justify-content space-between
  533. border-bottom 1px solid $gray-border
  534. flex-shrink 0
  535. box-shadow 0 1px 6px rgba(24, 87, 212, .07)
  536. .topbar-back
  537. display flex
  538. align-items center
  539. gap 4px
  540. color $blue
  541. font-size 13px
  542. padding 5px 10px
  543. border 1px solid rgba(24, 87, 212, .25)
  544. border-radius 8px
  545. background #f5f8ff
  546. font-weight 500
  547. .back-icon
  548. font-size 18px
  549. line-height 1
  550. .topbar-title
  551. font-size 16px
  552. font-weight 700
  553. color $text-primary
  554. letter-spacing .3px
  555. // 老师端发布开关
  556. .teacher-topbar
  557. display flex
  558. align-items center
  559. gap 6px
  560. .publish-label
  561. font-size 11px
  562. font-weight 500
  563. white-space nowrap
  564. .publish-toggle
  565. width 40px
  566. height 22px
  567. border-radius 11px
  568. background #d9d9d9
  569. position relative
  570. transition background .2s
  571. &.active
  572. background #52c41a
  573. .publish-knob
  574. left auto
  575. right 4px
  576. .publish-knob
  577. position absolute
  578. top 4px
  579. left 4px
  580. width 14px
  581. height 14px
  582. border-radius 50%
  583. background #fff
  584. transition left .2s, right .2s
  585. // ========== 滚动内容区 ==========
  586. .scroll-content
  587. flex 1
  588. overflow-y scroll;
  589. padding 12px
  590. box-sizing border-box
  591. // ========== 状态标签 ==========
  592. .status-bar
  593. display flex
  594. align-items center
  595. gap 8px
  596. margin-bottom 12px
  597. .status-tag
  598. font-size 11px
  599. border-radius 10px
  600. padding 3px 10px
  601. font-weight 500
  602. .status-active
  603. background #fff7e6
  604. color #fa8c16
  605. border 1px solid #ffd591
  606. .status-done
  607. background #f6ffed
  608. color #52c41a
  609. border 1px solid #b7eb8f
  610. .status-upcoming
  611. background #f5f5f5
  612. color #8c8c8c
  613. border 1px solid #d9d9d9
  614. .tag
  615. display inline-flex
  616. align-items center
  617. padding 2px 8px
  618. border-radius 20px
  619. font-size 11px
  620. font-weight 500
  621. .tag-blue
  622. background $blue-light
  623. color $blue
  624. // ========== 标题 ==========
  625. .title
  626. font-size 17px
  627. font-weight 700
  628. color #1a1a1a
  629. margin-bottom 16px
  630. // ========== 信息卡片 ==========
  631. .info-card
  632. border 1px solid #f0f0f0
  633. border-radius 10px
  634. overflow hidden
  635. margin-bottom 14px
  636. background $white
  637. .info-row
  638. display flex
  639. border-bottom 1px solid #f5f5f5
  640. &.last
  641. border-bottom none
  642. .info-label
  643. padding 10px 14px
  644. color #888
  645. background #fafafa
  646. width 30%
  647. font-size 13px
  648. white-space nowrap
  649. flex-shrink 0
  650. .info-value
  651. padding 10px 14px
  652. color #333
  653. font-size 13px
  654. font-weight 500
  655. flex 1
  656. .info-value-blue
  657. color #1677ff
  658. font-weight 600
  659. .info-value-orange
  660. color #fa8c16
  661. font-weight 600
  662. // ========== 二维码区域 ==========
  663. .qr-section
  664. border 1.5px solid #ffadd2
  665. border-radius 12px
  666. padding 16px 14px
  667. background linear-gradient(135deg, #fff0f6, #fff7e6)
  668. margin-bottom 14px
  669. text-align center
  670. .qr-title
  671. font-size 13px
  672. font-weight 600
  673. color #c41d7f
  674. margin-bottom 12px
  675. display block
  676. .qr-box
  677. display inline-block
  678. background #fff
  679. border-radius 12px
  680. padding 10px
  681. border 1.5px solid #ffadd2
  682. .qr-image
  683. width 120px
  684. height 120px
  685. display block
  686. .qr-hint
  687. font-size 12px
  688. color #ad6494
  689. margin-top 8px
  690. display block
  691. // ========== 签到统计 ==========
  692. .signin-stats
  693. margin-bottom 14px
  694. .stats-title
  695. font-size 13px
  696. font-weight 600
  697. color #1a1a1a
  698. margin-bottom 8px
  699. display block
  700. .stats-grid
  701. display flex
  702. gap 10px
  703. .stats-card
  704. flex 1
  705. border-radius 12px
  706. padding 14px 10px
  707. text-align center
  708. .stats-card-blue
  709. background linear-gradient(135deg, #e6f4ff, #bae0ff)
  710. border 1px solid #91caff
  711. .stats-num
  712. color #0958d9
  713. .stats-label
  714. color #4096ff
  715. .stats-card-green
  716. background linear-gradient(135deg, #f6ffed, #d9f7be)
  717. border 1px solid #b7eb8f
  718. .stats-num
  719. color #389e0d
  720. .stats-label
  721. color #52c41a
  722. .stats-card-orange
  723. background linear-gradient(135deg, #fff7e6, #ffe7ba)
  724. border 1px solid #ffd591
  725. .stats-num
  726. color #d46b08
  727. .stats-label
  728. color #fa8c16
  729. .stats-num
  730. font-size 28px
  731. font-weight 800
  732. line-height 1.1
  733. display block
  734. .stats-label
  735. font-size 11px
  736. margin-top 4px
  737. font-weight 500
  738. display block
  739. // 进度条
  740. .progress-bar
  741. margin-top 10px
  742. background #f0f0f0
  743. border-radius 20px
  744. height 8px
  745. overflow hidden
  746. .progress-fill
  747. height 100%
  748. background linear-gradient(90deg, #52c41a, #73d13d)
  749. border-radius 20px
  750. transition width .4s
  751. .progress-text
  752. font-size 11px
  753. color #888
  754. margin-top 4px
  755. text-align right
  756. display block
  757. // ========== 签到区域 ==========
  758. .signin-section
  759. border 1px solid #ffadd2
  760. border-radius 10px
  761. padding 14px
  762. background linear-gradient(135deg, #fff0f6, #fff7e6)
  763. text-align center
  764. margin-bottom 14px
  765. .signin-title
  766. font-size 13px
  767. font-weight 600
  768. color #c41d7f
  769. margin-bottom 10px
  770. display block
  771. .signin-btn
  772. width 72px
  773. height 72px
  774. border-radius 12px
  775. border 1.5px solid #eb2f96
  776. background #fff
  777. color #c41d7f
  778. display inline-flex
  779. flex-direction column
  780. align-items center
  781. justify-content center
  782. gap 4px
  783. margin-bottom 6px
  784. .signin-icon
  785. font-size 28px
  786. line-height 1
  787. .signin-btn-text
  788. font-size 10px
  789. font-weight 500
  790. .signin-status
  791. font-size 11px
  792. font-weight 500
  793. color #fa8c16
  794. &.signed
  795. color #52c41a
  796. // ========== 上传区域 ==========
  797. .upload-section
  798. border 1px solid #91caff
  799. border-radius 10px
  800. padding 14px
  801. background linear-gradient(135deg, #e6f4ff, #f0f9ff)
  802. margin-bottom 14px
  803. .upload-header
  804. display flex
  805. align-items center
  806. gap 6px
  807. margin-bottom 10px
  808. .upload-icon
  809. font-size 15px
  810. .upload-title
  811. font-size 13px
  812. font-weight 600
  813. color #1677ff
  814. .upload-hint
  815. font-size 11px
  816. color #999
  817. margin-left 2px
  818. .upload-preview
  819. display flex
  820. flex-wrap wrap
  821. gap 8px
  822. margin-bottom 10px
  823. .preview-item
  824. position relative
  825. width 80px
  826. height 80px
  827. border-radius 8px
  828. overflow hidden
  829. border 1px solid #91caff
  830. flex-shrink 0
  831. .preview-img
  832. width 100%
  833. height 100%
  834. display block
  835. .preview-del
  836. position absolute
  837. top 2px
  838. right 2px
  839. width 20px
  840. height 20px
  841. border-radius 50%
  842. background rgba(0, 0, 0, .5)
  843. color #fff
  844. font-size 14px
  845. line-height 20px
  846. text-align center
  847. .upload-actions
  848. display flex
  849. align-items center
  850. gap 10px
  851. .upload-btn
  852. display inline-flex
  853. align-items center
  854. gap 6px
  855. padding 8px 16px
  856. border-radius 8px
  857. border 1.5px dashed #4096ff
  858. background #fff
  859. color #1677ff
  860. font-size 13px
  861. font-weight 500
  862. .upload-btn-icon
  863. font-size 16px
  864. .submit-btn
  865. padding 8px 20px
  866. border-radius 8px
  867. background #1677ff
  868. color #fff
  869. font-size 13px
  870. font-weight 500
  871. .upload-tip
  872. font-size 11px
  873. color #aaa
  874. margin-top 8px
  875. display block
  876. // ========== 已完成区域 ==========
  877. .done-banner
  878. border 1px solid #b7eb8f
  879. border-radius 10px
  880. padding 12px 14px
  881. background #f6ffed
  882. display flex
  883. align-items center
  884. gap 10px
  885. margin-bottom 14px
  886. .done-icon
  887. font-size 22px
  888. .done-info
  889. flex 1
  890. .done-title
  891. font-size 13px
  892. font-weight 600
  893. color #389e0d
  894. display block
  895. .done-desc
  896. font-size 12px
  897. color #73d13d
  898. margin-top 2px
  899. display block
  900. .done-images-card
  901. border 1px solid #f0f0f0
  902. border-radius 10px
  903. padding 14px
  904. background $white
  905. .done-images-header
  906. display flex
  907. align-items center
  908. gap 6px
  909. margin-bottom 12px
  910. .done-images-icon
  911. font-size 15px
  912. .done-images-title
  913. font-size 13px
  914. font-weight 600
  915. color #1a1a1a
  916. .done-images-grid
  917. display flex
  918. flex-wrap wrap
  919. gap 8px
  920. .done-image-item
  921. position relative
  922. width 80px
  923. height 80px
  924. border-radius 8px
  925. overflow hidden
  926. border 1px solid #f0f0f0
  927. .done-image
  928. width 100%
  929. height 100%
  930. display block
  931. .done-images-tip
  932. font-size 11px
  933. color #bbb
  934. margin-top 10px
  935. display block
  936. // ========== 签到名单 ==========
  937. .roster-section
  938. margin-top 14px
  939. .roster-tabs
  940. display flex
  941. border-bottom 2px solid $gray-border
  942. margin-bottom 12px
  943. .roster-tab
  944. flex 1
  945. text-align center
  946. padding 9px 4px 8px
  947. font-size 13px
  948. color #888
  949. border-bottom 2px solid transparent
  950. margin-bottom -2px
  951. &.active
  952. color #1677ff
  953. font-weight 600
  954. border-bottom-color #1677ff
  955. .tab-badge
  956. border-radius 10px
  957. padding 1px 7px
  958. font-size 11px
  959. font-weight 600
  960. color #fff
  961. .tab-badge-green
  962. background #52c41a
  963. .tab-badge-orange
  964. background #fa8c16
  965. .roster-panel
  966. display flex
  967. flex-direction column
  968. gap 8px
  969. .roster-item
  970. display flex
  971. align-items center
  972. gap 10px
  973. border-radius 10px
  974. padding 10px 12px
  975. .roster-item-green
  976. background #f6ffed
  977. border 1px solid #d9f7be
  978. .roster-item-orange
  979. background #fff7e6
  980. border 1px solid #ffe7ba
  981. .roster-avatar
  982. width 36px
  983. height 36px
  984. border-radius 50%
  985. display flex
  986. align-items center
  987. justify-content center
  988. color #fff
  989. font-size 15px
  990. font-weight 700
  991. flex-shrink 0
  992. .roster-info
  993. flex 1
  994. .roster-name
  995. font-size 13px
  996. font-weight 600
  997. display block
  998. .roster-meta
  999. font-size 11px
  1000. color #888
  1001. margin-top 2px
  1002. display block
  1003. .roster-status
  1004. text-align right
  1005. .status-text-green
  1006. font-size 11px
  1007. color #52c41a
  1008. font-weight 500
  1009. display block
  1010. .status-text-orange
  1011. font-size 11px
  1012. color #fa8c16
  1013. font-weight 500
  1014. display block
  1015. .status-time
  1016. font-size 10px
  1017. color #aaa
  1018. margin-top 2px
  1019. display block
  1020. .roster-more
  1021. text-align center
  1022. padding 8px 0
  1023. color $text-hint
  1024. font-size 12px
  1025. display block
  1026. </style>