index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. <template>
  2. <view class="plaza-page">
  3. <!-- 顶部标题栏 -->
  4. <view class="header">
  5. <view class="header-background">
  6. <view class="feather feather-left">🪶</view>
  7. <view class="feather feather-right">🪶</view>
  8. </view>
  9. <view class="header-content">
  10. <text class="header-subtitle">两只羽毛</text>
  11. <text class="header-title">💕 缘分广场</text>
  12. <text class="header-desc">两只羽毛相遇,编织爱情故事</text>
  13. </view>
  14. </view>
  15. <!-- 动态列表 -->
  16. <scroll-view
  17. class="dynamic-list"
  18. scroll-y
  19. @scrolltolower="loadMore"
  20. refresher-enabled
  21. :refresher-triggered="refreshing"
  22. @refresherrefresh="onRefresh"
  23. >
  24. <!-- 列表内容 -->
  25. <view class="list-content">
  26. <!-- 动态卡片 -->
  27. <view
  28. v-for="item in dynamicList"
  29. :key="item.dynamicId"
  30. class="dynamic-card"
  31. @click="goToDetail(item.dynamicId)"
  32. @longpress="showReportMenu(item)"
  33. >
  34. <!-- 用户信息 -->
  35. <view class="user-info">
  36. <image
  37. :src="getAvatar(item)"
  38. class="avatar"
  39. mode="aspectFill"
  40. ></image>
  41. <view class="user-details">
  42. <text class="nickname">{{ getNickname(item) }}</text>
  43. <text class="time">{{ formatTime(item.createdAt) }}</text>
  44. </view>
  45. </view>
  46. <!-- 动态内容 -->
  47. <view class="dynamic-content">
  48. <text class="content-text">{{ item.content }}</text>
  49. </view>
  50. <!-- 媒体内容(图片) -->
  51. <view v-if="item.mediaUrls && item.mediaUrls.length > 0" class="media-container">
  52. <view
  53. :class="['image-grid', getGridClass(item)]"
  54. >
  55. <image
  56. v-for="(url, index) in item.mediaUrls.slice(0, 9)"
  57. :key="index"
  58. :src="url"
  59. class="media-image"
  60. mode="aspectFill"
  61. @click.stop="previewImage(item.mediaUrls, index)"
  62. ></image>
  63. </view>
  64. </view>
  65. <!-- 互动栏 -->
  66. <view class="action-bar">
  67. <view class="action-item" @click.stop="handleLike(item)">
  68. <text :class="['icon', item.isLiked ? 'icon-liked' : '']">
  69. {{ item.isLiked ? '❤️' : '🤍' }}
  70. </text>
  71. <text class="action-text">{{ item.likeCount || 0 }}</text>
  72. </view>
  73. <view class="action-item">
  74. <text class="icon">💬</text>
  75. <text class="action-text">{{ item.commentCount || 0 }}</text>
  76. </view>
  77. <view class="action-item" @click.stop="handleFavorite(item)">
  78. <text :class="['icon', item.isFavorited ? 'icon-favorited' : '']">
  79. {{ item.isFavorited ? '⭐' : '☆' }}
  80. </text>
  81. <text class="action-text">{{ item.favoriteCount || 0 }}</text>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 加载提示 -->
  86. <view class="loading-tip" v-if="loading">
  87. <text>加载中...</text>
  88. </view>
  89. <!-- 没有更多数据 -->
  90. <view class="loading-tip" v-if="noMore && dynamicList.length > 0">
  91. <text>没有更多了~</text>
  92. </view>
  93. <!-- 空状态 -->
  94. <view class="empty-state" v-if="!loading && dynamicList.length === 0">
  95. <view class="empty-feathers">
  96. <text class="feather-icon">🪶</text>
  97. <text class="feather-icon">🪶</text>
  98. </view>
  99. <text class="empty-text">还没有缘分动态</text>
  100. <text class="empty-hint">快来分享你的美好时光,遇见有趣的灵魂吧~</text>
  101. <view class="empty-action" @click="goToPublish">
  102. <text>💕 发布第一条动态</text>
  103. </view>
  104. </view>
  105. </view>
  106. </scroll-view>
  107. <!-- 发布按钮 -->
  108. <view class="publish-btn" @click="goToPublish">
  109. <view class="publish-bg">
  110. <text class="publish-icon">💕</text>
  111. <text class="publish-text">分享心动</text>
  112. </view>
  113. </view>
  114. <!-- 举报菜单弹窗 -->
  115. <view v-if="showMenu" class="report-menu-popup">
  116. <view class="menu-mask" @click="hideReportMenu"></view>
  117. <view class="menu-content">
  118. <view class="menu-item" @click="handleReport">
  119. <text class="menu-icon">🚩</text>
  120. <text class="menu-text">举报此动态</text>
  121. </view>
  122. <view class="menu-item cancel" @click="hideReportMenu">
  123. <text class="menu-text">取消</text>
  124. </view>
  125. </view>
  126. </view>
  127. <!-- 底部导航栏 -->
  128. <view class="tabbar">
  129. <view class="tabbar-item" @click="switchTab('index')">
  130. <text class="tabbar-icon">🏠</text>
  131. <text class="tabbar-text">首页</text>
  132. </view>
  133. <view class="tabbar-item active" @click="switchTab('plaza')">
  134. <text class="tabbar-icon">💕</text>
  135. <text class="tabbar-text">动态</text>
  136. </view>
  137. <view class="tabbar-item" @click="switchTab('recommend')">
  138. <text class="tabbar-icon">👍</text>
  139. <text class="tabbar-text">推荐</text>
  140. </view>
  141. <view class="tabbar-item" @click="switchTab('message')">
  142. <text class="tabbar-icon">💬</text>
  143. <text class="tabbar-text">消息</text>
  144. </view>
  145. <view class="tabbar-item" @click="switchTab('mine')">
  146. <text class="tabbar-icon">👤</text>
  147. <text class="tabbar-text">我的</text>
  148. </view>
  149. </view>
  150. </view>
  151. </template>
  152. <script>
  153. import api from '@/utils/api.js'
  154. export default {
  155. data() {
  156. return {
  157. dynamicList: [],
  158. pageNum: 1,
  159. pageSize: 10,
  160. loading: false,
  161. refreshing: false,
  162. noMore: false,
  163. showMenu: false, // 显示举报菜单
  164. selectedDynamic: null, // 选中的动态
  165. currentUserId: 1, // 当前用户ID,实际应从存储获取
  166. defaultAvatar: 'https://via.placeholder.com/100x100.png?text=头像',
  167. likingMap: {}, // 记录正在点赞的动态ID,防止重复点击
  168. favoritingMap: {} // 记录正在收藏的动态ID,防止重复点击
  169. }
  170. },
  171. onLoad() {
  172. this.loadDynamicList()
  173. // 监听详情页更新事件,实时同步点赞/收藏状态
  174. uni.$on('dynamic-updated', (payload) => {
  175. if (!payload || !payload.dynamicId) return
  176. const idx = this.dynamicList.findIndex(x => x.dynamicId === payload.dynamicId)
  177. if (idx !== -1) {
  178. const item = this.dynamicList[idx]
  179. if (payload.hasOwnProperty('isLiked')) item.isLiked = payload.isLiked
  180. if (payload.hasOwnProperty('likeCount')) item.likeCount = payload.likeCount
  181. if (payload.hasOwnProperty('isFavorited')) item.isFavorited = payload.isFavorited
  182. if (payload.hasOwnProperty('favoriteCount')) item.favoriteCount = payload.favoriteCount
  183. this.$set(this.dynamicList, idx, item)
  184. }
  185. })
  186. // 监听发布页插入新动态
  187. uni.$on('dynamic-insert', (d) => {
  188. if (!d) return
  189. // 仅在第一页顶部插入
  190. this.dynamicList = [d, ...this.dynamicList]
  191. })
  192. },
  193. onShow() {
  194. // 返回列表页时自动刷新,确保状态一致
  195. this.pageNum = 1
  196. this.noMore = false
  197. this.dynamicList = []
  198. this.loadDynamicList()
  199. },
  200. methods: {
  201. // 兼容WXML:获取头像
  202. getAvatar(item) {
  203. if (item && item.user && item.user.avatarUrl) {
  204. return item.user.avatarUrl
  205. }
  206. return this.defaultAvatar
  207. },
  208. // 兼容WXML:获取昵称
  209. getNickname(item) {
  210. if (item && item.user && item.user.nickname) {
  211. return item.user.nickname
  212. }
  213. return '匿名用户'
  214. },
  215. // 兼容WXML:图片栅格class
  216. getGridClass(item) {
  217. const len = (item && item.mediaUrls && item.mediaUrls.length) ? item.mediaUrls.length : 0
  218. const n = Math.min(len, 3)
  219. return 'grid-' + n
  220. },
  221. // 加载动态列表
  222. async loadDynamicList() {
  223. if (this.loading || this.noMore) return
  224. this.loading = true
  225. try {
  226. const res = await api.dynamic.getRecommendList({
  227. pageNum: this.pageNum,
  228. pageSize: this.pageSize,
  229. userId: this.currentUserId
  230. })
  231. if (res && res.records) {
  232. // 处理数据
  233. const newData = res.records.map(item => ({
  234. ...item,
  235. isLiked: item.isLiked || false,
  236. isFavorited: item.isFavorited || false
  237. }))
  238. if (this.pageNum === 1) {
  239. this.dynamicList = newData
  240. } else {
  241. this.dynamicList = [...this.dynamicList, ...newData]
  242. }
  243. // 判断是否还有更多数据
  244. if (res.current >= res.pages) {
  245. this.noMore = true
  246. } else {
  247. this.pageNum++
  248. }
  249. }
  250. } catch (error) {
  251. console.error('加载动态列表失败:', error)
  252. uni.showToast({
  253. title: '加载失败',
  254. icon: 'none'
  255. })
  256. } finally {
  257. this.loading = false
  258. this.refreshing = false
  259. }
  260. },
  261. // 下拉刷新
  262. onRefresh() {
  263. this.refreshing = true
  264. this.pageNum = 1
  265. this.noMore = false
  266. this.dynamicList = []
  267. this.loadDynamicList()
  268. },
  269. // 上拉加载更多
  270. loadMore() {
  271. if (!this.noMore && !this.loading) {
  272. this.loadDynamicList()
  273. }
  274. },
  275. // 处理点赞
  276. async handleLike(item) {
  277. // 防止重复点击:如果正在处理该动态的点赞请求,直接返回
  278. if (this.likingMap[item.dynamicId]) {
  279. return
  280. }
  281. try {
  282. // 标记为正在处理
  283. this.$set(this.likingMap, item.dynamicId, true)
  284. const isLiked = item.isLiked
  285. const originalCount = item.likeCount || 0
  286. // 立即更新UI(乐观更新)
  287. item.isLiked = !isLiked
  288. item.likeCount = isLiked ? Math.max(0, originalCount - 1) : originalCount + 1
  289. // 发送请求
  290. if (isLiked) {
  291. // 取消点赞
  292. await api.dynamic.unlike(item.dynamicId)
  293. } else {
  294. // 点赞
  295. await api.dynamic.like(item.dynamicId)
  296. }
  297. } catch (error) {
  298. console.error('点赞操作失败:', error)
  299. // 请求失败,恢复原状态
  300. item.isLiked = !item.isLiked
  301. item.likeCount = item.isLiked ? (item.likeCount || 0) + 1 : Math.max(0, (item.likeCount || 0) - 1)
  302. uni.showToast({
  303. title: '操作失败,请重试',
  304. icon: 'none'
  305. })
  306. } finally {
  307. // 延迟300毫秒后释放锁,防止快速点击
  308. setTimeout(() => {
  309. this.$set(this.likingMap, item.dynamicId, false)
  310. }, 300)
  311. }
  312. },
  313. // 处理收藏
  314. async handleFavorite(item) {
  315. // 防止重复点击:如果正在处理该动态的收藏请求,直接返回
  316. if (this.favoritingMap[item.dynamicId]) {
  317. return
  318. }
  319. try {
  320. // 标记为正在处理
  321. this.$set(this.favoritingMap, item.dynamicId, true)
  322. const isFavorited = item.isFavorited
  323. const originalCount = item.favoriteCount || 0
  324. // 立即更新UI(乐观更新)
  325. item.isFavorited = !isFavorited
  326. item.favoriteCount = isFavorited ? Math.max(0, originalCount - 1) : originalCount + 1
  327. if (isFavorited) {
  328. // 取消收藏
  329. await api.dynamic.unfavorite(item.dynamicId)
  330. } else {
  331. // 收藏
  332. await api.dynamic.favorite(item.dynamicId)
  333. uni.showToast({
  334. title: '收藏成功',
  335. icon: 'success'
  336. })
  337. }
  338. } catch (error) {
  339. console.error('收藏操作失败:', error)
  340. // 请求失败,恢复原状态
  341. item.isFavorited = !item.isFavorited
  342. item.favoriteCount = item.isFavorited ? (item.favoriteCount || 0) + 1 : Math.max(0, (item.favoriteCount || 0) - 1)
  343. uni.showToast({
  344. title: '操作失败,请重试',
  345. icon: 'none'
  346. })
  347. } finally {
  348. // 延迟300毫秒后释放锁,防止快速点击
  349. setTimeout(() => {
  350. this.$set(this.favoritingMap, item.dynamicId, false)
  351. }, 300)
  352. }
  353. },
  354. // 预览图片
  355. previewImage(urls, current) {
  356. uni.previewImage({
  357. urls: urls,
  358. current: current
  359. })
  360. },
  361. // 跳转到详情页
  362. goToDetail(dynamicId) {
  363. uni.navigateTo({
  364. url: `/pages/plaza/detail?id=${dynamicId}`
  365. })
  366. },
  367. // 跳转到发布页
  368. goToPublish() {
  369. uni.navigateTo({
  370. url: '/pages/plaza/publish'
  371. })
  372. },
  373. // 显示举报菜单
  374. showReportMenu(item) {
  375. // 震动反馈
  376. uni.vibrateShort({
  377. type: 'light'
  378. })
  379. this.selectedDynamic = item
  380. this.showMenu = true
  381. },
  382. // 隐藏举报菜单
  383. hideReportMenu() {
  384. this.showMenu = false
  385. this.selectedDynamic = null
  386. },
  387. // 处理举报
  388. handleReport() {
  389. this.hideReportMenu()
  390. if (!this.selectedDynamic || !this.selectedDynamic.dynamicId) {
  391. uni.showToast({
  392. title: '动态ID不存在',
  393. icon: 'none'
  394. })
  395. return
  396. }
  397. // 跳转到举报页面
  398. uni.navigateTo({
  399. url: `/pages/plaza/report?id=${this.selectedDynamic.dynamicId}`
  400. })
  401. },
  402. // 格式化时间
  403. formatTime(timeStr) {
  404. if (!timeStr) return ''
  405. const time = new Date(timeStr)
  406. const now = new Date()
  407. const diff = now - time
  408. // 1分钟内
  409. if (diff < 60000) {
  410. return '刚刚'
  411. }
  412. // 1小时内
  413. if (diff < 3600000) {
  414. return Math.floor(diff / 60000) + '分钟前'
  415. }
  416. // 24小时内
  417. if (diff < 86400000) {
  418. return Math.floor(diff / 3600000) + '小时前'
  419. }
  420. // 7天内
  421. if (diff < 604800000) {
  422. return Math.floor(diff / 86400000) + '天前'
  423. }
  424. // 超过7天显示日期
  425. const year = time.getFullYear()
  426. const month = String(time.getMonth() + 1).padStart(2, '0')
  427. const day = String(time.getDate()).padStart(2, '0')
  428. if (year === now.getFullYear()) {
  429. return `${month}-${day}`
  430. }
  431. return `${year}-${month}-${day}`
  432. },
  433. // 切换Tab
  434. switchTab(tab) {
  435. if (tab === 'plaza') return
  436. const tabPages = {
  437. index: '/pages/index/index',
  438. recommend: '/pages/recommend/index',
  439. message: '/pages/message/index',
  440. mine: '/pages/mine/index'
  441. }
  442. if (tabPages[tab]) {
  443. uni.redirectTo({
  444. url: tabPages[tab]
  445. })
  446. }
  447. }
  448. }
  449. }
  450. </script>
  451. <style lang="scss" scoped>
  452. .plaza-page {
  453. min-height: 100vh;
  454. background: #FFF0F5; // 淡淡粉色背景
  455. // 顶部标题栏
  456. .header {
  457. position: fixed;
  458. top: 0;
  459. left: 0;
  460. right: 0;
  461. height: 88rpx; // 更紧凑,减小头部占用
  462. background: transparent; // 移除重色背景,突出可爱风淡粉
  463. display: flex;
  464. flex-direction: column;
  465. align-items: center;
  466. justify-content: center;
  467. padding-top: 0; // 移除顶部安全区额外留白
  468. z-index: 999;
  469. box-shadow: none;
  470. overflow: visible;
  471. position: relative;
  472. .header-background { display: none; }
  473. .header-content {
  474. text-align: center;
  475. z-index: 1;
  476. .header-subtitle {
  477. font-size: 22rpx;
  478. color: #E91E63;
  479. display: block;
  480. margin-bottom: 8rpx;
  481. letter-spacing: 2rpx;
  482. }
  483. .header-title {
  484. font-size: 36rpx;
  485. font-weight: 700;
  486. color: #D81B60;
  487. text-shadow: none;
  488. display: block;
  489. margin-bottom: 2rpx; // 缩小标题与描述间距
  490. }
  491. .header-desc {
  492. font-size: 20rpx;
  493. color: #AD1457;
  494. display: block;
  495. letter-spacing: 1rpx;
  496. }
  497. }
  498. }
  499. // 动态列表
  500. .dynamic-list {
  501. margin-top: 88rpx; // 同步减少顶部外边距
  502. padding-bottom: 120rpx;
  503. height: calc(100vh - 88rpx);
  504. .list-content {
  505. padding: 12rpx; // 再收紧列表内边距
  506. }
  507. // 动态卡片
  508. .dynamic-card {
  509. background: #FFFFFF; // 纯白卡片
  510. border-radius: 20rpx;
  511. padding: 24rpx; // 收紧卡片内边距
  512. margin-bottom: 14rpx; // 卡片之间更紧凑
  513. box-shadow: 0 4rpx 12rpx rgba(233, 30, 99, 0.07);
  514. border: 1rpx solid rgba(255, 182, 193, 0.22);
  515. transition: all 0.3s ease;
  516. position: relative;
  517. overflow: hidden;
  518. // 用户信息
  519. .user-info {
  520. display: flex;
  521. align-items: center;
  522. margin-bottom: 24rpx;
  523. .avatar {
  524. width: 88rpx;
  525. height: 88rpx;
  526. border-radius: 50%;
  527. margin-right: 24rpx;
  528. border: 3rpx solid #FFB3BA;
  529. box-shadow: 0 4rpx 12rpx rgba(233, 30, 99, 0.2);
  530. }
  531. .user-details {
  532. flex: 1;
  533. .nickname {
  534. display: block;
  535. font-size: 30rpx;
  536. font-weight: 600;
  537. color: #2D1B69;
  538. margin-bottom: 8rpx;
  539. }
  540. .time {
  541. font-size: 24rpx;
  542. color: #8B5A96;
  543. opacity: 0.8;
  544. }
  545. }
  546. }
  547. // 动态内容
  548. .dynamic-content {
  549. margin-bottom: 20rpx;
  550. .content-text {
  551. font-size: 28rpx;
  552. line-height: 1.6;
  553. color: #333333;
  554. word-wrap: break-word;
  555. }
  556. }
  557. // 媒体容器
  558. .media-container {
  559. margin-bottom: 16rpx;
  560. .image-grid {
  561. display: grid;
  562. gap: 10rpx;
  563. &.grid-1 {
  564. grid-template-columns: 1fr;
  565. .media-image {
  566. height: 400rpx;
  567. border-radius: 12rpx;
  568. }
  569. }
  570. &.grid-2,
  571. &.grid-3 {
  572. grid-template-columns: repeat(3, 1fr);
  573. .media-image {
  574. height: 180rpx;
  575. border-radius: 12rpx;
  576. }
  577. }
  578. .media-image {
  579. width: 100%;
  580. background-color: #F5F5F5;
  581. }
  582. }
  583. }
  584. // 互动栏
  585. .action-bar {
  586. display: flex;
  587. align-items: center;
  588. padding-top: 20rpx;
  589. border-top: 1rpx solid #F5F5F5;
  590. .action-item {
  591. flex: 1;
  592. display: flex;
  593. align-items: center;
  594. justify-content: center;
  595. .icon {
  596. font-size: 40rpx;
  597. margin-right: 8rpx;
  598. &.icon-liked {
  599. animation: heartBeat 0.3s ease-in-out;
  600. }
  601. &.icon-favorited {
  602. animation: starShine 0.3s ease-in-out;
  603. }
  604. }
  605. .action-text {
  606. font-size: 24rpx;
  607. color: #666666;
  608. }
  609. }
  610. }
  611. }
  612. // 加载提示
  613. .loading-tip {
  614. text-align: center;
  615. padding: 40rpx 0;
  616. font-size: 24rpx;
  617. color: #999999;
  618. }
  619. // 空状态
  620. .empty-state {
  621. display: flex;
  622. flex-direction: column;
  623. align-items: center;
  624. justify-content: center;
  625. padding: 200rpx 60rpx;
  626. .empty-icon {
  627. font-size: 120rpx;
  628. margin-bottom: 30rpx;
  629. }
  630. .empty-text {
  631. font-size: 32rpx;
  632. color: #333333;
  633. margin-bottom: 16rpx;
  634. }
  635. .empty-hint {
  636. font-size: 24rpx;
  637. color: #999999;
  638. }
  639. }
  640. }
  641. // 发布按钮
  642. .publish-btn {
  643. position: fixed;
  644. bottom: 160rpx;
  645. right: 40rpx;
  646. z-index: 998;
  647. .publish-bg {
  648. width: 140rpx;
  649. height: 140rpx;
  650. background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 25%, #C2185B 50%, #FF8A95 75%, #FFB3BA 100%);
  651. border-radius: 50%;
  652. display: flex;
  653. flex-direction: column;
  654. align-items: center;
  655. justify-content: center;
  656. box-shadow: 0 12rpx 36rpx rgba(233, 30, 99, 0.5);
  657. transition: all 0.3s ease;
  658. border: 4rpx solid rgba(255, 255, 255, 0.8);
  659. animation: pulse-love 3s ease-in-out infinite;
  660. &:active {
  661. transform: scale(0.9);
  662. }
  663. .publish-icon {
  664. font-size: 42rpx;
  665. margin-bottom: 4rpx;
  666. }
  667. .publish-text {
  668. font-size: 18rpx;
  669. color: rgba(255, 255, 255, 0.9);
  670. font-weight: 500;
  671. letter-spacing: 1rpx;
  672. }
  673. }
  674. }
  675. // 举报菜单弹窗
  676. .report-menu-popup {
  677. position: fixed;
  678. top: 0;
  679. left: 0;
  680. right: 0;
  681. bottom: 0;
  682. z-index: 9998;
  683. .menu-mask {
  684. position: absolute;
  685. top: 0;
  686. left: 0;
  687. right: 0;
  688. bottom: 0;
  689. background-color: rgba(0, 0, 0, 0.5);
  690. }
  691. .menu-content {
  692. position: absolute;
  693. bottom: 0;
  694. left: 0;
  695. right: 0;
  696. background-color: #FFFFFF;
  697. border-radius: 30rpx 30rpx 0 0;
  698. padding: 20rpx 30rpx;
  699. padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
  700. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  701. animation: slideUp 0.3s ease;
  702. .menu-item {
  703. height: 100rpx;
  704. display: flex;
  705. align-items: center;
  706. justify-content: center;
  707. border-radius: 12rpx;
  708. margin-bottom: 16rpx;
  709. transition: background-color 0.3s ease;
  710. &:not(.cancel) {
  711. background: #FFF5F7;
  712. &:active {
  713. background: #FFE8EC;
  714. }
  715. }
  716. &.cancel {
  717. background: #F5F5F5;
  718. margin-top: 8rpx;
  719. &:active {
  720. background: #EEEEEE;
  721. }
  722. }
  723. .menu-icon {
  724. font-size: 36rpx;
  725. margin-right: 12rpx;
  726. }
  727. .menu-text {
  728. font-size: 30rpx;
  729. color: #333333;
  730. font-weight: 500;
  731. }
  732. }
  733. }
  734. }
  735. // 底部导航栏
  736. .tabbar {
  737. position: fixed;
  738. bottom: 0;
  739. left: 0;
  740. right: 0;
  741. display: flex;
  742. background-color: #FFFFFF;
  743. border-top: 1rpx solid #F0F0F0;
  744. padding-bottom: constant(safe-area-inset-bottom);
  745. padding-bottom: env(safe-area-inset-bottom);
  746. z-index: 999;
  747. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  748. .tabbar-item {
  749. flex: 1;
  750. display: flex;
  751. flex-direction: column;
  752. align-items: center;
  753. justify-content: center;
  754. padding: 15rpx 0;
  755. .tabbar-icon {
  756. font-size: 44rpx;
  757. margin-bottom: 5rpx;
  758. }
  759. .tabbar-text {
  760. font-size: 22rpx;
  761. color: #666666;
  762. }
  763. &.active {
  764. .tabbar-text {
  765. color: #E91E63;
  766. font-weight: bold;
  767. }
  768. }
  769. }
  770. }
  771. }
  772. // 动画
  773. @keyframes heartBeat {
  774. 0%, 100% {
  775. transform: scale(1);
  776. }
  777. 50% {
  778. transform: scale(1.2);
  779. }
  780. }
  781. @keyframes starShine {
  782. 0%, 100% {
  783. transform: scale(1) rotate(0deg);
  784. }
  785. 50% {
  786. transform: scale(1.2) rotate(15deg);
  787. }
  788. }
  789. @keyframes slideUp {
  790. from {
  791. transform: translateY(100%);
  792. }
  793. to {
  794. transform: translateY(0);
  795. }
  796. }
  797. </style>