index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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">让 AI 成为您的贴心伙伴</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">每一次探索,都离 AI 高手更近一步</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 class="growth-card" v-if="isLoggedIn" @click="goGrowth">
  29. <view class="growth-head">
  30. <view class="growth-grade-dot" :style="{ background: gradeColor }"></view>
  31. <text class="growth-grade-name" :style="{ color: gradeColor }">{{ gradeText }}</text>
  32. <text class="growth-earned">{{ earnedCount }}/32 徽章</text>
  33. <text class="growth-more">›</text>
  34. </view>
  35. <view class="growth-body">
  36. <view class="growth-cell">
  37. <text class="growth-cell-num" :style="{ color: gradeColor }">{{ progressText }}</text>
  38. <text class="growth-cell-label">完课验收</text>
  39. </view>
  40. <view class="growth-cell">
  41. <text class="growth-cell-num" :style="{ color: gradeColor }">{{ certLabel }}</text>
  42. <text class="growth-cell-label">完课证书</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="growth-card growth-card-guide" v-else @click="showLoginSheet">
  47. <text class="growth-guide-text">登录后查看我的成长档案</text>
  48. </view>
  49. <!-- 平台动态 -->
  50. <view class="section-title">平台动态</view>
  51. <view class="dynamic-list" v-if="dynamics.length">
  52. <view class="dynamic-item" v-for="(d, idx) in dynamics" :key="idx" @click="goDynamic(d)">
  53. <text class="dynamic-tag" :class="d.tagClass">{{ d.tag }}</text>
  54. <view class="dynamic-main">
  55. <text class="dynamic-title">{{ d.title }}</text>
  56. <text class="dynamic-desc">{{ d.desc }}</text>
  57. </view>
  58. <text class="dynamic-arrow">›</text>
  59. </view>
  60. </view>
  61. <view class="dynamic-empty" v-else-if="isLoggedIn">
  62. <text class="dynamic-empty-text">暂无动态,稍后再来看看</text>
  63. </view>
  64. <!-- AI 小知识 -->
  65. <view class="section-title">AI 小知识</view>
  66. <swiper class="tip-swiper" :autoplay="true" :interval="4000" :circular="true" :indicator-dots="true"
  67. indicator-active-color="#FC7A57" indicator-color="#E8E2DE">
  68. <swiper-item v-for="(tip, idx) in aiTips" :key="idx">
  69. <view class="tip-card">
  70. <text class="tip-icon">{{ tip.icon }}</text>
  71. <text class="tip-text">{{ tip.text }}</text>
  72. </view>
  73. </swiper-item>
  74. </swiper>
  75. <!-- 沙龙 -->
  76. <view class="section-title">沙龙</view>
  77. <view class="course-mini-list">
  78. <view class="course-mini-card" v-for="(s, idx) in salonNews" :key="idx" @click="goSalon(s)">
  79. <view class="course-mini-head">
  80. <text class="course-mini-level">{{ mapTheme(s.theme) }}</text>
  81. <text class="course-mini-name">{{ s.title }}</text>
  82. <text class="course-mini-status" :class="s.num <= 0 ? 'st-finished' : 'st-upcoming'">{{ s.num <= 0 ? '已满' : '可报名' }}</text>
  83. </view>
  84. <text class="course-mini-desc">{{ formatDateTime(s.time) }} · {{ s.place }}</text>
  85. <text class="course-mini-desc">余 {{ s.num }}/{{ s.capacity }} 位</text>
  86. </view>
  87. <view class="course-mini-empty" v-if="!salonNews.length && isLoggedIn">
  88. <text class="course-mini-empty-text">暂无沙龙活动</text>
  89. </view>
  90. </view>
  91. <!-- 最近课程 -->
  92. <view class="section-title">最近课程</view>
  93. <view class="course-mini-list">
  94. <view class="course-mini-card" v-for="(c, idx) in recentCourses" :key="idx" @click="goToCourse(c)">
  95. <view class="course-mini-head">
  96. <text class="course-mini-level">{{ c.level || 'L' }}</text>
  97. <text class="course-mini-name">{{ c.name }}</text>
  98. <text class="course-mini-status" :class="'st-' + c.effectiveStatus">{{ statusLabel(c.effectiveStatus) }}</text>
  99. </view>
  100. <text class="course-mini-desc" v-if="c.description">{{ c.description }}</text>
  101. </view>
  102. <view class="course-mini-empty" v-if="!recentCourses.length && isLoggedIn">
  103. <text class="course-mini-empty-text">暂无课程</text>
  104. </view>
  105. </view>
  106. <!-- 登录引导卡(未登录时平台动态区下方提示) -->
  107. <view class="login-hint" v-if="!isLoggedIn" @click="showLoginSheet">
  108. <text class="login-hint-icon">✨</text>
  109. <text class="login-hint-text">登录解锁班级、成长与沙龙报名</text>
  110. <text class="login-hint-arrow">›</text>
  111. </view>
  112. <!-- Login Bottom Sheet -->
  113. <view class="login-sheet-mask" :class="{ 'sheet-open': loginSheetVisible }" @click="hideLoginSheet">
  114. <view class="login-sheet-panel" @click.stop>
  115. <view class="sheet-handle"></view>
  116. <view class="sheet-content">
  117. <view class="sheet-header">
  118. <text class="sheet-title">欢迎回来</text>
  119. <text class="sheet-sub">登录以解锁更多成长功能</text>
  120. </view>
  121. <button class="sheet-login-btn" @click="handleLogin" :loading="loginLoading" :disabled="loginLoading">
  122. 微信一键登录
  123. </button>
  124. <view class="sheet-footer">
  125. <text class="sheet-footer-text">登录即代表同意服务协议</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import { wechatLogin, getCourseList, getMyEnrollments, getMyBadges, getCourseProgress, getMyCert, getSalonList } from '@/utils/api.js'
  134. import { formatDateTime } from '@/utils/format.js'
  135. import { loadInviteCode, getInviteCode, buildSharePath } from '@/utils/share.js'
  136. export default {
  137. data() {
  138. return {
  139. myClasses: [],
  140. grade: null,
  141. earnedCount: 0,
  142. progress: null,
  143. cert: null,
  144. salonNews: [],
  145. dynamics: [],
  146. recentCourses: [],
  147. aiTips: [
  148. { icon: '💡', text: '提示词三要素:角色 + 任务 + 要求,描述越具体,AI 越懂你。' },
  149. { icon: '🤖', text: '把 AI 当成一起上课的学伴,先问「怎么做」,再问「为什么」。' },
  150. { icon: '🚀', text: 'L0 完成 6 项验收即可领取完课证书,开启你的 AI 成长档案。' },
  151. { icon: '🎯', text: '五级成长主线:见习 → 启航 → 专精 → 系统师 → 讲师。' }
  152. ],
  153. gradeColorMap: {
  154. novice: '#94877F',
  155. starter: '#7C3AED',
  156. expert: '#F59E0B',
  157. system: '#14B8A6',
  158. lecturer: '#FC7A57'
  159. },
  160. themeMap: {
  161. ai_basic: 'AI 认知基础',
  162. wealth: '家庭财富管理',
  163. health: '健康管理',
  164. growth: '孩子成长陪伴'
  165. },
  166. loginSheetVisible: false,
  167. loginLoading: false
  168. }
  169. },
  170. computed: {
  171. isLoggedIn() {
  172. return this.$store.getters.isLoggedIn
  173. },
  174. nickname() {
  175. return this.$store.state.nickname || this.$store.state.name || ''
  176. },
  177. verifyLabel() {
  178. var v = this.$store.state.alumniVerify
  179. if (v === 'accepted') return '✅ 已通过'
  180. if (v === 'pending') return '⏳ 待审核'
  181. return '❌ 未校验'
  182. },
  183. verifyClass() {
  184. var v = this.$store.state.alumniVerify
  185. return v === 'accepted' ? 'val-pass' : (v === 'pending' ? 'val-pending' : 'val-fail')
  186. },
  187. classLabel() {
  188. var cs = this.myClasses || []
  189. if (!cs.length) return '未进班'
  190. if (cs.length === 1) return cs[0]
  191. return cs.slice(0, 2).join('、') + ' 等' + cs.length + '个班级'
  192. },
  193. gradeColor() {
  194. if (!this.grade || !this.grade.key) return '#FC7A57'
  195. return this.gradeColorMap[this.grade.key] || '#FC7A57'
  196. },
  197. gradeText() {
  198. if (!this.grade || !this.grade.name) return '未入门'
  199. return this.grade.name
  200. },
  201. progressText() {
  202. if (!this.progress) return '-'
  203. return this.progress.done + '/' + this.progress.total
  204. },
  205. certLabel() {
  206. if (this.cert && this.cert.eligible) return '已领证'
  207. return '学习中'
  208. }
  209. },
  210. onShow() {
  211. loadInviteCode()
  212. this.loadInfo()
  213. },
  214. onLoad() {
  215. // 注册全局登录浮层触发事件(uni-app 页面生命周期 onLoad 早于 created 时机更稳)
  216. var self = this
  217. try {
  218. uni.$on('showLoginSheet', function() {
  219. self.showLoginSheet()
  220. })
  221. } catch (e) {
  222. console.error('[home] 注册 showLoginSheet 监听失败', e)
  223. }
  224. },
  225. onUnload() {
  226. try {
  227. uni.$off('showLoginSheet')
  228. } catch (e) {}
  229. },
  230. // 分享给好友
  231. onShareAppMessage() {
  232. return {
  233. title: '爱伴·AI之旅|让 AI 成为您的贴心伙伴',
  234. path: buildSharePath('/pages/index/index')
  235. }
  236. },
  237. // 分享到朋友圈
  238. onShareTimeline() {
  239. var code = getInviteCode()
  240. return {
  241. title: '爱伴·AI之旅|让 AI 成为您的贴心伙伴',
  242. query: code ? 'inviteCode=' + code : ''
  243. }
  244. },
  245. methods: {
  246. loadInfo() {
  247. if (!this.isLoggedIn) return
  248. var self = this
  249. this.loadClasses()
  250. this.loadGrowth()
  251. this.loadCourses()
  252. this.loadSalons()
  253. },
  254. loadClasses() {
  255. var self = this
  256. getMyEnrollments().then(function(resp) {
  257. var list = resp.data || []
  258. var classes = []
  259. for (var i = 0; i < list.length; i++) {
  260. var e = list[i]
  261. if (e.classId && e.className) {
  262. classes.push(e.className)
  263. }
  264. }
  265. // 去重(一个人可能在多个班级,同名只算一次)
  266. classes = classes.filter(function(v, i, arr) {
  267. return arr.indexOf(v) === i
  268. })
  269. self.myClasses = classes
  270. }).catch(function() {})
  271. },
  272. loadGrowth() {
  273. var self = this
  274. getMyBadges().then(function(resp) {
  275. var d = resp.data || {}
  276. self.grade = d.grade || null
  277. self.earnedCount = d.earnedCount || 0
  278. }).catch(function() {})
  279. getCourseProgress().then(function(resp) {
  280. var d = resp.data || {}
  281. if (d.done !== undefined && d.total !== undefined) {
  282. self.progress = d
  283. }
  284. }).catch(function() {})
  285. getMyCert().then(function(resp) {
  286. self.cert = resp.data || null
  287. }).catch(function() {})
  288. },
  289. loadCourses() {
  290. var self = this
  291. // 最近课程:优先取进行中/未开始,最多 3 门
  292. getCourseList().then(function(resp) {
  293. var list = resp.data || []
  294. var sorted = list.slice().sort(function(a, b) {
  295. return self.rankOf(a) - self.rankOf(b)
  296. })
  297. self.recentCourses = sorted.slice(0, 3)
  298. self.buildDynamics()
  299. }).catch(function() {})
  300. },
  301. loadSalons() {
  302. var self = this
  303. getSalonList().then(function(resp) {
  304. self.salonNews = resp.data || []
  305. self.buildDynamics()
  306. }).catch(function() {})
  307. },
  308. buildDynamics() {
  309. // 平台动态 = 进行中/未开始课程(最多 3 条);沙龙已独立成区块,避免重复
  310. var self = this
  311. var arr = []
  312. var courses = this.recentCourses || []
  313. for (var j = 0; j < courses.length && arr.length < 3; j++) {
  314. var c = courses[j]
  315. if (c.effectiveStatus !== 'active' && c.effectiveStatus !== 'upcoming') continue
  316. arr.push({
  317. type: 'course',
  318. tag: (c.level || 'L') + ' 课程',
  319. tagClass: 'dynamic-tag-course',
  320. title: c.name,
  321. desc: self.statusLabel(c.effectiveStatus) + (c.description ? ' · ' + c.description : ''),
  322. url: '/pages/course/detail?courseId=' + c.id
  323. })
  324. }
  325. this.dynamics = arr
  326. },
  327. mapTheme(theme) {
  328. return this.themeMap[theme] || theme || '通用主题'
  329. },
  330. rankOf(c) {
  331. var st = c && c.effectiveStatus
  332. if (st === 'active') return 0
  333. if (st === 'upcoming') return 1
  334. if (st === 'finished') return 2
  335. return 3
  336. },
  337. statusLabel(st) {
  338. var map = { upcoming: '未开始', active: '进行中', finished: '已结束', draft: '未发布' }
  339. return map[st] || st || '-'
  340. },
  341. goToCourse(c) {
  342. if (!c || !c.id) return
  343. uni.navigateTo({ url: '/pages/course/detail?courseId=' + c.id })
  344. },
  345. goSalon() {
  346. uni.navigateTo({ url: '/pages/salon/list' })
  347. },
  348. goDynamic(d) {
  349. if (!d || !d.url) return
  350. uni.navigateTo({ url: d.url })
  351. },
  352. goGrowth() {
  353. uni.navigateTo({ url: '/pages/badge/index' })
  354. },
  355. showLoginSheet() {
  356. this.loginSheetVisible = true
  357. },
  358. hideLoginSheet() {
  359. this.loginSheetVisible = false
  360. },
  361. handleLogin() {
  362. if (this.loginLoading) return
  363. this.loginLoading = true
  364. var self = this
  365. wx.login({
  366. success: function(res) {
  367. if (res.code) {
  368. wechatLogin(res.code).then(function(resp) {
  369. var data = resp.data
  370. self.$store.dispatch('login', data)
  371. uni.showToast({ title: '登录成功', icon: 'success' })
  372. self.hideLoginSheet()
  373. self.loadInfo()
  374. }).catch(function(err) {
  375. console.error('登录失败', err)
  376. }).finally(function() {
  377. self.loginLoading = false
  378. })
  379. } else {
  380. uni.showToast({ title: '微信登录失败', icon: 'none' })
  381. self.loginLoading = false
  382. }
  383. },
  384. fail: function() {
  385. uni.showToast({ title: '微信登录失败', icon: 'none' })
  386. self.loginLoading = false
  387. }
  388. })
  389. },
  390. goTo(url) {
  391. uni.navigateTo({ url: url })
  392. }
  393. }
  394. }
  395. </script>
  396. <style scoped>
  397. .home-page { min-height: 100vh; background: #F5F5F5; padding: 0 32rpx 32rpx; }
  398. /* Banner:深底反白 */
  399. .banner {
  400. background: linear-gradient(135deg, #1B212C, #2A2326 55%, #3A2E30);
  401. border-radius: 0 0 32rpx 32rpx;
  402. padding: 72rpx 32rpx 48rpx;
  403. text-align: center;
  404. margin: 0 -32rpx 24rpx;
  405. }
  406. .banner-logo { width: 480rpx; display: block; margin: 0 auto 20rpx; }
  407. .banner-slogan { display: block; font-size: 28rpx; color: #E8E2DE; letter-spacing: 2rpx; margin-bottom: 32rpx; }
  408. .login-entry-btn {
  409. background: #FC7A57;
  410. color: #FFF;
  411. font-size: 26rpx;
  412. font-weight: 600;
  413. border-radius: 100rpx;
  414. padding: 0 48rpx;
  415. height: 72rpx;
  416. line-height: 72rpx;
  417. margin: 0 auto;
  418. border: none;
  419. width: auto;
  420. }
  421. .banner-welcome { display: flex; flex-direction: column; align-items: center; }
  422. .banner-welcome-text { font-size: 32rpx; font-weight: 600; color: #FFF; margin-bottom: 8rpx; }
  423. .banner-welcome-sub { font-size: 24rpx; color: #B6AA9F; }
  424. /* 我的档案 */
  425. .status-card { background: #FFF; border-radius: 16rpx; padding: 24rpx 32rpx; margin-bottom: 24rpx; }
  426. .status-row { display: flex; justify-content: space-between; padding: 14rpx 0; border-bottom: 1rpx solid #F1F5F9; }
  427. .status-row:last-child { border-bottom: none; }
  428. .status-label { font-size: 28rpx; color: #5A4F4B; }
  429. .status-value-wrap { display: flex; align-items: center; max-width: 420rpx; }
  430. .status-value { font-size: 28rpx; color: #2A2326; font-weight: 500; max-width: 390rpx; text-align: right; }
  431. .status-arrow { font-size: 28rpx; color: #B6AA9F; margin-left: 8rpx; }
  432. .val-pass { color: #22C55E; }
  433. .val-pending { color: #FFB74D; }
  434. .val-fail { color: #EF5350; }
  435. /* 个人成长卡 */
  436. .growth-card { background: #FFF; border-radius: 16rpx; padding: 28rpx 32rpx; margin-bottom: 24rpx; }
  437. .growth-card:active { background: #FAF7F4; }
  438. .growth-head { display: flex; align-items: center; margin-bottom: 24rpx; }
  439. .growth-grade-dot { width: 16rpx; height: 16rpx; border-radius: 50%; margin-right: 12rpx; }
  440. .growth-grade-name { font-size: 32rpx; font-weight: 700; }
  441. .growth-earned { font-size: 24rpx; color: #94877F; margin-left: 16rpx; }
  442. .growth-more { margin-left: auto; font-size: 40rpx; color: #B6AA9F; }
  443. .growth-body { display: flex; border-top: 1rpx solid #F1F5F9; padding-top: 20rpx; }
  444. .growth-cell { flex: 1; display: flex; flex-direction: column; align-items: center; }
  445. .growth-cell + .growth-cell { border-left: 1rpx solid #F1F5F9; }
  446. .growth-cell-num { font-size: 32rpx; font-weight: 700; margin-bottom: 4rpx; }
  447. .growth-cell-label { font-size: 22rpx; color: #94877F; }
  448. .growth-card-guide { display: flex; align-items: center; justify-content: center; padding: 40rpx 32rpx; }
  449. .growth-guide-text { font-size: 26rpx; color: #94877F; }
  450. /* 区块标题 */
  451. .section-title { font-size: 30rpx; font-weight: 600; color: #2A2326; margin-bottom: 16rpx; border-left: 8rpx solid #FC7A57; padding-left: 16rpx; }
  452. /* 平台动态 */
  453. .dynamic-list { background: #FFF; border-radius: 16rpx; overflow: hidden; margin-bottom: 24rpx; }
  454. .dynamic-item { display: flex; align-items: center; padding: 24rpx 28rpx; border-bottom: 1rpx solid #F1F5F9; }
  455. .dynamic-item:last-child { border-bottom: none; }
  456. .dynamic-item:active { background: #FAF7F4; }
  457. .dynamic-tag { flex-shrink: 0; font-size: 22rpx; font-weight: 600; padding: 4rpx 14rpx; border-radius: 6rpx; margin-right: 16rpx; }
  458. .dynamic-tag-course { background: #EEF2FF; color: #7C3AED; }
  459. .dynamic-main { flex: 1; overflow: hidden; }
  460. .dynamic-title { display: block; font-size: 28rpx; font-weight: 600; color: #2A2326; margin-bottom: 4rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  461. .dynamic-desc { display: block; font-size: 22rpx; color: #94877F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  462. .dynamic-arrow { flex-shrink: 0; font-size: 32rpx; color: #B6AA9F; margin-left: 8rpx; }
  463. .dynamic-empty { background: #FFF; border-radius: 16rpx; padding: 40rpx 0; text-align: center; margin-bottom: 24rpx; }
  464. .dynamic-empty-text { font-size: 26rpx; color: #94877F; }
  465. /* AI 小知识 */
  466. .tip-swiper { height: 180rpx; margin-bottom: 24rpx; }
  467. .tip-card {
  468. display: flex;
  469. align-items: center;
  470. background: linear-gradient(135deg, #1B212C, #2A2326);
  471. border-radius: 16rpx;
  472. padding: 32rpx 28rpx;
  473. height: 140rpx;
  474. box-sizing: border-box;
  475. }
  476. .tip-icon { font-size: 40rpx; margin-right: 20rpx; flex-shrink: 0; }
  477. .tip-text { font-size: 26rpx; color: #E8E2DE; line-height: 1.6; }
  478. /* 最近课程 */
  479. .course-mini-list { display: flex; flex-direction: column; margin-top: 4rpx; }
  480. .course-mini-card { background: #FFF; border-radius: 16rpx; padding: 24rpx 28rpx; margin-bottom: 16rpx; }
  481. .course-mini-card:active { background: #F8FAFC; }
  482. .course-mini-head { display: flex; align-items: center; margin-bottom: 8rpx; }
  483. .course-mini-level { font-size: 22rpx; font-weight: 600; color: #FC7A57; background: #FFF0E8; border-radius: 8rpx; padding: 4rpx 14rpx; margin-right: 16rpx; }
  484. .course-mini-name { font-size: 28rpx; font-weight: 600; color: #2A2326; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  485. .course-mini-status { font-size: 22rpx; border-radius: 6rpx; padding: 4rpx 14rpx; }
  486. .course-mini-status.st-upcoming { color: #FC7A57; background: #FFF0E8; }
  487. .course-mini-status.st-active { color: #22C55E; background: #F0FDF4; }
  488. .course-mini-status.st-finished { color: #94877F; background: #F1F5F9; }
  489. .course-mini-desc { font-size: 24rpx; color: #5A4F4B; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  490. .course-mini-empty { background: #FFF; border-radius: 16rpx; padding: 48rpx 0; text-align: center; }
  491. .course-mini-empty-text { font-size: 26rpx; color: #94877F; }
  492. /* 未登录引导 */
  493. .login-hint {
  494. display: flex;
  495. align-items: center;
  496. background: linear-gradient(135deg, #FC7A57, #F9494F);
  497. border-radius: 16rpx;
  498. padding: 28rpx 32rpx;
  499. margin-top: 8rpx;
  500. }
  501. .login-hint-icon { font-size: 36rpx; margin-right: 16rpx; }
  502. .login-hint-text { flex: 1; font-size: 26rpx; color: #FFF; font-weight: 500; }
  503. .login-hint-arrow { font-size: 32rpx; color: #FFF; }
  504. /* Bottom Sheet Styles */
  505. .login-sheet-mask {
  506. position: fixed;
  507. top: 0;
  508. left: 0;
  509. right: 0;
  510. bottom: 0;
  511. background: rgba(0, 0, 0, 0.5);
  512. z-index: 100;
  513. display: flex;
  514. flex-direction: column;
  515. justify-content: flex-end;
  516. opacity: 0;
  517. visibility: hidden;
  518. pointer-events: none;
  519. transition: opacity 0.3s ease;
  520. }
  521. .login-sheet-mask.sheet-open {
  522. opacity: 1;
  523. visibility: visible;
  524. pointer-events: auto;
  525. }
  526. .login-sheet-panel {
  527. background: #FFF;
  528. border-radius: 32rpx 32rpx 0 0;
  529. padding-bottom: calc(constant(safe-area-inset-bottom) + 40rpx);
  530. width: 100%;
  531. transform: translateY(100%);
  532. transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  533. }
  534. .login-sheet-mask.sheet-open .login-sheet-panel {
  535. transform: translateY(0);
  536. }
  537. .sheet-handle {
  538. width: 80rpx;
  539. height: 8rpx;
  540. background: #E2E8F0;
  541. border-radius: 4rpx;
  542. margin: 24rpx auto;
  543. }
  544. .sheet-content {
  545. padding: 0 60rpx 40rpx;
  546. display: flex;
  547. flex-direction: column;
  548. align-items: center;
  549. }
  550. .sheet-header {
  551. text-align: center;
  552. margin-bottom: 48rpx;
  553. }
  554. .sheet-title {
  555. display: block;
  556. font-size: 36rpx;
  557. font-weight: 700;
  558. color: #2A2326;
  559. margin-bottom: 12rpx;
  560. }
  561. .sheet-sub {
  562. display: block;
  563. font-size: 26rpx;
  564. color: #5A4F4B;
  565. }
  566. .sheet-login-btn {
  567. width: 100%;
  568. height: 96rpx;
  569. line-height: 96rpx;
  570. background: linear-gradient(135deg, #FC7A57, #F9494F);
  571. color: #FFF;
  572. font-size: 32rpx;
  573. font-weight: 600;
  574. border-radius: 48rpx;
  575. border: none;
  576. margin-bottom: 32rpx;
  577. }
  578. .sheet-login-btn:active {
  579. opacity: 0.9;
  580. }
  581. .sheet-footer {
  582. text-align: center;
  583. }
  584. .sheet-footer-text {
  585. font-size: 22rpx;
  586. color: #94877F;
  587. }
  588. </style>