refactor: simplify logs, profile, and stats UI by removing unnecessary headers and enhancing layout responsiveness
This commit is contained in:
+18
-111
@@ -2,19 +2,8 @@
|
||||
<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-wrap" :style="{ top: navBarHeight + 'px' }">
|
||||
<view class="segment">
|
||||
<view
|
||||
v-for="tab in tabs"
|
||||
@@ -244,33 +233,6 @@ const weeklyTrendRangeText = computed(() => {
|
||||
return `${formatRangeText(start, end)} · 固定展示最近 7 天`
|
||||
})
|
||||
|
||||
const statusText = computed(() => {
|
||||
if (changePercent.value === null) return '暂无对比'
|
||||
const sign = changePercent.value > 0 ? '+' : ''
|
||||
return `较上期 ${sign}${changePercent.value}%`
|
||||
})
|
||||
|
||||
const statusChipClass = computed(() => {
|
||||
if (changePercent.value === null) return 'chip-neutral'
|
||||
return changePercent.value <= 0 ? 'chip-good' : 'chip-warn'
|
||||
})
|
||||
|
||||
const statusArrow = computed(() => {
|
||||
if (changePercent.value === null) return '→'
|
||||
return changePercent.value <= 0 ? '↓' : '↑'
|
||||
})
|
||||
|
||||
const statusIconClass = computed(() => {
|
||||
if (changePercent.value === null) return 'arrow-neutral'
|
||||
return changePercent.value <= 0 ? 'arrow-good' : 'arrow-warn'
|
||||
})
|
||||
|
||||
const averageCount = computed(() => {
|
||||
const avg = statsData.value?.daily_average
|
||||
if (avg === undefined || avg === null) return 0
|
||||
return Number(avg) || 0
|
||||
})
|
||||
|
||||
const weeklyAverageCount = computed(() => {
|
||||
const avg = weeklyStatsData.value?.daily_average
|
||||
if (avg === undefined || avg === null) return 0
|
||||
@@ -509,7 +471,8 @@ onShareAppMessage(() => {
|
||||
/* ── 页面 ── */
|
||||
.page {
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(180deg, #E6F7F2 0%, #F0FBF7 40%, #FAFFFE 100%);
|
||||
background:
|
||||
linear-gradient(180deg, #F6F8F6 0%, #EFF4F1 52%, #E9F0EC 100%);
|
||||
padding: 0 28rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -518,55 +481,19 @@ 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: 112rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 98rpx;
|
||||
padding: 0 28rpx;
|
||||
background: rgba(246, 248, 246, 0.9);
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
z-index: 20;
|
||||
z-index: 60;
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
.segment {
|
||||
@@ -584,7 +511,7 @@ onShareAppMessage(() => {
|
||||
}
|
||||
|
||||
.segment::before {
|
||||
content: '';
|
||||
content: none;
|
||||
position: absolute;
|
||||
inset: -12rpx -8rpx -10rpx;
|
||||
border-radius: 34rpx;
|
||||
@@ -609,6 +536,10 @@ onShareAppMessage(() => {
|
||||
box-shadow: 0 4rpx 12rpx rgba(52, 200, 160, 0.12);
|
||||
}
|
||||
|
||||
.insight-card {
|
||||
margin-top: 112rpx;
|
||||
}
|
||||
|
||||
/* ── 洞察卡片 ── */
|
||||
.insight-card {
|
||||
display: flex;
|
||||
@@ -712,30 +643,6 @@ onShareAppMessage(() => {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.chip-good {
|
||||
background: rgba(52, 200, 160, 0.12);
|
||||
color: #1a8c62;
|
||||
}
|
||||
|
||||
.chip-warn {
|
||||
background: rgba(251, 191, 36, 0.14);
|
||||
color: #B45309;
|
||||
}
|
||||
|
||||
.chip-neutral {
|
||||
background: rgba(52, 200, 160, 0.06);
|
||||
color: #7aA898;
|
||||
}
|
||||
|
||||
.status-arrow {
|
||||
font-size: 18rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.arrow-good { color: #1a8c62; }
|
||||
.arrow-warn { color: #D97706; }
|
||||
.arrow-neutral { color: #7aA898; }
|
||||
|
||||
/* ── 日均 ── */
|
||||
.avg-row {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user