index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <template>
  2. <view class="home-page">
  3. <!-- Banner:深底反白品牌组合 -->
  4. <view class="banner">
  5. <image class="banner-logo" src="/static/logo-banner.png" mode="widthFix"></image>
  6. <text class="banner-slogan">健康人才选拔 · 培训 · 管理平台</text>
  7. <button v-if="!isLoggedIn" class="login-entry-btn" @click="showLoginSheet">点击登录</button>
  8. <view v-else class="banner-welcome">
  9. <text class="banner-welcome-text">Hi,{{ nickname }},欢迎回来</text>
  10. <text class="banner-welcome-sub">每一次学习,都离健康服务更近一步</text>
  11. </view>
  12. </view>
  13. <!-- 我的档案 -->
  14. <view class="status-card">
  15. <view class="status-row" @click="goTo('/pages/verify/index')">
  16. <text class="status-label">校友校验</text>
  17. <view class="status-value-wrap">
  18. <text :class="['status-value', verifyClass]">{{ verifyLabel }}</text>
  19. <text class="status-arrow">›</text>
  20. </view>
  21. </view>
  22. <view class="status-row">
  23. <text class="status-label">我的班级</text>
  24. <text class="status-value">{{ classLabel }}</text>
  25. </view>
  26. </view>
  27. <!-- 健康服务工作台入口(仅服务人员角色可见) -->
  28. <view v-if="isHousekeeper" class="work-entry" @click="goWork">
  29. <view class="work-entry-main">
  30. <text class="work-entry-title">健康服务工作台</text>
  31. <text class="work-entry-sub">今日工单 · 接单打卡 · 收入台账</text>
  32. </view>
  33. <text class="work-entry-arrow">›</text>
  34. </view>
  35. <!-- 个人成长 -->
  36. <view class="growth-card" v-if="isLoggedIn" @click="goGrowth">
  37. <view class="growth-head">
  38. <view class="growth-grade-dot" :style="{ background: gradeColor }"></view>
  39. <text class="growth-grade-name" :style="{ color: gradeColor }">{{ gradeText }}</text>
  40. <text class="growth-earned">{{ earnedCount }}/32 徽章</text>
  41. <text class="growth-more">›</text>
  42. </view>
  43. <view class="growth-body">
  44. <view class="growth-cell">
  45. <text class="growth-cell-num" :style="{ color: gradeColor }">{{ progressText }}</text>
  46. <text class="growth-cell-label">完课验收</text>
  47. </view>
  48. <view class="growth-cell">
  49. <text class="growth-cell-num" :style="{ color: gradeColor }">{{ certLabel }}</text>
  50. <text class="growth-cell-label">完课证书</text>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="growth-card growth-card-guide" v-else @click="showLoginSheet">
  55. <text class="growth-guide-text">登录后查看我的成长档案</text>
  56. </view>
  57. <!-- 加载骨架 / 错误态(登录后数据区块) -->
  58. <LoadingSkeleton v-if="isLoggedIn && homeLoading" :rows="3" />
  59. <ErrorState v-else-if="isLoggedIn && homeError" message="首页数据加载失败" @retry="loadInfo" />
  60. <!-- 平台动态 -->
  61. <view class="section-title">平台动态</view>
  62. <view class="dynamic-list" v-if="!homeLoading && !homeError && dynamics.length">
  63. <view class="dynamic-item" v-for="(d, idx) in dynamics" :key="idx" @click="goDynamic(d)">
  64. <text class="dynamic-tag" :class="d.tagClass">{{ d.tag }}</text>
  65. <view class="dynamic-main">
  66. <text class="dynamic-title">{{ d.title }}</text>
  67. <text class="dynamic-desc">{{ d.desc }}</text>
  68. </view>
  69. <text class="dynamic-arrow">›</text>
  70. </view>
  71. </view>
  72. <view class="dynamic-empty" v-else-if="isLoggedIn">
  73. <text class="dynamic-empty-text">暂无动态,稍后再来看看</text>
  74. </view>
  75. <!-- AI 小知识 -->
  76. <view class="section-title">AI 小知识</view>
  77. <swiper class="tip-swiper" :autoplay="true" :interval="4000" :circular="true" :indicator-dots="true"
  78. indicator-active-color="#2E6FA8" indicator-color="#DCE7F1">
  79. <swiper-item v-for="(tip, idx) in aiTips" :key="idx">
  80. <view class="tip-card">
  81. <text class="tip-icon">{{ tip.icon }}</text>
  82. <text class="tip-text">{{ tip.text }}</text>
  83. </view>
  84. </swiper-item>
  85. </swiper>
  86. <!-- 沙龙 -->
  87. <view class="section-title">沙龙</view>
  88. <view class="course-mini-list" v-if="!homeLoading && !homeError">
  89. <view class="course-mini-card" v-for="(s, idx) in salonNews" :key="idx" @click="goSalon(s)">
  90. <view class="course-mini-head">
  91. <text class="course-mini-level">{{ mapTheme(s.theme) }}</text>
  92. <text class="course-mini-name">{{ s.title }}</text>
  93. <text class="course-mini-status" :class="s.num <= 0 ? 'st-finished' : 'st-upcoming'">{{ s.num <= 0 ? '已满' : '可报名' }}</text>
  94. </view>
  95. <text class="course-mini-desc">{{ formatDateTime(s.time) }} · {{ s.place }}</text>
  96. <text class="course-mini-desc">余 {{ s.num }}/{{ s.capacity }} 位</text>
  97. </view>
  98. <view class="course-mini-empty" v-if="!salonNews.length && isLoggedIn">
  99. <text class="course-mini-empty-text">暂无沙龙活动</text>
  100. </view>
  101. </view>
  102. <!-- 最近课程 -->
  103. <view class="section-title">最近课程</view>
  104. <view class="course-mini-list" v-if="!homeLoading && !homeError">
  105. <view class="course-mini-card" v-for="(c, idx) in recentCourses" :key="idx" @click="goToCourse(c)">
  106. <view class="course-mini-head">
  107. <text class="course-mini-level">{{ c.level || 'L' }}</text>
  108. <text class="course-mini-name">{{ c.name }}</text>
  109. <text class="course-mini-status" :class="'st-' + c.effectiveStatus">{{ statusLabel(c.effectiveStatus) }}</text>
  110. </view>
  111. <text class="course-mini-desc" v-if="c.description">{{ c.description }}</text>
  112. </view>
  113. <view class="course-mini-empty" v-if="!recentCourses.length && isLoggedIn">
  114. <text class="course-mini-empty-text">暂无课程</text>
  115. </view>
  116. </view>
  117. <!-- 登录引导卡(未登录时平台动态区下方提示) -->
  118. <view class="login-hint" v-if="!isLoggedIn" @click="showLoginSheet">
  119. <text class="login-hint-icon">✨</text>
  120. <text class="login-hint-text">登录解锁班级、成长与沙龙报名</text>
  121. <text class="login-hint-arrow">›</text>
  122. </view>
  123. <!-- Login Bottom Sheet -->
  124. <view class="login-sheet-mask" :class="{ 'sheet-open': loginSheetVisible }" @click="hideLoginSheet">
  125. <view class="login-sheet-panel" @click.stop>
  126. <view class="sheet-handle"></view>
  127. <view class="sheet-content">
  128. <view class="sheet-header">
  129. <text class="sheet-title">欢迎回来</text>
  130. <text class="sheet-sub">登录以解锁更多成长功能</text>
  131. </view>
  132. <!-- #ifdef MP-WEIXIN -->
  133. <button class="sheet-login-btn" open-type="getPhoneNumber" @getphonenumber="handleLoginPhone" :loading="loginLoading" :disabled="!agreed || loginLoading">
  134. 微信一键登录
  135. </button>
  136. <!-- #endif -->
  137. <!-- #ifndef MP-WEIXIN -->
  138. <button class="sheet-login-btn" @click="handleLogin" :loading="loginLoading" :disabled="!agreed || loginLoading">
  139. 微信一键登录
  140. </button>
  141. <!-- #endif -->
  142. <view class="sheet-footer">
  143. <checkbox-group class="agreement-check" @change="onAgreementChange">
  144. <label class="agreement-row">
  145. <checkbox value="agree" :checked="agreed" color="#FC7A57" />
  146. <text class="sheet-footer-text">我已阅读并同意</text>
  147. </label>
  148. </checkbox-group>
  149. <view class="agreement-links">
  150. <text class="agreement-link" @click="showAgreement">《用户协议》</text>
  151. <text class="sheet-footer-text">和</text>
  152. <text class="agreement-link" @click="showPrivacy">《隐私政策》</text>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. </template>
  160. <script>
  161. import { wechatLogin, wechatPhoneLogin, getCourseList, getMyEnrollments, getMyBadges, getCourseProgress, getMyCert, getSalonList } from '@/utils/api.js'
  162. import { formatDateTime } from '@/utils/format.js'
  163. import { loadInviteCode, getInviteCode, buildSharePath } from '@/utils/share.js'
  164. import { captureInviteCode } from '@/utils/invite.js'
  165. import LoadingSkeleton from '@/components/loading-skeleton.vue'
  166. import ErrorState from '@/components/error-state.vue'
  167. export default {
  168. components: { LoadingSkeleton, ErrorState },
  169. data() {
  170. return {
  171. myClasses: [],
  172. grade: null,
  173. earnedCount: 0,
  174. progress: null,
  175. cert: null,
  176. salonNews: [],
  177. dynamics: [],
  178. recentCourses: [],
  179. homeLoading: false,
  180. homePending: 0,
  181. homeError: false,
  182. aiTips: [
  183. { icon: '💡', text: '提示词三要素:角色 + 任务 + 要求,描述越具体,AI 越懂你。' },
  184. { icon: '🤖', text: '把 AI 当成一起上课的学伴,先问「怎么做」,再问「为什么」。' },
  185. { icon: '🚀', text: 'L0 完成 6 项验收即可领取完课证书,开启你的 AI 成长档案。' },
  186. { icon: '🎯', text: '五级成长主线:见习 → 启航 → 专精 → 系统师 → 讲师。' }
  187. ],
  188. gradeColorMap: {
  189. novice: '#6B7B8C',
  190. starter: '#2E6FA8',
  191. expert: '#B9770E',
  192. system: '#0F766E',
  193. lecturer: '#2E6FA8'
  194. },
  195. themeMap: {
  196. ai_basic: 'AI 认知基础',
  197. wealth: '家庭财富管理',
  198. health: '健康管理',
  199. growth: '孩子成长陪伴'
  200. },
  201. loginSheetVisible: false,
  202. loginLoading: false,
  203. agreed: false
  204. }
  205. },
  206. computed: {
  207. isLoggedIn() {
  208. return this.$store.getters.isLoggedIn
  209. },
  210. nickname() {
  211. return this.$store.state.nickname || this.$store.state.name || ''
  212. },
  213. verifyLabel() {
  214. var v = this.$store.state.alumniVerify
  215. if (v === 'accepted') return '✅ 已通过'
  216. if (v === 'pending') return '⏳ 待审核'
  217. return '❌ 未校验'
  218. },
  219. verifyClass() {
  220. var v = this.$store.state.alumniVerify
  221. return v === 'accepted' ? 'val-pass' : (v === 'pending' ? 'val-pending' : 'val-fail')
  222. },
  223. classLabel() {
  224. var cs = this.myClasses || []
  225. if (!cs.length) return '未进班'
  226. if (cs.length === 1) return cs[0]
  227. return cs.slice(0, 2).join('、') + ' 等' + cs.length + '个班级'
  228. },
  229. isHousekeeper() {
  230. var r = this.$store.state.role || ''
  231. return r === 'housekeeper' || r === 'worker'
  232. },
  233. gradeColor() {
  234. if (!this.grade || !this.grade.key) return '#2E6FA8'
  235. return this.gradeColorMap[this.grade.key] || '#2E6FA8'
  236. },
  237. gradeText() {
  238. if (!this.grade || !this.grade.name) return '未入门'
  239. return this.grade.name
  240. },
  241. progressText() {
  242. if (!this.progress) return '-'
  243. return this.progress.done + '/' + this.progress.total
  244. },
  245. certLabel() {
  246. if (this.cert && this.cert.eligible) return '已领证'
  247. return '学习中'
  248. }
  249. },
  250. onShow() {
  251. loadInviteCode()
  252. this.loadInfo()
  253. },
  254. onLoad(options) {
  255. // 邀请链入站捕获:分享链接携带的 inviteCode 落 storage,报名时回填
  256. captureInviteCode(options)
  257. // 注册全局登录浮层触发事件(uni-app 页面生命周期 onLoad 早于 created 时机更稳)
  258. var self = this
  259. try {
  260. uni.$on('showLoginSheet', function() {
  261. self.showLoginSheet()
  262. })
  263. } catch (e) {
  264. console.error('[home] 注册 showLoginSheet 监听失败', e)
  265. }
  266. },
  267. onUnload() {
  268. try {
  269. uni.$off('showLoginSheet')
  270. } catch (e) {}
  271. },
  272. // 分享给好友
  273. onShareAppMessage() {
  274. return {
  275. title: '爱伴-健康之旅|健康人才选拔·培训·管理',
  276. path: buildSharePath('/pages/index/index')
  277. }
  278. },
  279. // 分享到朋友圈
  280. onShareTimeline() {
  281. var code = getInviteCode()
  282. return {
  283. title: '爱伴-健康之旅|健康人才选拔·培训·管理',
  284. query: code ? 'inviteCode=' + code : ''
  285. }
  286. },
  287. methods: {
  288. loadInfo() {
  289. if (!this.isLoggedIn) return
  290. var self = this
  291. this.homeLoading = true
  292. this.homeError = false
  293. this.homePending = 2
  294. this.loadClasses()
  295. this.loadGrowth()
  296. this.loadCourses()
  297. this.loadSalons()
  298. },
  299. homeTick() {
  300. this.homePending = this.homePending - 1
  301. if (this.homePending <= 0) this.homeLoading = false
  302. },
  303. loadClasses() {
  304. var self = this
  305. getMyEnrollments().then(function(resp) {
  306. var list = resp.data || []
  307. var classes = []
  308. for (var i = 0; i < list.length; i++) {
  309. var e = list[i]
  310. if (e.classId && e.className) {
  311. classes.push(e.className)
  312. }
  313. }
  314. // 去重(一个人可能在多个班级,同名只算一次)
  315. classes = classes.filter(function(v, i, arr) {
  316. return arr.indexOf(v) === i
  317. })
  318. self.myClasses = classes
  319. }).catch(function() {})
  320. },
  321. loadGrowth() {
  322. var self = this
  323. getMyBadges().then(function(resp) {
  324. var d = resp.data || {}
  325. self.grade = d.grade || null
  326. self.earnedCount = d.earnedCount || 0
  327. }).catch(function() {})
  328. getCourseProgress().then(function(resp) {
  329. var d = resp.data || {}
  330. if (d.done !== undefined && d.total !== undefined) {
  331. self.progress = d
  332. }
  333. }).catch(function() {})
  334. getMyCert().then(function(resp) {
  335. self.cert = resp.data || null
  336. }).catch(function() {})
  337. },
  338. loadCourses() {
  339. var self = this
  340. // 最近课程:优先取进行中/未开始,最多 3 门
  341. getCourseList().then(function(resp) {
  342. var list = resp.data || []
  343. var sorted = list.slice().sort(function(a, b) {
  344. return self.rankOf(a) - self.rankOf(b)
  345. })
  346. self.recentCourses = sorted.slice(0, 3)
  347. self.buildDynamics()
  348. }).catch(function() {
  349. self.homeError = true
  350. }).finally(function() {
  351. self.homeTick()
  352. })
  353. },
  354. loadSalons() {
  355. var self = this
  356. getSalonList().then(function(resp) {
  357. self.salonNews = resp.data || []
  358. self.buildDynamics()
  359. }).catch(function() {
  360. self.homeError = true
  361. }).finally(function() {
  362. self.homeTick()
  363. })
  364. },
  365. buildDynamics() {
  366. // 平台动态 = 进行中/未开始课程(最多 3 条);沙龙已独立成区块,避免重复
  367. var self = this
  368. var arr = []
  369. var courses = this.recentCourses || []
  370. for (var j = 0; j < courses.length && arr.length < 3; j++) {
  371. var c = courses[j]
  372. if (c.effectiveStatus !== 'active' && c.effectiveStatus !== 'upcoming') continue
  373. arr.push({
  374. type: 'course',
  375. tag: (c.level || 'L') + ' 课程',
  376. tagClass: 'dynamic-tag-course',
  377. title: c.name,
  378. desc: self.statusLabel(c.effectiveStatus) + (c.description ? ' · ' + c.description : ''),
  379. url: '/pages/course/detail?courseId=' + c.id
  380. })
  381. }
  382. this.dynamics = arr
  383. },
  384. mapTheme(theme) {
  385. return this.themeMap[theme] || theme || '通用主题'
  386. },
  387. rankOf(c) {
  388. var st = c && c.effectiveStatus
  389. if (st === 'active') return 0
  390. if (st === 'upcoming') return 1
  391. if (st === 'finished') return 2
  392. return 3
  393. },
  394. statusLabel(st) {
  395. var map = { upcoming: '未开始', active: '进行中', finished: '已结束', draft: '未发布' }
  396. return map[st] || st || '-'
  397. },
  398. goToCourse(c) {
  399. if (!c || !c.id) return
  400. uni.navigateTo({ url: '/pages/course/detail?courseId=' + c.id })
  401. },
  402. goSalon() {
  403. uni.navigateTo({ url: '/pages/salon/list' })
  404. },
  405. goDynamic(d) {
  406. if (!d || !d.url) return
  407. uni.navigateTo({ url: d.url })
  408. },
  409. goGrowth() {
  410. uni.navigateTo({ url: '/pages/badge/index' })
  411. },
  412. showLoginSheet() {
  413. this.loginSheetVisible = true
  414. },
  415. hideLoginSheet() {
  416. this.loginSheetVisible = false
  417. },
  418. onAgreementChange(e) {
  419. this.agreed = (e.detail.value || []).length > 0
  420. },
  421. showAgreement() {
  422. uni.navigateTo({ url: '/pages/policy/agreement' })
  423. },
  424. showPrivacy() {
  425. uni.navigateTo({ url: '/pages/policy/privacy' })
  426. },
  427. handleLogin() {
  428. if (this.loginLoading) return
  429. if (!this.agreed) {
  430. uni.showToast({ title: '请先阅读并同意用户协议', icon: 'none' })
  431. return
  432. }
  433. this.loginLoading = true
  434. var self = this
  435. wx.login({
  436. success: function(res) {
  437. if (res.code) {
  438. wechatLogin(res.code).then(function(resp) {
  439. var data = resp.data
  440. self.$store.dispatch('login', data)
  441. uni.showToast({ title: '登录成功', icon: 'success' })
  442. self.hideLoginSheet()
  443. self.loadInfo()
  444. }).catch(function(err) {
  445. console.error('登录失败', err)
  446. uni.showToast({ title: (err && err.message) || '登录失败', icon: 'none' })
  447. }).finally(function() {
  448. self.loginLoading = false
  449. })
  450. } else {
  451. uni.showToast({ title: '微信登录失败', icon: 'none' })
  452. self.loginLoading = false
  453. }
  454. },
  455. fail: function() {
  456. uni.showToast({ title: '微信登录失败', icon: 'none' })
  457. self.loginLoading = false
  458. }
  459. })
  460. },
  461. handleLoginPhone(e) {
  462. if (this.loginLoading) return
  463. if (!this.agreed) {
  464. uni.showToast({ title: '请先阅读并同意用户协议', icon: 'none' })
  465. return
  466. }
  467. var phoneCode = (e && e.detail && e.detail.code) ? e.detail.code : ''
  468. if (!phoneCode) {
  469. uni.showToast({ title: '请授权手机号后登录', icon: 'none' })
  470. return
  471. }
  472. this.loginLoading = true
  473. var self = this
  474. wx.login({
  475. success: function(res) {
  476. if (res.code) {
  477. wechatPhoneLogin({ code: res.code, phoneCode: phoneCode }).then(function(resp) {
  478. var data = resp.data
  479. self.$store.dispatch('login', data)
  480. uni.showToast({ title: '登录成功', icon: 'success' })
  481. self.hideLoginSheet()
  482. self.loadInfo()
  483. }).catch(function(err) {
  484. console.error('登录失败', err)
  485. uni.showToast({ title: (err && err.message) || '登录失败', icon: 'none' })
  486. }).finally(function() {
  487. self.loginLoading = false
  488. })
  489. } else {
  490. uni.showToast({ title: '微信登录失败', icon: 'none' })
  491. self.loginLoading = false
  492. }
  493. },
  494. fail: function() {
  495. uni.showToast({ title: '微信登录失败', icon: 'none' })
  496. self.loginLoading = false
  497. }
  498. })
  499. },
  500. goTo(url) {
  501. uni.navigateTo({ url: url })
  502. },
  503. goWork() {
  504. uni.navigateTo({ url: '/pages/work/index' })
  505. }
  506. }
  507. }
  508. </script>
  509. <style scoped>
  510. .home-page { min-height: 100vh; background: #F5FAFE; padding: 0 32rpx 32rpx; }
  511. /* Banner:深底反白 */
  512. .banner {
  513. background: linear-gradient(135deg, #1E3A5F, #1E3A5F 55%, #1E3A5F);
  514. border-radius: 0 0 32rpx 32rpx;
  515. padding: 72rpx 32rpx 48rpx;
  516. text-align: center;
  517. margin: 0 -32rpx 24rpx;
  518. }
  519. .banner-logo { width: 480rpx; display: block; margin: 0 auto 20rpx; }
  520. .banner-slogan { display: block; font-size: 28rpx; color: #DCE7F1; letter-spacing: 2rpx; margin-bottom: 32rpx; }
  521. .login-entry-btn {
  522. background: #2E6FA8;
  523. color: #FFF;
  524. font-size: 26rpx;
  525. font-weight: 600;
  526. border-radius: 100rpx;
  527. padding: 0 48rpx;
  528. height: 72rpx;
  529. line-height: 72rpx;
  530. margin: 0 auto;
  531. border: none;
  532. width: auto;
  533. }
  534. .banner-welcome { display: flex; flex-direction: column; align-items: center; }
  535. .banner-welcome-text { font-size: 32rpx; font-weight: 600; color: #FFF; margin-bottom: 8rpx; }
  536. .banner-welcome-sub { font-size: 24rpx; color: #6B7B8C; }
  537. /* 我的档案 */
  538. .status-card { background: #FFF; border-radius: 16rpx; padding: 24rpx 32rpx; margin-bottom: 24rpx; }
  539. .status-row { display: flex; justify-content: space-between; padding: 14rpx 0; border-bottom: 1rpx solid #E3ECF4; }
  540. .status-row:last-child { border-bottom: none; }
  541. .status-label { font-size: 28rpx; color: #3B5A78; }
  542. .status-value-wrap { display: flex; align-items: center; max-width: 420rpx; }
  543. .status-value { font-size: 28rpx; color: #1E3A5F; font-weight: 500; max-width: 390rpx; text-align: right; }
  544. .status-arrow { font-size: 28rpx; color: #6B7B8C; margin-left: 8rpx; }
  545. .val-pass { color: #0E8A4F; }
  546. .val-pending { color: #FFB020; }
  547. .val-fail { color: #C0392B; }
  548. /* 个人成长卡 */
  549. .growth-card { background: #FFF; border-radius: 16rpx; padding: 28rpx 32rpx; margin-bottom: 24rpx; }
  550. .growth-card:active { background: #F5FAFE; }
  551. .growth-head { display: flex; align-items: center; margin-bottom: 24rpx; }
  552. .growth-grade-dot { width: 16rpx; height: 16rpx; border-radius: 50%; margin-right: 12rpx; }
  553. .growth-grade-name { font-size: 32rpx; font-weight: 700; }
  554. .growth-earned { font-size: 24rpx; color: #6B7B8C; margin-left: 16rpx; }
  555. .growth-more { margin-left: auto; font-size: 40rpx; color: #6B7B8C; }
  556. .growth-body { display: flex; border-top: 1rpx solid #E3ECF4; padding-top: 20rpx; }
  557. .growth-cell { flex: 1; display: flex; flex-direction: column; align-items: center; }
  558. .growth-cell + .growth-cell { border-left: 1rpx solid #E3ECF4; }
  559. .growth-cell-num { font-size: 32rpx; font-weight: 700; margin-bottom: 4rpx; }
  560. .growth-cell-label { font-size: 22rpx; color: #6B7B8C; }
  561. .growth-card-guide { display: flex; align-items: center; justify-content: center; padding: 40rpx 32rpx; }
  562. .growth-guide-text { font-size: 26rpx; color: #6B7B8C; }
  563. /* 健康服务工作台入口(服务人员) */
  564. .work-entry {
  565. display: flex;
  566. align-items: center;
  567. background: #FFF;
  568. border-radius: 16rpx;
  569. padding: 28rpx 32rpx;
  570. margin-bottom: 24rpx;
  571. border-left: 8rpx solid #2E6FA8;
  572. }
  573. .work-entry:active { background: #F5FAFE; }
  574. .work-entry-main { flex: 1; overflow: hidden; }
  575. .work-entry-title { display: block; font-size: 30rpx; font-weight: 700; color: #1E3A5F; margin-bottom: 6rpx; }
  576. .work-entry-sub { display: block; font-size: 22rpx; color: #6B7B8C; }
  577. .work-entry-arrow { flex-shrink: 0; font-size: 40rpx; color: #6B7B8C; margin-left: 8rpx; }
  578. /* 区块标题 */
  579. .section-title { font-size: 30rpx; font-weight: 600; color: #1E3A5F; margin-bottom: 16rpx; border-left: 8rpx solid #2E6FA8; padding-left: 16rpx; }
  580. /* 平台动态 */
  581. .dynamic-list { background: #FFF; border-radius: 16rpx; overflow: hidden; margin-bottom: 24rpx; }
  582. .dynamic-item { display: flex; align-items: center; padding: 24rpx 28rpx; border-bottom: 1rpx solid #E3ECF4; }
  583. .dynamic-item:last-child { border-bottom: none; }
  584. .dynamic-item:active { background: #F5FAFE; }
  585. .dynamic-tag { flex-shrink: 0; font-size: 22rpx; font-weight: 600; padding: 4rpx 14rpx; border-radius: 6rpx; margin-right: 16rpx; }
  586. .dynamic-tag-course { background: #E8F3FC; color: #2E6FA8; }
  587. .dynamic-main { flex: 1; overflow: hidden; }
  588. .dynamic-title { display: block; font-size: 28rpx; font-weight: 600; color: #1E3A5F; margin-bottom: 4rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  589. .dynamic-desc { display: block; font-size: 22rpx; color: #6B7B8C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  590. .dynamic-arrow { flex-shrink: 0; font-size: 32rpx; color: #6B7B8C; margin-left: 8rpx; }
  591. .dynamic-empty { background: #FFF; border-radius: 16rpx; padding: 40rpx 0; text-align: center; margin-bottom: 24rpx; }
  592. .dynamic-empty-text { font-size: 26rpx; color: #6B7B8C; }
  593. /* AI 小知识 */
  594. .tip-swiper { height: 180rpx; margin-bottom: 24rpx; }
  595. .tip-card {
  596. display: flex;
  597. align-items: center;
  598. background: linear-gradient(135deg, #1E3A5F, #1E3A5F);
  599. border-radius: 16rpx;
  600. padding: 32rpx 28rpx;
  601. height: 140rpx;
  602. box-sizing: border-box;
  603. }
  604. .tip-icon { font-size: 40rpx; margin-right: 20rpx; flex-shrink: 0; }
  605. .tip-text { font-size: 26rpx; color: #DCE7F1; line-height: 1.6; }
  606. /* 最近课程 */
  607. .course-mini-list { display: flex; flex-direction: column; margin-top: 4rpx; }
  608. .course-mini-card { background: #FFF; border-radius: 16rpx; padding: 24rpx 28rpx; margin-bottom: 16rpx; }
  609. .course-mini-card:active { background: #F5FAFE; }
  610. .course-mini-head { display: flex; align-items: center; margin-bottom: 8rpx; }
  611. .course-mini-level { font-size: 22rpx; font-weight: 600; color: #2E6FA8; background: #E8F3FC; border-radius: 8rpx; padding: 4rpx 14rpx; margin-right: 16rpx; }
  612. .course-mini-name { font-size: 28rpx; font-weight: 600; color: #1E3A5F; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  613. .course-mini-status { font-size: 22rpx; border-radius: 6rpx; padding: 4rpx 14rpx; }
  614. .course-mini-status.st-upcoming { color: #2E6FA8; background: #E8F3FC; }
  615. .course-mini-status.st-active { color: #0E8A4F; background: #E6F6EE; }
  616. .course-mini-status.st-finished { color: #6B7B8C; background: #E3ECF4; }
  617. .course-mini-desc { font-size: 24rpx; color: #3B5A78; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  618. .course-mini-empty { background: #FFF; border-radius: 16rpx; padding: 48rpx 0; text-align: center; }
  619. .course-mini-empty-text { font-size: 26rpx; color: #6B7B8C; }
  620. /* 未登录引导 */
  621. .login-hint {
  622. display: flex;
  623. align-items: center;
  624. background: #2E6FA8;
  625. border-radius: 16rpx;
  626. padding: 28rpx 32rpx;
  627. margin-top: 8rpx;
  628. }
  629. .login-hint-icon { font-size: 36rpx; margin-right: 16rpx; }
  630. .login-hint-text { flex: 1; font-size: 26rpx; color: #FFF; font-weight: 500; }
  631. .login-hint-arrow { font-size: 32rpx; color: #FFF; }
  632. /* Bottom Sheet Styles */
  633. .login-sheet-mask {
  634. position: fixed;
  635. top: 0;
  636. left: 0;
  637. right: 0;
  638. bottom: 0;
  639. background: rgba(0, 0, 0, 0.5);
  640. z-index: 100;
  641. display: flex;
  642. flex-direction: column;
  643. justify-content: flex-end;
  644. opacity: 0;
  645. visibility: hidden;
  646. pointer-events: none;
  647. transition: opacity 0.3s ease;
  648. }
  649. .login-sheet-mask.sheet-open {
  650. opacity: 1;
  651. visibility: visible;
  652. pointer-events: auto;
  653. }
  654. .login-sheet-panel {
  655. background: #FFF;
  656. border-radius: 32rpx 32rpx 0 0;
  657. padding-bottom: calc(constant(safe-area-inset-bottom) + 40rpx);
  658. width: 100%;
  659. transform: translateY(100%);
  660. transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  661. }
  662. .login-sheet-mask.sheet-open .login-sheet-panel {
  663. transform: translateY(0);
  664. }
  665. .sheet-handle {
  666. width: 80rpx;
  667. height: 8rpx;
  668. background: #E3ECF4;
  669. border-radius: 4rpx;
  670. margin: 24rpx auto;
  671. }
  672. .sheet-content {
  673. padding: 0 60rpx 40rpx;
  674. display: flex;
  675. flex-direction: column;
  676. align-items: center;
  677. }
  678. .sheet-header {
  679. text-align: center;
  680. margin-bottom: 48rpx;
  681. }
  682. .sheet-title {
  683. display: block;
  684. font-size: 36rpx;
  685. font-weight: 700;
  686. color: #1E3A5F;
  687. margin-bottom: 12rpx;
  688. }
  689. .sheet-sub {
  690. display: block;
  691. font-size: 26rpx;
  692. color: #3B5A78;
  693. }
  694. .sheet-login-btn {
  695. width: 100%;
  696. height: 96rpx;
  697. line-height: 96rpx;
  698. background: #2E6FA8;
  699. color: #FFF;
  700. font-size: 32rpx;
  701. font-weight: 600;
  702. border-radius: 48rpx;
  703. border: none;
  704. margin-bottom: 32rpx;
  705. }
  706. .sheet-login-btn:active {
  707. opacity: 0.9;
  708. }
  709. .sheet-footer {
  710. display: flex;
  711. flex-direction: column;
  712. align-items: center;
  713. justify-content: center;
  714. margin-top: 8rpx;
  715. }
  716. .agreement-check {
  717. display: flex;
  718. }
  719. .agreement-row {
  720. display: flex;
  721. align-items: center;
  722. justify-content: center;
  723. }
  724. .agreement-links {
  725. display: flex;
  726. align-items: center;
  727. justify-content: center;
  728. margin-top: 4rpx;
  729. }
  730. .agreement-link {
  731. font-size: 22rpx;
  732. color: #FC7A57;
  733. }
  734. .sheet-footer-text {
  735. font-size: 22rpx;
  736. color: #6B7B8C;
  737. }
  738. </style>