feat: 重构移动端 H5 页面视觉设计

基于移动优先原则优化布局、排版、颜色和间距,提升设计感和专业度。

- 重构全局设计系统:颜色、阴影、间距、圆角、排版
- 优化 UserInfoCard:更大的头像和状态徽章设计
- 优化 DeviceStatusCard:信息层级和指标网格
- 优化 TrafficCard:进度条和数字排版
- 优化 FunctionCard:4列布局和触摸反馈
- 优化 WifiCard:列表设计和信息层次
- 优化 FloatingButton:去除渐变,纯色设计

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-15 18:18:25 +08:00
parent 727c4126dd
commit c341ef1aac
12 changed files with 12049 additions and 1337 deletions

View File

@@ -1,36 +1,40 @@
<template>
<view class="card traffic-card">
<view class="card-header flex-row-sb mb-lg">
<view class="title">本月流量</view>
<view class="usage-percent">
<text class="title">{{ usedFlowPercent }}</text>
<text class="caption">%</text>
<view class="traffic-card">
<view class="card-header">
<text class="text-heading">本月流量</text>
<view class="usage-indicator">
<text class="usage-value">{{ usedFlowPercent }}</text>
<text class="usage-unit">%</text>
</view>
</view>
<view class="progress-section mb-lg">
<view class="progress-apple">
<view class="progress-fill" :style="{width: usedFlowPercent + '%'}"></view>
<view class="progress-section">
<view class="progress-track">
<view class="progress-fill" :style="{ width: usedFlowPercent + '%' }"></view>
</view>
</view>
<view class="traffic-stats flex-row-sb">
<view class="stat-item flex-col-center">
<view class="caption mb-xs">已使用</view>
<view class="stat-value-container">
<view class="traffic-stats">
<view class="stat-item">
<text class="stat-label">已使用</text>
<view class="stat-value-wrap">
<text class="stat-value">{{ usedValue }}</text>
<text class="stat-unit">{{ usedUnit }}</text>
</view>
</view>
<view class="stat-item flex-col-center">
<view class="caption mb-xs">总流量</view>
<view class="stat-value-container">
<view class="stat-divider"></view>
<view class="stat-item">
<text class="stat-label">总流量</text>
<view class="stat-value-wrap">
<text class="stat-value">{{ totalValue }}</text>
<text class="stat-unit">{{ totalUnit }}</text>
</view>
</view>
<view class="stat-item flex-col-center">
<view class="caption mb-xs">剩余</view>
<view class="stat-value-container">
<text class="stat-value">{{ remainValue }}</text>
<view class="stat-divider"></view>
<view class="stat-item">
<text class="stat-label">剩余</text>
<view class="stat-value-wrap">
<text class="stat-value remain">{{ remainValue }}</text>
<text class="stat-unit">{{ remainUnit }}</text>
</view>
</view>
@@ -91,9 +95,9 @@
const usedFlowPercent = computed(() => {
if (totalMB.value && usedMB.value) {
const percent = (usedMB.value / totalMB.value * 100);
return Math.min(percent, 100).toFixed(2);
return Math.min(percent, 100).toFixed(1);
}
return '0.00';
return '0.0';
});
// 加载套餐流量数据
@@ -144,18 +148,105 @@
<style scoped lang="scss">
.traffic-card {
.usage-percent {
display: flex;
align-items: baseline;
gap: 4rpx;
.title { font-size: 35rpx; font-weight: 700; margin-right: 5rpx; }
}
.traffic-stats {
background: var(--gray-100);
border-radius: var(--radius-small);
padding: 20rpx;
margin-top: 16rpx;
.stat-item { flex: 1; }
background: var(--bg-surface);
border-radius: var(--radius-xl);
padding: var(--space-5);
box-shadow: var(--shadow-sm);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--space-5);
}
.usage-indicator {
display: flex;
align-items: baseline;
gap: 2rpx;
}
.usage-value {
font-size: 48rpx;
font-weight: 700;
color: var(--primary);
letter-spacing: -0.02em;
line-height: 1;
}
.usage-unit {
font-size: 28rpx;
font-weight: 600;
color: var(--text-tertiary);
}
.progress-section {
margin-bottom: var(--space-5);
}
.progress-track {
height: 14rpx;
background: var(--gray-100);
border-radius: var(--radius-full);
overflow: hidden;
}
.progress-fill {
height: 100%;
background: var(--primary);
border-radius: var(--radius-full);
transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.traffic-stats {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--space-4);
background: var(--gray-50);
border-radius: var(--radius-lg);
}
.stat-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
}
.stat-divider {
width: 1rpx;
height: 60rpx;
background: var(--gray-200);
}
.stat-label {
font-size: 24rpx;
color: var(--text-tertiary);
}
.stat-value-wrap {
display: flex;
align-items: baseline;
gap: 4rpx;
}
.stat-value {
font-size: 32rpx;
font-weight: 700;
color: var(--text-primary);
line-height: 1.1;
&.remain {
color: var(--success);
}
}
</style>
.stat-unit {
font-size: 22rpx;
font-weight: 500;
color: var(--text-tertiary);
}
</style>