checkpoint: pre-refactor state before fixing P0/P1 issues

This commit is contained in:
2026-06-11 18:40:59 +08:00
parent 2c3c2653fa
commit d55ed60907
41 changed files with 1129 additions and 1051 deletions

View File

@@ -1,12 +1,20 @@
import { api } from '../../utils/api'
import { getAvatarGradient, formatTime } from '../../utils/format'
import { AppGlobalData } from '../../types/index'
const app = getApp<{ globalData: AppGlobalData }>()
Page({
data: { statusBarHeight: 0, list: [] as any[] },
data: {
statusBarHeight: 0,
navbarHeight: 44,
navbarPaddingRight: 0,
list: [] as any[],
},
onLoad() {
const info = wx.getSystemInfoSync()
this.setData({ statusBarHeight: info.statusBarHeight })
const { statusBarHeight, navbarHeight, navbarPaddingRight } = app.globalData.navBarInfo
this.setData({ statusBarHeight, navbarHeight, navbarPaddingRight })
this.loadNotifications()
},

View File

@@ -1,10 +1,17 @@
<view class="page">
<view class="safe-top" style="height: {{statusBarHeight}}px"></view>
<view class="nav">
<view class="nav-back" bindtap="onBack"></view>
<view class="nav-title">消息通知</view>
<view class="nav-right" bindtap="onReadAll">全部已读</view>
<!-- 固定液态玻璃顶栏:返回 + 标题 + 全部已读(右侧避让胶囊按钮) -->
<view class="glass-topbar">
<view style="height: {{statusBarHeight}}px;"></view>
<view class="navbar" style="height: {{navbarHeight}}px; padding-right: {{navbarPaddingRight}}px;">
<view class="nav-back" bindtap="onBack"></view>
<view class="navbar-title">消息通知</view>
<view class="nav-right" bindtap="onReadAll">全部已读</view>
</view>
</view>
<!-- 顶栏占位 -->
<view style="height: {{statusBarHeight + navbarHeight}}px;"></view>
<scroll-view scroll-y="true" enhanced="true" show-scrollbar="false">
<view wx:if="{{list.length === 0}}" class="empty">
<text class="empty-emoji">🔔</text>

View File

@@ -1,15 +1,29 @@
.page { min-height: 100vh; background: linear-gradient(180deg, #fff8f2 0%, #f5f0ff 100%); }
.nav { display: flex; align-items: center; padding: 14rpx 28rpx; gap: 16rpx; }
.nav-back { font-size: 60rpx; color: #272235; font-weight: 300; line-height: 1; }
.nav-title { flex: 1; font-size: 32rpx; font-weight: 900; color: #272235; text-align: center; }
.nav-right { font-size: 26rpx; color: #9b8fa8; }
/* ── 通知页:Vital 风格 ── */
.page { min-height: 100vh; background: #f1f2f6; }
/* 顶栏内导航行:返回 + 标题 + 全部已读(玻璃样式由 .glass-topbar 提供) */
.navbar {
display: flex;
align-items: center;
gap: 8rpx;
padding-left: 20rpx;
box-sizing: border-box;
}
.navbar-title { font-size: 36rpx; font-weight: 700; }
.nav-back { font-size: 60rpx; color: #1b1b20; font-weight: 300; line-height: 1; padding: 0 10rpx; }
/* 全部已读:靠右紧贴胶囊 */
.nav-right { margin-left: auto; margin-right: 8rpx; font-size: 26rpx; color: #6e7280; padding: 10rpx 0; }
.nav-right:active { opacity: 0.6; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 120rpx 60rpx; gap: 20rpx; }
.empty-emoji { font-size: 80rpx; }
.empty-tip { font-size: 28rpx; color: #9b8fa8; }
.notify-item { display: flex; align-items: center; gap: 20rpx; padding: 22rpx 28rpx; background: rgba(255,255,255,0.80); border-bottom: 1rpx solid rgba(43,37,61,0.05); }
.notify-item.unread { background: rgba(255,229,240,0.40); }
.n-avatar { width: 80rpx; height: 80rpx; border-radius: 26rpx; display: flex; align-items: center; justify-content: center; font-size: 34rpx; font-weight: 800; color: rgba(39,34,53,0.72); flex-shrink: 0; }
.empty-tip { font-size: 28rpx; color: #b9bdc6; }
.notify-item { display: flex; align-items: center; gap: 20rpx; padding: 22rpx 28rpx; background: #ffffff; border-bottom: 1rpx solid rgba(27, 27, 32, 0.04); }
.notify-item.unread { background: rgba(139, 124, 246, 0.08); }
.n-avatar { width: 80rpx; height: 80rpx; border-radius: 26rpx; display: flex; align-items: center; justify-content: center; font-size: 34rpx; font-weight: 700; color: rgba(27, 27, 32, 0.65); flex-shrink: 0; }
.n-body { flex: 1; }
.n-text { display: block; font-size: 28rpx; color: #272235; line-height: 1.5; }
.n-time { display: block; font-size: 22rpx; color: #9b8fa8; margin-top: 6rpx; }
.unread-dot { width: 14rpx; height: 14rpx; border-radius: 50%; background: #ff4f91; flex-shrink: 0; }
.n-text { display: block; font-size: 28rpx; color: #1b1b20; line-height: 1.5; }
.n-time { display: block; font-size: 22rpx; color: #b9bdc6; margin-top: 6rpx; }
.unread-dot { width: 14rpx; height: 14rpx; border-radius: 50%; background: #8b7cf6; flex-shrink: 0; }