index.vue 21 KB

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