| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982 |
- <template>
- <view class="plaza-page">
- <!-- 顶部标题栏 -->
- <view class="header">
- <view class="header-background">
- <view class="feather feather-left">🪶</view>
- <view class="feather feather-right">🪶</view>
- </view>
- <view class="header-content">
- <text class="header-title">💕 缘分广场</text>
- <text class="header-desc">两只羽毛相遇,编织爱情故事</text>
- </view>
- </view>
-
- <!-- 动态列表 -->
- <scroll-view
- class="dynamic-list"
- scroll-y
- @scrolltolower="loadMore"
- refresher-enabled
- :refresher-triggered="refreshing"
- @refresherrefresh="onRefresh"
- >
- <!-- 列表内容 -->
- <view class="list-content">
- <!-- 动态卡片 -->
- <view
- v-for="item in dynamicList"
- :key="item.dynamicId"
- class="dynamic-card"
- @click="goToDetail(item.dynamicId)"
- @longpress="showReportMenu(item)"
- >
- <!-- 用户信息 -->
- <view class="user-info">
- <image
- :src="getAvatar(item)"
- class="avatar"
- mode="aspectFill"
- ></image>
- <view class="user-details">
- <text class="nickname">{{ getNickname(item) }}</text>
- <text class="time">{{ formatTime(item.createdAt) }}</text>
- </view>
- </view>
-
- <!-- 动态内容 -->
- <view class="dynamic-content">
- <text class="content-text">{{ item.content }}</text>
- </view>
-
- <!-- 媒体内容(图片) -->
- <view v-if="item.mediaUrls && item.mediaUrls.length > 0" class="media-container">
- <view
- :class="['image-grid', getGridClass(item)]"
- >
- <image
- v-for="(url, index) in item.mediaUrls.slice(0, 9)"
- :key="index"
- :src="url"
- class="media-image"
- mode="aspectFill"
- @click.stop="previewImage(item.mediaUrls, index)"
- ></image>
- </view>
- </view>
-
- <!-- 互动栏 -->
- <view class="action-bar">
- <view class="action-item" @click.stop="handleLike(item)">
- <text :class="['icon', !!item.isLiked ? 'icon-liked' : '']">
- {{ !!item.isLiked ? '❤️' : '🤍' }}
- </text>
- <text class="action-text">{{ item.likeCount || 0 }}</text>
- </view>
-
- <view class="action-item">
- <text class="icon">💬</text>
- <text class="action-text">{{ item.commentCount || 0 }}</text>
- </view>
-
- <view class="action-item" @click.stop="handleFavorite(item)">
- <text :class="['icon', !!item.isFavorited ? 'icon-favorited' : '']">
- {{ !!item.isFavorited ? '⭐' : '☆' }}
- </text>
- <text class="action-text">{{ item.favoriteCount || 0 }}</text>
- </view>
- </view>
- </view>
-
- <!-- 加载提示 -->
- <view class="loading-tip" v-if="loading">
- <text>加载中...</text>
- </view>
-
- <!-- 没有更多数据 -->
- <view class="loading-tip" v-if="noMore && dynamicList.length > 0">
- <text>没有更多了~</text>
- </view>
-
- <!-- 空状态 -->
- <view class="empty-state" v-if="!loading && dynamicList.length === 0">
- <view class="empty-feathers">
- <text class="feather-icon">🪶</text>
- <text class="feather-icon">🪶</text>
- </view>
- <text class="empty-text">还没有缘分动态</text>
- <text class="empty-hint">快来分享你的美好时光,遇见有趣的灵魂吧~</text>
- <view class="empty-action" @click="goToPublish">
- <text>💕 发布第一条动态</text>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <!-- 发布按钮 -->
- <view class="publish-btn" @click="goToPublish">
- <view class="publish-bg">
- <text class="publish-icon">💕</text>
- <text class="publish-text">分享心动</text>
- </view>
- </view>
-
- <!-- 举报菜单弹窗 -->
- <view v-if="showMenu" class="report-menu-popup">
- <view class="menu-mask" @click="hideReportMenu"></view>
- <view class="menu-content">
- <view class="menu-item" @click="handleReport">
- <text class="menu-icon">🚩</text>
- <text class="menu-text">举报此动态</text>
- </view>
- <view class="menu-item cancel" @click="hideReportMenu">
- <text class="menu-text">取消</text>
- </view>
- </view>
- </view>
-
- <!-- 底部导航栏 -->
- <view class="tabbar">
- <view class="tabbar-item" @click="switchTab('index')">
- <text class="tabbar-icon">🏠</text>
- <text class="tabbar-text">首页</text>
- </view>
- <view class="tabbar-item active" @click="switchTab('plaza')">
- <text class="tabbar-icon">💕</text>
- <text class="tabbar-text">动态</text>
- </view>
- <view class="tabbar-item" @click="switchTab('recommend')">
- <text class="tabbar-icon">👍</text>
- <text class="tabbar-text">推荐</text>
- </view>
- <!-- <view class="tabbar-item" @click="switchTab('message')">
- <text class="tabbar-icon">💬</text>
- <text class="tabbar-text">消息</text>
- <view v-if="unreadCount > 0" class="tabbar-badge">{{ unreadCount }}</view>
- </view> -->
- <view class="tabbar-item" @click="switchTab('mine')">
- <text class="tabbar-icon">👤</text>
- <text class="tabbar-text">我的</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import api from '@/utils/api.js'
- export default {
- data() {
- return {
- dynamicList: [],
- pageNum: 1,
- pageSize: 10,
- loading: false,
- refreshing: false,
- noMore: false,
- showMenu: false, // 显示举报菜单
- selectedDynamic: null, // 选中的动态
- currentUserId: uni.getStorageInfoSync("userId"), // 当前用户ID,实际应从存储获取
- defaultAvatar: 'http://via.placeholder.com/100x100.png?text=头像',
- likingMap: {}, // 记录正在点赞的动态ID,防止重复点击
- favoritingMap: {} // 记录正在收藏的动态ID,防止重复点击
- }
- },
- computed: {
- unreadCount() {
- return this.$store.getters.getTotalUnread || 0;
- }
- },
- onLoad() {
- // 从存储中获取当前用户ID
- const storedUserId = uni.getStorageSync('userId')
- if (storedUserId !== null && storedUserId !== undefined && storedUserId !== '') {
- this.currentUserId = parseInt(storedUserId)
- } else {
- // 尝试从 userInfo 中获取
- const userInfo = uni.getStorageSync('userInfo')
- if (userInfo && (userInfo.userId || userInfo.id || userInfo.user_id)) {
- this.currentUserId = parseInt(userInfo.userId || userInfo.id || userInfo.user_id)
- } else {
- // 未登录,设置为 null
- this.currentUserId = null
- }
- }
- this.loadDynamicList()
- // 监听详情页更新事件,实时同步点赞/收藏状态
- uni.$on('dynamic-updated', (payload) => {
- if (!payload || !payload.dynamicId) return
- const idx = this.dynamicList.findIndex(x => x.dynamicId === payload.dynamicId)
- if (idx !== -1) {
- const item = this.dynamicList[idx]
- // 使用 hasOwnProperty 严格检查属性是否存在,只更新事件中明确包含的字段
- // 这样可以避免误更新不相关的字段(如点赞时误更新收藏状态)
- // 根据 dynamic_likes 表判断:有记录显示 ❤️,无记录显示 🤍
- if (payload.hasOwnProperty('isLiked') && payload.isLiked !== undefined && payload.isLiked !== null) {
- this.$set(item, 'isLiked', payload.isLiked === true || payload.isLiked === 1 || payload.isLiked === 'true' || payload.isLiked === '1')
- }
- if (payload.hasOwnProperty('likeCount') && payload.likeCount !== undefined && payload.likeCount !== null) {
- this.$set(item, 'likeCount', Number(payload.likeCount) || 0)
- }
- // 只有当 isFavorited 明确存在于 payload 中时才更新(避免误更新)
- // 根据 dynamic_favorites 表判断:有记录显示 ⭐,无记录显示 ☆
- if (payload.hasOwnProperty('isFavorited') && payload.isFavorited !== undefined && payload.isFavorited !== null) {
- this.$set(item, 'isFavorited', payload.isFavorited === true || payload.isFavorited === 1 || payload.isFavorited === 'true' || payload.isFavorited === '1')
- }
- if (payload.hasOwnProperty('favoriteCount') && payload.favoriteCount !== undefined && payload.favoriteCount !== null) {
- this.$set(item, 'favoriteCount', Number(payload.favoriteCount) || 0)
- }
- }
- })
- // 监听发布页插入新动态
- uni.$on('dynamic-insert', (d) => {
- if (!d) return
- // 仅在第一页顶部插入
- this.dynamicList = [d, ...this.dynamicList]
- })
- },
-
- onShow() {
- // 返回列表页时自动刷新,确保状态一致
- // 重新获取当前用户ID(可能在其他页面登录/登出)
- const storedUserId = uni.getStorageSync('userId')
- if (storedUserId !== null && storedUserId !== undefined && storedUserId !== '') {
- this.currentUserId = parseInt(storedUserId)
- } else {
- // 尝试从 userInfo 中获取
- const userInfo = uni.getStorageSync('userInfo')
- if (userInfo && (userInfo.userId || userInfo.id || userInfo.user_id)) {
- this.currentUserId = parseInt(userInfo.userId || userInfo.id || userInfo.user_id)
- } else {
- // 未登录,设置为 null
- this.currentUserId = null
- }
- }
- this.pageNum = 1
- this.noMore = false
- this.dynamicList = []
- this.loadDynamicList()
- },
-
- methods: {
- // 兼容WXML:获取头像
- getAvatar(item) {
- if (item && item.user && item.user.avatarUrl) {
- return item.user.avatarUrl
- }
- return this.defaultAvatar
- },
- // 兼容WXML:获取昵称
- getNickname(item) {
- if (item && item.user && item.user.nickname) {
- return item.user.nickname
- }
- return '匿名用户'
- },
- // 兼容WXML:图片栅格class
- getGridClass(item) {
- const len = (item && item.mediaUrls && item.mediaUrls.length) ? item.mediaUrls.length : 0
- const n = Math.min(len, 3)
- return 'grid-' + n
- },
- // 加载动态列表
- async loadDynamicList() {
- if (this.loading || this.noMore) return
-
- this.loading = true
-
- try {
- const res = await api.dynamic.getRecommendList({
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- userId: this.currentUserId
- })
-
- if (res && res.records) {
- // 处理数据,确保布尔值正确转换(根据 dynamic_likes 和 dynamic_favorites 表判断)
- // 后端返回的 isLiked 和 isFavorited 应该已经是 Boolean,但为了兼容性,确保正确转换
- const newData = res.records.map(item => ({
- ...item,
- // 如果 dynamic_likes 表中有记录,显示 ❤️,否则显示 🤍
- isLiked: item.isLiked === true || item.isLiked === 1 || item.isLiked === 'true' || item.isLiked === '1',
- // 如果 dynamic_favorites 表中有记录,显示 ⭐,否则显示 ☆
- isFavorited: item.isFavorited === true || item.isFavorited === 1 || item.isFavorited === 'true' || item.isFavorited === '1'
- }))
-
- if (this.pageNum === 1) {
- this.dynamicList = newData
- } else {
- this.dynamicList = [...this.dynamicList, ...newData]
- }
-
- // 判断是否还有更多数据
- if (res.current >= res.pages) {
- this.noMore = true
- } else {
- this.pageNum++
- }
- }
- } catch (error) {
- console.error('加载动态列表失败:', error)
- uni.showToast({
- title: '加载失败',
- icon: 'none'
- })
- } finally {
- this.loading = false
- this.refreshing = false
- }
- },
-
- // 下拉刷新
- onRefresh() {
- this.refreshing = true
- this.pageNum = 1
- this.noMore = false
- this.dynamicList = []
- this.loadDynamicList()
- },
-
- // 上拉加载更多
- loadMore() {
- if (!this.noMore && !this.loading) {
- this.loadDynamicList()
- }
- },
-
- // 处理点赞
- async handleLike(item) {
- // 防止重复点击:如果正在处理该动态的点赞请求,直接返回
- if (this.likingMap[item.dynamicId]) {
- return
- }
-
- try {
- // 标记为正在处理
- this.$set(this.likingMap, item.dynamicId, true)
-
- // 根据 dynamic_likes 表判断是否点赞(有记录显示 ❤️,无记录显示 🤍)
- const isLiked = item.isLiked === true || item.isLiked === 1 || item.isLiked === 'true' || item.isLiked === '1'
- const originalCount = item.likeCount || 0
- const newIsLiked = !isLiked
- const newLikeCount = isLiked ? Math.max(0, originalCount - 1) : originalCount + 1
-
- // 立即更新UI(乐观更新),使用 $set 确保响应式更新
- this.$set(item, 'isLiked', newIsLiked)
- this.$set(item, 'likeCount', newLikeCount)
-
- // 发送请求
- if (isLiked) {
- // 取消点赞
- await api.dynamic.unlike(item.dynamicId)
- } else {
- // 点赞
- await api.dynamic.like(item.dynamicId)
- }
- } catch (error) {
- console.error('点赞操作失败:', error)
- // 请求失败,恢复原状态
- const currentIsLiked = item.isLiked === true || item.isLiked === 1 || item.isLiked === 'true' || item.isLiked === '1'
- this.$set(item, 'isLiked', !currentIsLiked)
- this.$set(item, 'likeCount', !currentIsLiked ? (item.likeCount || 0) + 1 : Math.max(0, (item.likeCount || 0) - 1))
- uni.showToast({
- title: '操作失败,请重试',
- icon: 'none'
- })
- } finally {
- // 延迟300毫秒后释放锁,防止快速点击
- setTimeout(() => {
- this.$set(this.likingMap, item.dynamicId, false)
- }, 300)
- }
- },
-
- // 处理收藏
- async handleFavorite(item) {
- // 防止重复点击:如果正在处理该动态的收藏请求,直接返回
- if (this.favoritingMap[item.dynamicId]) {
- return
- }
-
- try {
- // 标记为正在处理
- this.$set(this.favoritingMap, item.dynamicId, true)
-
- // 根据 dynamic_favorites 表判断是否收藏(有记录显示 ⭐,无记录显示 ☆)
- const isFavorited = item.isFavorited === true || item.isFavorited === 1 || item.isFavorited === 'true' || item.isFavorited === '1'
- const originalCount = item.favoriteCount || 0
- const newIsFavorited = !isFavorited
- const newFavoriteCount = isFavorited ? Math.max(0, originalCount - 1) : originalCount + 1
-
- // 立即更新UI(乐观更新),使用 $set 确保响应式更新
- this.$set(item, 'isFavorited', newIsFavorited)
- this.$set(item, 'favoriteCount', newFavoriteCount)
-
- if (isFavorited) {
- // 取消收藏
- await api.dynamic.unfavorite(item.dynamicId)
- } else {
- // 收藏
- await api.dynamic.favorite(item.dynamicId)
- uni.showToast({
- title: '收藏成功',
- icon: 'success'
- })
- }
- } catch (error) {
- console.error('收藏操作失败:', error)
- // 请求失败,恢复原状态
- const currentIsFavorited = item.isFavorited === true || item.isFavorited === 1 || item.isFavorited === 'true' || item.isFavorited === '1'
- this.$set(item, 'isFavorited', !currentIsFavorited)
- this.$set(item, 'favoriteCount', !currentIsFavorited ? (item.favoriteCount || 0) + 1 : Math.max(0, (item.favoriteCount || 0) - 1))
- uni.showToast({
- title: '操作失败,请重试',
- icon: 'none'
- })
- } finally {
- // 延迟300毫秒后释放锁,防止快速点击
- setTimeout(() => {
- this.$set(this.favoritingMap, item.dynamicId, false)
- }, 300)
- }
- },
-
- // 预览图片
- previewImage(urls, current) {
- uni.previewImage({
- urls: urls,
- current: current
- })
- },
-
- // 跳转到详情页
- goToDetail(dynamicId) {
- uni.navigateTo({
- url: `/pages/plaza/detail?id=${dynamicId}`
- })
- },
-
- // 跳转到发布页
- goToPublish() {
- console.log('点击了发布按钮');
- uni.navigateTo({
- url: '/pages/plaza/publish',
- fail: (err) => {
- console.error('跳转失败:', err);
- }
- })
- },
-
- // 显示举报菜单
- showReportMenu(item) {
- // 震动反馈
- uni.vibrateShort({
- type: 'light'
- })
- this.selectedDynamic = item
- this.showMenu = true
- },
-
- // 隐藏举报菜单
- hideReportMenu() {
- this.showMenu = false
- this.selectedDynamic = null
- },
-
- // 处理举报
- handleReport() {
- this.hideReportMenu()
- if (!this.selectedDynamic || !this.selectedDynamic.dynamicId) {
- uni.showToast({
- title: '动态ID不存在',
- icon: 'none'
- })
- return
- }
- // 跳转到举报页面
- uni.navigateTo({
- url: `/pages/plaza/report?id=${this.selectedDynamic.dynamicId}`
- })
- },
-
- // 格式化时间
- formatTime(timeStr) {
- if (!timeStr) return ''
-
- const time = new Date(timeStr)
- const now = new Date()
- const diff = now - time
-
- // 1分钟内
- if (diff < 60000) {
- return '刚刚'
- }
- // 1小时内
- if (diff < 3600000) {
- return Math.floor(diff / 60000) + '分钟前'
- }
- // 24小时内
- if (diff < 86400000) {
- return Math.floor(diff / 3600000) + '小时前'
- }
- // 7天内
- if (diff < 604800000) {
- return Math.floor(diff / 86400000) + '天前'
- }
-
- // 超过7天显示日期
- const year = time.getFullYear()
- const month = String(time.getMonth() + 1).padStart(2, '0')
- const day = String(time.getDate()).padStart(2, '0')
-
- if (year === now.getFullYear()) {
- return `${month}-${day}`
- }
- return `${year}-${month}-${day}`
- },
-
- // 切换Tab
- switchTab(tab) {
- if (tab === 'plaza') return
-
- const tabPages = {
- index: '/pages/index/index',
- recommend: '/pages/recommend/index',
- message: '/subpkg-message/index/index',
- mine: '/pages/mine/index'
- }
-
- if (tabPages[tab]) {
- uni.redirectTo({
- url: tabPages[tab]
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .plaza-page {
- padding-top: 60px;
- min-height: 100vh;
- background: #FFF0F5; // 淡淡粉色背景
-
-
- // 顶部标题栏
- .header {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- height: 88rpx; // 更紧凑,减小头部占用
- background: transparent; // 移除重色背景,突出可爱风淡粉
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding-top: 0; // 移除顶部安全区额外留白
- z-index: 999;
- box-shadow: none;
- overflow: visible;
- position: relative;
-
-
- .header-background { display: none; }
-
- .header-content {
- text-align: center;
- z-index: 1;
-
- .header-subtitle {
- font-size: 22rpx;
- color: #E91E63;
- display: block;
- margin-bottom: 8rpx;
- letter-spacing: 2rpx;
- }
-
- .header-title {
- font-size: 36rpx;
- font-weight: 700;
- color: #D81B60;
- text-shadow: none;
- display: block;
- margin-bottom: 2rpx; // 缩小标题与描述间距
- }
-
- .header-desc {
- font-size: 20rpx;
- color: #AD1457;
- display: block;
- letter-spacing: 1rpx;
- }
- }
- }
-
- // 动态列表
- .dynamic-list {
- margin-top: 88rpx; // 同步减少顶部外边距
- padding-bottom: 120rpx;
- height: calc(100vh - 88rpx);
-
- .list-content {
- padding: 12rpx; // 再收紧列表内边距
- }
-
- // 动态卡片
- .dynamic-card {
- background: #FFFFFF; // 纯白卡片
- border-radius: 20rpx;
- padding: 24rpx; // 收紧卡片内边距
- margin-bottom: 14rpx; // 卡片之间更紧凑
- box-shadow: 0 4rpx 12rpx rgba(233, 30, 99, 0.07);
- border: 1rpx solid rgba(255, 182, 193, 0.22);
- transition: all 0.3s ease;
- position: relative;
- overflow: hidden;
-
- // 用户信息
- .user-info {
- display: flex;
- align-items: center;
- margin-bottom: 24rpx;
-
- .avatar {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- margin-right: 24rpx;
- border: 3rpx solid #FFB3BA;
- box-shadow: 0 4rpx 12rpx rgba(233, 30, 99, 0.2);
- }
-
- .user-details {
- flex: 1;
-
- .nickname {
- display: block;
- font-size: 30rpx;
- font-weight: 600;
- color: #2D1B69;
- margin-bottom: 8rpx;
- }
-
- .time {
- font-size: 24rpx;
- color: #8B5A96;
- opacity: 0.8;
- }
- }
- }
-
- // 动态内容
- .dynamic-content {
- margin-bottom: 20rpx;
-
- .content-text {
- font-size: 28rpx;
- line-height: 1.6;
- color: #333333;
- word-wrap: break-word;
- }
- }
-
- // 媒体容器
- .media-container {
- margin-bottom: 16rpx;
-
- .image-grid {
- display: grid;
- gap: 10rpx;
-
- &.grid-1 {
- grid-template-columns: 1fr;
-
- .media-image {
- height: 400rpx;
- border-radius: 12rpx;
- }
- }
-
- &.grid-2,
- &.grid-3 {
- grid-template-columns: repeat(3, 1fr);
-
- .media-image {
- height: 180rpx;
- border-radius: 12rpx;
- }
- }
-
- .media-image {
- width: 100%;
- background-color: #F5F5F5;
- }
- }
- }
-
- // 互动栏
- .action-bar {
- display: flex;
- align-items: center;
- padding-top: 20rpx;
- border-top: 1rpx solid #F5F5F5;
-
- .action-item {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .icon {
- font-size: 40rpx;
- margin-right: 8rpx;
-
- &.icon-liked {
- animation: heartBeat 0.3s ease-in-out;
- }
-
- &.icon-favorited {
- animation: starShine 0.3s ease-in-out;
- }
- }
-
- .action-text {
- font-size: 24rpx;
- color: #666666;
- }
- }
- }
- }
-
- // 加载提示
- .loading-tip {
- text-align: center;
- padding: 40rpx 0;
- font-size: 24rpx;
- color: #999999;
- }
-
- // 空状态
- .empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 200rpx 60rpx;
-
- .empty-icon {
- font-size: 120rpx;
- margin-bottom: 30rpx;
- }
-
- .empty-text {
- font-size: 32rpx;
- color: #333333;
- margin-bottom: 16rpx;
- }
-
- .empty-hint {
- font-size: 24rpx;
- color: #999999;
- }
- }
- }
-
- // 发布按钮
- .publish-btn {
- position: fixed;
- bottom: 200rpx;
- right: 40rpx;
- z-index: 998;
-
- .publish-bg {
- width: 140rpx;
- height: 140rpx;
- background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 25%, #C2185B 50%, #FF8A95 75%, #FFB3BA 100%);
- border-radius: 50%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- box-shadow: 0 12rpx 36rpx rgba(233, 30, 99, 0.5);
- transition: all 0.3s ease;
- border: 4rpx solid rgba(255, 255, 255, 0.8);
- animation: pulse-love 3s ease-in-out infinite;
-
- &:active {
- transform: scale(0.9);
- }
-
- .publish-icon {
- font-size: 42rpx;
- margin-bottom: 4rpx;
- }
-
- .publish-text {
- font-size: 18rpx;
- color: rgba(255, 255, 255, 0.9);
- font-weight: 500;
- letter-spacing: 1rpx;
- }
- }
- }
-
- // 举报菜单弹窗
- .report-menu-popup {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 9998;
-
- .menu-mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- }
-
- .menu-content {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #FFFFFF;
- border-radius: 30rpx 30rpx 0 0;
- padding: 20rpx 30rpx;
- padding-bottom: calc(20rpx + constant(safe-area-inset-bottom));
- padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
- animation: slideUp 0.3s ease;
-
- .menu-item {
- height: 100rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 12rpx;
- margin-bottom: 16rpx;
- transition: background-color 0.3s ease;
-
- &:not(.cancel) {
- background: #FFF5F7;
-
- &:active {
- background: #FFE8EC;
- }
- }
-
- &.cancel {
- background: #F5F5F5;
- margin-top: 8rpx;
-
- &:active {
- background: #EEEEEE;
- }
- }
-
- .menu-icon {
- font-size: 36rpx;
- margin-right: 12rpx;
- }
-
- .menu-text {
- font-size: 30rpx;
- color: #333333;
- font-weight: 500;
- }
- }
- }
- }
-
- // 底部导航栏
- .tabbar {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- display: flex;
- background-color: #FFFFFF;
- border-top: 1rpx solid #F0F0F0;
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- z-index: 999;
- box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
-
- .tabbar-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 15rpx 0;
- position: relative;
-
- .tabbar-icon {
- font-size: 44rpx;
- margin-bottom: 5rpx;
- }
-
- .tabbar-text {
- font-size: 22rpx;
- color: #666666;
- }
-
- &.active {
- .tabbar-text {
- color: #E91E63;
- font-weight: bold;
- }
- }
- }
- }
- }
- // 动画
- @keyframes heartBeat {
- 0%, 100% {
- transform: scale(1);
- }
- 50% {
- transform: scale(1.2);
- }
- }
- @keyframes starShine {
- 0%, 100% {
- transform: scale(1) rotate(0deg);
- }
- 50% {
- transform: scale(1.2) rotate(15deg);
- }
- }
- @keyframes slideUp {
- from {
- transform: translateY(100%);
- }
- to {
- transform: translateY(0);
- }
- }
- .tabbar-badge {
- position: absolute;
- top: 8rpx;
- right: 50%;
- margin-right: -40rpx;
- min-width: 32rpx;
- height: 32rpx;
- line-height: 32rpx;
- padding: 0 6rpx;
- background-color: #FA5151;
- border-radius: 16rpx;
- font-size: 20rpx;
- color: #FFFFFF;
- text-align: center;
- }
- </style>
|