feat: enhance logs and stats UI with new headers, summaries, and improved data display

This commit is contained in:
nepiedg
2026-04-27 00:11:13 +08:00
parent 895f5e6d09
commit 203f97385b
3 changed files with 600 additions and 160 deletions
+60 -30
View File
@@ -2,6 +2,17 @@
<view class="page">
<view class="status-bar" :style="{ height: navBarHeight + 'px' }"></view>
<view class="page-head">
<view>
<text class="page-title">数据分析</text>
<text class="page-subtitle">少抽趋势节省金额和健康恢复进度</text>
</view>
<view class="head-chip" :class="statusChipClass">
<text class="head-chip-arrow" :class="statusIconClass">{{ statusArrow }}</text>
<text>{{ statusText }}</text>
</view>
</view>
<!-- Tab 切换 -->
<view class="segment-wrap">
<view class="segment">
@@ -165,10 +176,10 @@
</view>
</view>
<view class="mini-card">
<text class="mini-label">已拒绝</text>
<text class="mini-label">累计少抽</text>
<view class="mini-value-row">
<text class="mini-value">{{ resistedTotal }}</text>
<text class="mini-unit"></text>
<text class="mini-value">{{ reducedTotal }}</text>
<text class="mini-unit"></text>
</view>
</view>
</view>
@@ -226,13 +237,6 @@ const insightText = computed(() => {
return `较上期上升 ${abs}%,留意高峰时段,尝试延迟第一支。`
})
const trendRangeText = computed(() => {
const start = statsData.value?.start
const end = statsData.value?.end
if (!start || !end) return ''
return formatRangeText(start, end)
})
const weeklyTrendRangeText = computed(() => {
const start = weeklyStatsData.value?.start
const end = weeklyStatsData.value?.end
@@ -431,7 +435,7 @@ const healthItems = computed(() => {
})
const streakDays = computed(() => statsData.value?.streak_days ?? 0)
const resistedTotal = computed(() => statsData.value?.resisted_total ?? 0)
const reducedTotal = computed(() => Math.max(moneyExpectedTotal.value - moneyActualTotal.value, 0))
function formatRangeText(start, end) {
const startParts = start.split('-')
@@ -514,18 +518,59 @@ onShareAppMessage(() => {
background: transparent;
}
.page-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 20rpx;
margin: 10rpx 0 24rpx;
}
.page-title {
display: block;
font-size: 44rpx;
font-weight: 800;
line-height: 1.15;
color: #0D3D2E;
}
.page-subtitle {
display: block;
margin-top: 8rpx;
font-size: 23rpx;
line-height: 1.5;
color: #5D8F7C;
}
.head-chip {
display: inline-flex;
align-items: center;
gap: 6rpx;
flex-shrink: 0;
padding: 10rpx 16rpx;
border-radius: 999rpx;
font-size: 21rpx;
font-weight: 700;
white-space: nowrap;
border: 1.5rpx solid rgba(52, 200, 160, 0.12);
background: rgba(255, 255, 255, 0.76);
}
.head-chip-arrow {
font-size: 20rpx;
font-weight: 800;
}
/* ── Tab 切换 ── */
.segment-wrap {
position: relative;
height: 148rpx;
height: 112rpx;
flex-shrink: 0;
z-index: 20;
}
.segment {
position: fixed;
left: 28rpx;
right: 28rpx;
position: relative;
z-index: 50;
display: flex;
background: rgba(255, 255, 255, 0.82);
@@ -667,17 +712,6 @@ onShareAppMessage(() => {
display: block;
}
/* ── 状态标签 ── */
.status-chip {
display: flex;
align-items: center;
gap: 6rpx;
padding: 6rpx 14rpx;
border-radius: 999rpx;
font-size: 21rpx;
font-weight: 600;
}
.chip-good {
background: rgba(52, 200, 160, 0.12);
color: #1a8c62;
@@ -702,10 +736,6 @@ onShareAppMessage(() => {
.arrow-warn { color: #D97706; }
.arrow-neutral { color: #7aA898; }
.status-text {
font-size: 21rpx;
}
/* ── 日均 ── */
.avg-row {
display: flex;