article-detail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. <template>
  2. <view class="detail-container">
  3. <!-- 加载状态 -->
  4. <view v-if="loading" class="loading-wrap">
  5. <view class="loading-spinner"></view>
  6. <text class="loading-text">加载中...</text>
  7. </view>
  8. <!-- 错误状态 -->
  9. <view v-else-if="error" class="error-wrap">
  10. <text class="error-icon">📄</text>
  11. <text class="error-text">{{ errorMsg }}</text>
  12. <button class="retry-btn" @click="loadDetail(articleId)">重新加载</button>
  13. </view>
  14. <!-- 文章内容 -->
  15. <view v-else-if="article" class="detail-content">
  16. <!-- 封面图 -->
  17. <image
  18. v-if="article.coverImage"
  19. class="detail-cover"
  20. :src="article.coverImage"
  21. mode="widthFix"
  22. />
  23. <!-- 文章标题 -->
  24. <text class="detail-title">{{ article.title }}</text>
  25. <!-- 元信息 -->
  26. <view class="detail-meta">
  27. <text class="meta-author">{{ article.author || '浠艾福' }}</text>
  28. <text class="meta-separator">|</text>
  29. <text class="meta-date">{{ getFormattedDate() }}</text>
  30. <text class="meta-separator">|</text>
  31. <text class="meta-read">{{ article.readTime || 3 }} 分钟阅读</text>
  32. </view>
  33. <!-- 分类标签 + 内容类型/难度 -->
  34. <view class="detail-category-row">
  35. <text class="detail-category">{{ article.categoryName || '' }}</text>
  36. <text v-if="article.contentType" class="detail-type-badge" :class="'type-' + article.contentType">{{ contentTypeLabel(article.contentType) }}</text>
  37. <text v-if="article.difficultyLevel && article.difficultyLevel > 0" class="detail-difficulty">{{ '★'.repeat(article.difficultyLevel) }}{{ '☆'.repeat(5 - article.difficultyLevel) }}</text>
  38. </view>
  39. <!-- 维度标签 -->
  40. <view v-if="dimensionList.length" class="detail-dimensions">
  41. <text v-for="(dim, idx) in dimensionList" :key="idx" class="dimension-tag" :style="{ color: dim.color, background: dim.bgColor }">{{ dim.label }}</text>
  42. </view>
  43. <!-- 知识标签 -->
  44. <view v-if="tagList.length" class="detail-tags">
  45. <text v-for="(tag, idx) in tagList" :key="idx" class="tag-item">{{ tag }}</text>
  46. </view>
  47. <!-- 分割线 -->
  48. <view class="divider"></view>
  49. <!-- 文章正文(富文本) -->
  50. <view class="detail-body">
  51. <rich-text :nodes="article.content" />
  52. </view>
  53. <!-- 收藏按钮 -->
  54. <view class="action-bar">
  55. <view class="action-btn" @click="toggleFavorite">
  56. <text class="action-icon">{{ isFavorited ? '❤️' : '🤍' }}</text>
  57. <text class="action-text">{{ isFavorited ? '已收藏' : '收藏' }}</text>
  58. </view>
  59. <view class="action-btn" @click="handleShare">
  60. <text class="action-icon">📤</text>
  61. <text class="action-text">分享</text>
  62. </view>
  63. <view class="action-btn">
  64. <text class="action-icon">👁</text>
  65. <text class="action-text">{{ article.viewCount || 0 }}</text>
  66. </view>
  67. </view>
  68. <!-- 相关文章 -->
  69. <view class="related-section" v-if="relatedArticles.length > 0">
  70. <view class="related-header">
  71. <text class="related-title">📖 相关推荐</text>
  72. </view>
  73. <view class="related-list">
  74. <view
  75. v-for="item in relatedArticles"
  76. :key="item.id"
  77. class="related-card"
  78. @click="goRelatedArticle(item.id)"
  79. >
  80. <image
  81. class="related-cover"
  82. :src="item.coverImage || '/static/default-article.png'"
  83. mode="aspectFill"
  84. />
  85. <view class="related-info">
  86. <text class="related-name">{{ item.title }}</text>
  87. <text class="related-summary">{{ item.summary || '' }}</text>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 底部完成按钮 -->
  93. <view class="detail-footer">
  94. <!-- 定时器显示 -->
  95. <view class="reading-timer" v-if="readingSeconds >= 0">
  96. <text class="timer-icon">⏱</text>
  97. <text class="timer-text">{{ formatTime(readingSeconds) }}</text>
  98. <text class="timer-hint" v-if="readingSeconds < 60">阅读{{ 60 - readingSeconds }}秒可获取积分</text>
  99. <text class="timer-hint timer-ready" v-else>已达标,可领取积分</text>
  100. </view>
  101. <!-- 完成按钮 -->
  102. <button
  103. class="read-btn"
  104. :class="{ 'read-btn-active': readingSeconds >= 60 }"
  105. @click="onReadComplete"
  106. >阅读完成</button>
  107. </view>
  108. </view>
  109. <!-- 空状态 -->
  110. <view v-else class="error-wrap">
  111. <text class="error-icon">📄</text>
  112. <text class="error-text">文章不存在</text>
  113. </view>
  114. <!-- 分享弹窗 -->
  115. <view class="modal-mask" v-if="showShareModal" @click="showShareModal = false">
  116. <view class="share-modal" @click.stop="">
  117. <text class="share-modal-title">分享到</text>
  118. <view class="share-modal-items">
  119. <view class="share-modal-item" @click="shareToWechat">
  120. <text class="share-modal-icon">💬</text>
  121. <text class="share-modal-label">微信好友</text>
  122. </view>
  123. <view class="share-modal-item" @click="shareToTimeline">
  124. <text class="share-modal-icon">📱</text>
  125. <text class="share-modal-label">朋友圈</text>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import { getArticleDetail, getFeaturedArticles, recordArticleRead } from '../../utils/api.js'
  134. var DIMENSION_MAP = {
  135. body: { label: '身', color: '#FF8C42', bgColor: 'rgba(255,140,66,0.1)' },
  136. mind: { label: '心', color: '#FF6B9D', bgColor: 'rgba(255,107,157,0.1)' },
  137. wisdom: { label: '智', color: '#6366F1', bgColor: 'rgba(99,102,241,0.1)' },
  138. action: { label: '行', color: '#10B981', bgColor: 'rgba(16,185,129,0.1)' },
  139. wealth: { label: '富', color: '#F59E0B', bgColor: 'rgba(245,158,11,0.1)' }
  140. }
  141. export default {
  142. data() {
  143. return {
  144. articleId: '',
  145. article: null,
  146. loading: true,
  147. error: false,
  148. errorMsg: '',
  149. tagList: [],
  150. dimensionList: [],
  151. relatedArticles: [],
  152. readingSeconds: 0,
  153. readingTimer: null,
  154. readRecorded: false,
  155. showShareModal: false,
  156. isFavorited: false
  157. }
  158. },
  159. onLoad(options) {
  160. if (options && options.id) {
  161. this.articleId = options.id
  162. this.token = uni.getStorageSync('token')
  163. this.baseUrl = this.token ? '' : ''
  164. this.loadDetail(options.id)
  165. this.startReadingTimer()
  166. } else {
  167. this.error = true
  168. this.errorMsg = '参数错误'
  169. this.loading = false
  170. }
  171. },
  172. onHide() {
  173. this.stopReadingTimer()
  174. },
  175. onUnload() {
  176. this.stopReadingTimer()
  177. },
  178. methods: {
  179. contentTypeLabel: function(type) {
  180. var labels = { article: '文章', knowledge: '知识点', course: '课程', tip: '贴士' }
  181. return labels[type] || type || ''
  182. },
  183. async loadDetail(id) {
  184. this.loading = true
  185. this.error = false
  186. try {
  187. const res = await getArticleDetail({ id: id })
  188. if (res.code === 200 && res.data) {
  189. this.article = res.data
  190. // 解析标签 JSON 字符串
  191. if (res.data.tags) {
  192. try {
  193. let parsed = JSON.parse(res.data.tags)
  194. this.tagList = Array.isArray(parsed) ? parsed : []
  195. } catch (e) {
  196. this.tagList = []
  197. }
  198. }
  199. // 解析维度 ID JSON
  200. if (res.data.dimensionIds) {
  201. try {
  202. var dimIds = JSON.parse(res.data.dimensionIds)
  203. if (Array.isArray(dimIds)) {
  204. this.dimensionList = dimIds.map(function(d) {
  205. return DIMENSION_MAP[d] || { label: d, color: '#64748B', bgColor: 'rgba(100,116,139,0.1)' }
  206. })
  207. }
  208. } catch (e) {
  209. this.dimensionList = []
  210. }
  211. }
  212. // 加载相关文章
  213. this.loadRelatedArticles()
  214. } else {
  215. this.error = true
  216. this.errorMsg = '文章不存在或无权限查看'
  217. }
  218. } catch (e) {
  219. this.error = true
  220. this.errorMsg = '加载失败,请稍后重试'
  221. } finally {
  222. this.loading = false
  223. }
  224. },
  225. async loadRelatedArticles() {
  226. try {
  227. var dimensionCode = null
  228. if (this.article && this.article.dimensionIds) {
  229. try {
  230. var dimIds = JSON.parse(this.article.dimensionIds)
  231. if (Array.isArray(dimIds) && dimIds.length > 0) {
  232. dimensionCode = dimIds[0]
  233. }
  234. } catch (e) {}
  235. }
  236. var params = { size: 3 }
  237. if (dimensionCode) {
  238. params.dimensionCode = dimensionCode
  239. }
  240. const res = await getFeaturedArticles(params)
  241. if (res.code === 200 && res.data) {
  242. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  243. // 排除当前文章
  244. this.relatedArticles = list.filter(function(item) {
  245. return item.id !== (this.article && this.article.id)
  246. }.bind(this)).slice(0, 3)
  247. }
  248. } catch (e) {
  249. // 静默处理
  250. }
  251. },
  252. getFormattedDate() {
  253. if (this.article && this.article.publishedAt) {
  254. return this.article.publishedAt.slice(0, 10)
  255. }
  256. return ''
  257. },
  258. startReadingTimer() {
  259. var self = this
  260. this.readingTimer = setInterval(function() {
  261. self.readingSeconds = self.readingSeconds + 1
  262. }, 1000)
  263. },
  264. stopReadingTimer() {
  265. if (this.readingTimer) {
  266. clearInterval(this.readingTimer)
  267. this.readingTimer = null
  268. }
  269. },
  270. formatTime(seconds) {
  271. var m = Math.floor(seconds / 60)
  272. var s = seconds % 60
  273. return (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s)
  274. },
  275. toggleFavorite: function() {
  276. this.isFavorited = !this.isFavorited
  277. uni.showToast({ title: this.isFavorited ? '已收藏' : '已取消收藏', icon: 'none' })
  278. },
  279. handleShare: function() {
  280. var self = this
  281. uni.showActionSheet({
  282. itemList: ['微信好友', '朋友圈', '保存图片'],
  283. success: function(res) {
  284. var channel = 'wechat'
  285. if (res.tapIndex === 1) channel = 'friend'
  286. uni.request({
  287. url: self.baseUrl + '/api/share/create',
  288. method: 'POST',
  289. header: { 'Authorization': 'Bearer ' + self.token },
  290. data: {
  291. targetType: 'article',
  292. targetId: self.articleId,
  293. shareChannel: channel,
  294. title: self.article && self.article.title ? self.article.title : ''
  295. },
  296. success: function(createRes) {
  297. if (createRes.data && createRes.data.code === 200) {
  298. var shareEvent = createRes.data.data
  299. uni.showToast({ title: '分享成功', icon: 'success' })
  300. uni.request({
  301. url: self.baseUrl + '/api/share/click',
  302. method: 'POST',
  303. header: { 'Authorization': 'Bearer ' + self.token },
  304. data: { shareEventId: shareEvent.id }
  305. })
  306. self.showShareModal = true
  307. }
  308. }
  309. })
  310. }
  311. })
  312. },
  313. shareToWechat: function() {
  314. this.showShareModal = false
  315. uni.showToast({ title: '请使用微信分享', icon: 'none' })
  316. },
  317. shareToTimeline: function() {
  318. this.showShareModal = false
  319. uni.showToast({ title: '请使用微信朋友圈', icon: 'none' })
  320. },
  321. async onReadComplete() {
  322. if (this.readRecorded) {
  323. uni.navigateBack()
  324. return
  325. }
  326. this.stopReadingTimer()
  327. try {
  328. var childId = uni.getStorageSync('currentChildId')
  329. var res = await recordArticleRead({
  330. id: this.article.id,
  331. durationSeconds: this.readingSeconds,
  332. childId: childId || undefined
  333. })
  334. this.readRecorded = true
  335. if (res.data && res.data.pointsEarned > 0) {
  336. uni.showToast({ title: '获得' + res.data.pointsEarned + '积分!', icon: 'success' })
  337. } else if (res.data && res.data.belowThreshold) {
  338. uni.showToast({ title: '阅读时间未达标', icon: 'none' })
  339. } else if (res.data && res.data.alreadyCompleted) {
  340. uni.showToast({ title: '已读过此文', icon: 'none' })
  341. } else {
  342. uni.showToast({ title: '阅读记录已保存', icon: 'success' })
  343. }
  344. } catch (e) {
  345. uni.showToast({ title: '记录保存失败', icon: 'none' })
  346. }
  347. var self = this
  348. setTimeout(function() {
  349. uni.navigateBack()
  350. }, 1500)
  351. },
  352. goRelatedArticle: function(id) {
  353. uni.redirectTo({ url: '/pages/mind/article-detail?id=' + id })
  354. }
  355. }
  356. }
  357. </script>
  358. <style scoped>
  359. .detail-container {
  360. min-height: 100vh;
  361. background: #fff;
  362. padding-bottom: 120rpx;
  363. }
  364. /* ===== 加载状态 ===== */
  365. .loading-wrap {
  366. display: flex;
  367. flex-direction: column;
  368. align-items: center;
  369. justify-content: center;
  370. padding-top: 300rpx;
  371. }
  372. .loading-spinner {
  373. width: 60rpx;
  374. height: 60rpx;
  375. border: 4rpx solid #e0e0e0;
  376. border-top-color: #5B9BD5;
  377. border-radius: 50%;
  378. animation: spin 0.8s linear infinite;
  379. margin-bottom: 20rpx;
  380. }
  381. @keyframes spin {
  382. 0% { transform: rotate(0deg); }
  383. 100% { transform: rotate(360deg); }
  384. }
  385. .loading-text {
  386. font-size: 26rpx;
  387. color: #999;
  388. }
  389. /* ===== 错误状态 ===== */
  390. .error-wrap {
  391. display: flex;
  392. flex-direction: column;
  393. align-items: center;
  394. padding-top: 300rpx;
  395. }
  396. .error-icon {
  397. font-size: 100rpx;
  398. margin-bottom: 24rpx;
  399. }
  400. .error-text {
  401. font-size: 28rpx;
  402. color: #999;
  403. margin-bottom: 30rpx;
  404. }
  405. .retry-btn {
  406. width: 240rpx;
  407. height: 72rpx;
  408. line-height: 72rpx;
  409. background: #5B9BD5;
  410. color: #fff;
  411. font-size: 28rpx;
  412. border-radius: 36rpx;
  413. text-align: center;
  414. border: none;
  415. }
  416. .retry-btn::after {
  417. border: none;
  418. }
  419. /* ===== 内容区 ===== */
  420. .detail-cover {
  421. width: 100%;
  422. max-height: 500rpx;
  423. display: block;
  424. }
  425. .detail-title {
  426. display: block;
  427. font-size: 36rpx;
  428. font-weight: bold;
  429. color: #333;
  430. line-height: 1.4;
  431. padding: 30rpx 30rpx 0;
  432. }
  433. /* ===== 元信息 ===== */
  434. .detail-meta {
  435. display: flex;
  436. flex-direction: row;
  437. align-items: center;
  438. padding: 16rpx 30rpx 0;
  439. font-size: 22rpx;
  440. color: #999;
  441. }
  442. .meta-author {
  443. color: #5B9BD5;
  444. }
  445. .meta-separator {
  446. margin: 0 12rpx;
  447. color: #ddd;
  448. }
  449. .meta-date,
  450. .meta-read {
  451. color: #999;
  452. }
  453. /* ===== 分类标签 ===== */
  454. .detail-category-row {
  455. padding: 16rpx 30rpx 0;
  456. display: flex;
  457. align-items: center;
  458. gap: 12rpx;
  459. flex-wrap: wrap;
  460. }
  461. .detail-category {
  462. display: inline-block;
  463. font-size: 20rpx;
  464. color: #5B9BD5;
  465. background: rgba(91, 155, 213, 0.1);
  466. padding: 4rpx 16rpx;
  467. border-radius: 8rpx;
  468. }
  469. .detail-type-badge {
  470. display: inline-block;
  471. font-size: 18rpx;
  472. padding: 2rpx 12rpx;
  473. border-radius: 6rpx;
  474. background: #f0f0f0;
  475. color: #666;
  476. }
  477. .detail-type-badge.type-article {
  478. background: #e8f4fd;
  479. color: #2b7fc4;
  480. }
  481. .detail-type-badge.type-knowledge {
  482. background: #e8f8ee;
  483. color: #2a9055;
  484. }
  485. .detail-type-badge.type-course {
  486. background: #fef3e2;
  487. color: #c47a2b;
  488. }
  489. .detail-type-badge.type-tip {
  490. background: #f3e8fd;
  491. color: #7b2bc4;
  492. }
  493. .detail-difficulty {
  494. font-size: 18rpx;
  495. color: #f59e0b;
  496. margin-left: 4rpx;
  497. }
  498. /* ===== 维度标签 ===== */
  499. .detail-dimensions {
  500. display: flex;
  501. flex-direction: row;
  502. padding: 8rpx 30rpx 0;
  503. gap: 10rpx;
  504. }
  505. .dimension-tag {
  506. font-size: 18rpx;
  507. padding: 2rpx 14rpx;
  508. border-radius: 6rpx;
  509. }
  510. /* ===== 标签 ===== */
  511. .detail-tags {
  512. display: flex;
  513. flex-direction: row;
  514. flex-wrap: wrap;
  515. padding: 12rpx 30rpx 0;
  516. gap: 12rpx;
  517. }
  518. .tag-item {
  519. font-size: 20rpx;
  520. color: #8B5CF6;
  521. background: rgba(139, 92, 246, 0.08);
  522. padding: 4rpx 14rpx;
  523. border-radius: 8rpx;
  524. }
  525. /* ===== 分割线 ===== */
  526. .divider {
  527. height: 1rpx;
  528. background: #eee;
  529. margin: 24rpx 30rpx;
  530. }
  531. /* ===== 正文 ===== */
  532. .detail-body {
  533. padding: 0 30rpx;
  534. font-size: 28rpx;
  535. color: #444;
  536. line-height: 1.8;
  537. }
  538. .detail-body rich-text {
  539. word-break: break-word;
  540. }
  541. /* ===== 定时器 ===== */
  542. .reading-timer {
  543. display: flex;
  544. flex-direction: row;
  545. align-items: center;
  546. justify-content: center;
  547. padding: 16rpx 0 20rpx;
  548. }
  549. .timer-icon {
  550. font-size: 32rpx;
  551. margin-right: 8rpx;
  552. }
  553. .timer-text {
  554. font-size: 32rpx;
  555. font-weight: bold;
  556. color: #333;
  557. margin-right: 16rpx;
  558. }
  559. .timer-hint {
  560. font-size: 22rpx;
  561. color: #999;
  562. }
  563. .timer-ready {
  564. color: #22c55e;
  565. font-weight: bold;
  566. }
  567. /* ===== 底部按钮 ===== */
  568. .detail-footer {
  569. padding: 40rpx 60rpx;
  570. }
  571. .read-btn {
  572. width: 100%;
  573. height: 88rpx;
  574. line-height: 88rpx;
  575. background: #ddd;
  576. color: #fff;
  577. font-size: 32rpx;
  578. font-weight: bold;
  579. border-radius: 44rpx;
  580. text-align: center;
  581. border: none;
  582. transition: background 0.3s;
  583. }
  584. .read-btn-active {
  585. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  586. }
  587. .read-btn::after {
  588. border: none;
  589. }
  590. /* ===== 操作栏 ===== */
  591. .action-bar {
  592. display: flex;
  593. flex-direction: row;
  594. justify-content: space-around;
  595. padding: 24rpx 30rpx;
  596. border-bottom: 1rpx solid #eee;
  597. }
  598. .action-btn {
  599. display: flex;
  600. flex-direction: column;
  601. align-items: center;
  602. padding: 8rpx 24rpx;
  603. }
  604. .action-icon {
  605. font-size: 36rpx;
  606. margin-bottom: 6rpx;
  607. }
  608. .action-text {
  609. font-size: 22rpx;
  610. color: #666;
  611. }
  612. /* ===== 相关推荐 ===== */
  613. .related-section {
  614. padding: 30rpx;
  615. }
  616. .related-header {
  617. margin-bottom: 20rpx;
  618. }
  619. .related-title {
  620. font-size: 30rpx;
  621. font-weight: bold;
  622. color: #333;
  623. }
  624. .related-list {
  625. display: flex;
  626. flex-direction: column;
  627. gap: 20rpx;
  628. }
  629. .related-card {
  630. display: flex;
  631. flex-direction: row;
  632. background: #fff;
  633. border-radius: 16rpx;
  634. overflow: hidden;
  635. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  636. }
  637. .related-cover {
  638. width: 180rpx;
  639. height: 140rpx;
  640. flex-shrink: 0;
  641. background: linear-gradient(135deg, #667eea, #764ba2);
  642. }
  643. .related-info {
  644. flex: 1;
  645. padding: 16rpx;
  646. display: flex;
  647. flex-direction: column;
  648. justify-content: center;
  649. }
  650. .related-name {
  651. font-size: 26rpx;
  652. font-weight: bold;
  653. color: #333;
  654. display: -webkit-box;
  655. -webkit-line-clamp: 2;
  656. -webkit-box-orient: vertical;
  657. overflow: hidden;
  658. margin-bottom: 8rpx;
  659. }
  660. .related-summary {
  661. font-size: 22rpx;
  662. color: #999;
  663. display: -webkit-box;
  664. -webkit-line-clamp: 1;
  665. -webkit-box-orient: vertical;
  666. overflow: hidden;
  667. }
  668. }
  669. .share-btn::after {
  670. border: none;
  671. }
  672. /* ===== 分享弹窗 ===== */
  673. .modal-mask {
  674. position: fixed;
  675. top: 0;
  676. left: 0;
  677. right: 0;
  678. bottom: 0;
  679. background: rgba(0, 0, 0, 0.5);
  680. display: flex;
  681. flex-direction: column;
  682. justify-content: flex-end;
  683. z-index: 1000;
  684. }
  685. .share-modal {
  686. background: #fff;
  687. border-radius: 24rpx 24rpx 0 0;
  688. padding: 40rpx;
  689. }
  690. .share-modal-title {
  691. display: block;
  692. text-align: center;
  693. font-size: 32rpx;
  694. font-weight: bold;
  695. margin-bottom: 32rpx;
  696. }
  697. .share-modal-items {
  698. display: flex;
  699. justify-content: space-around;
  700. }
  701. .share-modal-item {
  702. display: flex;
  703. flex-direction: column;
  704. align-items: center;
  705. }
  706. .share-modal-icon {
  707. font-size: 48rpx;
  708. margin-bottom: 12rpx;
  709. }
  710. .share-modal-label {
  711. font-size: 24rpx;
  712. color: #64748B;
  713. }
  714. </style>