feat: 重构移动端 H5 页面视觉设计
基于移动优先原则优化布局、排版、颜色和间距,提升设计感和专业度。 - 重构全局设计系统:颜色、阴影、间距、圆角、排版 - 优化 UserInfoCard:更大的头像和状态徽章设计 - 优化 DeviceStatusCard:信息层级和指标网格 - 优化 TrafficCard:进度条和数字排版 - 优化 FunctionCard:4列布局和触摸反馈 - 优化 WifiCard:列表设计和信息层次 - 优化 FloatingButton:去除渐变,纯色设计 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,41 +1,55 @@
|
||||
<template>
|
||||
<view class="card device-status-card">
|
||||
<view class="card-header mb-md flex-row-sb">
|
||||
<view class="title">设备信息</view>
|
||||
<view class="tag-apple tag-success">{{ getOperator(deviceInfo.currentIccid) }}</view>
|
||||
</view>
|
||||
<view class="device-info flex-col-g16">
|
||||
<view class="info-row flex-row-sb">
|
||||
<view class="info-label">
|
||||
<view class="subtitle">当前卡: {{ deviceInfo.currentIccid }}</view>
|
||||
</view>
|
||||
<view class="info-values flex-row-g20" @tap="$emit('authentication')">
|
||||
<view class="tag-apple" :class="isRealName ? 'tag-success' : 'tag-warning'">
|
||||
{{ isRealName ? "已实名" : "未实名" }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="device-status-card">
|
||||
<view class="card-header">
|
||||
<text class="text-heading">设备信息</text>
|
||||
<view class="operator-badge">
|
||||
<text class="operator-name">中国电信</text>
|
||||
</view>
|
||||
<view class="info-row flex-row-sb">
|
||||
<view class="info-label">
|
||||
<view class="subtitle">到期时间:{{ deviceInfo.expireDate }}</view>
|
||||
</view>
|
||||
<view class="info-values flex-row-g20">
|
||||
<view class="tag-apple tag-primary">{{ statusText }}</view>
|
||||
</view>
|
||||
|
||||
<view class="status-row">
|
||||
<view class="status-item">
|
||||
<text class="status-label">当前卡</text>
|
||||
<text class="status-value iccid">{{ deviceInfo.currentIccid }}</text>
|
||||
</view>
|
||||
<view class="status-item">
|
||||
<text class="status-label">实名状态</text>
|
||||
<view class="auth-badge" :class="isRealName ? 'auth-done' : 'auth-pending'" @tap="$emit('authentication')">
|
||||
<text>{{ isRealName ? '已实名' : '未实名' }}</text>
|
||||
<text class="arrow">›</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="device-metrics flex-row-sb mt-md">
|
||||
<view class="metric-item flex-col-center">
|
||||
<view class="caption mb-xs">信号强度</view>
|
||||
<view class="metric-value">{{ getSignalText(deviceInfo.rssi) }}</view>
|
||||
|
||||
<view class="status-row">
|
||||
<view class="status-item full-width">
|
||||
<text class="status-label">到期时间</text>
|
||||
<text class="status-value expire">{{ deviceInfo.expireDate }}</text>
|
||||
</view>
|
||||
<view class="metric-item flex-col-center">
|
||||
<view class="caption mb-xs">设备电量</view>
|
||||
<view class="metric-value">{{ deviceInfo.battery }} %</view>
|
||||
</view>
|
||||
|
||||
<view class="metrics-grid">
|
||||
<view class="metric-card">
|
||||
<view class="metric-icon signal">
|
||||
<image src="/static/signal.png" mode="aspectFit" v-if="false"></image>
|
||||
<text class="metric-icon-text">📶</text>
|
||||
</view>
|
||||
<text class="metric-label">信号强度</text>
|
||||
<text class="metric-value">{{ getSignalText(deviceInfo.rssi) }}</text>
|
||||
</view>
|
||||
<view class="metric-item flex-col-center">
|
||||
<view class="caption mb-xs">连接数量</view>
|
||||
<view class="metric-value">{{ deviceInfo.connCnt }}/{{ deviceInfo.max_clients }}</view>
|
||||
<view class="metric-card">
|
||||
<view class="metric-icon battery">
|
||||
<text class="metric-icon-text">🔋</text>
|
||||
</view>
|
||||
<text class="metric-label">设备电量</text>
|
||||
<text class="metric-value">{{ deviceInfo.battery }}%</text>
|
||||
</view>
|
||||
<view class="metric-card">
|
||||
<view class="metric-icon connections">
|
||||
<text class="metric-icon-text">📱</text>
|
||||
</view>
|
||||
<text class="metric-label">连接数量</text>
|
||||
<text class="metric-value">{{ deviceInfo.connCnt }}/{{ deviceInfo.max_clients }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -52,37 +66,152 @@
|
||||
|
||||
defineEmits(['authentication']);
|
||||
|
||||
const getOperator = (iccid) => {
|
||||
return '中国电信';
|
||||
};
|
||||
|
||||
const getSignalText = (rssi) => rssi || '强';
|
||||
|
||||
const statusText = computed(() => {
|
||||
const statusMap = {
|
||||
1: '在库',
|
||||
2: '已分销',
|
||||
3: '已激活',
|
||||
4: '已停用'
|
||||
};
|
||||
return statusMap[props.deviceInfo.status] || '-';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.device-status-card {
|
||||
.info-row {
|
||||
padding: var(--space-sm) 0;
|
||||
border-bottom: 1rpx solid var(--gray-200);
|
||||
&:last-child { border-bottom: none; }
|
||||
.info-label { min-width: 200rpx; }
|
||||
.info-values { flex: 1; justify-content: flex-end; }
|
||||
}
|
||||
.device-metrics {
|
||||
background: var(--gray-100);
|
||||
border-radius: var(--radius-small);
|
||||
padding: 20rpx;
|
||||
.metric-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;
|
||||
padding-bottom: var(--space-4);
|
||||
border-bottom: 1rpx solid var(--gray-100);
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
.operator-badge {
|
||||
padding: var(--space-1) var(--space-3);
|
||||
background: var(--primary-tint);
|
||||
border-radius: var(--radius-full);
|
||||
}
|
||||
|
||||
.operator-name {
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.status-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: var(--space-3) 0;
|
||||
|
||||
& + .status-row {
|
||||
border-top: 1rpx solid var(--gray-50);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
.status-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
|
||||
&.full-width {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.status-label {
|
||||
font-size: 24rpx;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.status-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
|
||||
&.iccid {
|
||||
font-family: "SF Mono", "Menlo", monospace;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
&.expire {
|
||||
color: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
.auth-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
padding: var(--space-1) var(--space-3);
|
||||
border-radius: var(--radius-full);
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: transform var(--duration-fast) var(--ease-out);
|
||||
|
||||
&:active {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
&.auth-done {
|
||||
background: var(--success-light);
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
&.auth-pending {
|
||||
background: var(--warning-light);
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
font-size: 28rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.metrics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: var(--space-3);
|
||||
margin-top: var(--space-5);
|
||||
padding-top: var(--space-5);
|
||||
border-top: 1rpx solid var(--gray-100);
|
||||
}
|
||||
|
||||
.metric-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-4);
|
||||
background: var(--gray-50);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.metric-icon {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--radius-sm);
|
||||
|
||||
.metric-icon-text {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.metric-label {
|
||||
font-size: 22rpx;
|
||||
color: var(--text-tertiary);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.metric-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user