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>
|
||||
@@ -1,13 +1,17 @@
|
||||
<template>
|
||||
<view class="floating-service-card" @click="handleClick">
|
||||
<view class="service-left">
|
||||
<image class="service-icon" src="/static/link.png" mode="aspectFit"></image>
|
||||
<view class="service-content">
|
||||
<text class="service-title">需要帮助?</text>
|
||||
<text class="service-desc">专属客服在线解答</text>
|
||||
<view class="service-card" @click="handleClick">
|
||||
<view class="service-inner">
|
||||
<view class="service-left">
|
||||
<view class="service-icon-wrap">
|
||||
<image class="service-icon" src="/static/link.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="service-content">
|
||||
<text class="service-title">需要帮助?</text>
|
||||
<text class="service-desc">专属客服在线解答</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="service-btn">立即联系</view>
|
||||
</view>
|
||||
<view class="service-btn">立即联系</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -20,56 +24,71 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.floating-service-card {
|
||||
.service-card {
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 20rpx;
|
||||
right: 20rpx;
|
||||
height: 120rpx;
|
||||
background: #fff;
|
||||
border-radius: 60rpx;
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.12);
|
||||
bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
|
||||
left: var(--space-4);
|
||||
right: var(--space-4);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.service-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 24rpx 0 24rpx;
|
||||
z-index: 1000;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
background: var(--bg-surface);
|
||||
border-radius: var(--radius-xl);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.service-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.service-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
.service-icon-wrap {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--primary-tint);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.service-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
.service-icon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.service-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.service-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rpx;
|
||||
}
|
||||
|
||||
.service-desc {
|
||||
font-size: 22rpx;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
}
|
||||
.service-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.service-desc {
|
||||
font-size: 24rpx;
|
||||
color: var(--text-tertiary);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.service-btn {
|
||||
padding: 16rpx 32rpx;
|
||||
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
|
||||
color: #fff;
|
||||
padding: var(--space-3) var(--space-5);
|
||||
background: var(--primary);
|
||||
color: var(--text-inverse);
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 40rpx;
|
||||
border-radius: var(--radius-full);
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -1,111 +1,22 @@
|
||||
<template>
|
||||
<view class="card function-card">
|
||||
<view class="card-header">
|
||||
<view class="title">功能菜单</view>
|
||||
<!-- <view class="header-actions">
|
||||
<button class="btn-apple btn-primary" @tap="$emit('sync')">运营商数据同步</button>
|
||||
</view> -->
|
||||
<view class="card-header mb-5">
|
||||
<text class="text-heading">功能服务</text>
|
||||
</view>
|
||||
<view class="function-grid">
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'authentication')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/authentication.png" mode="aspectFit" alt="实名认证"></image>
|
||||
<view
|
||||
v-for="item in displayFunctions"
|
||||
:key="item.key"
|
||||
class="function-item interactive"
|
||||
:class="{ 'is-disabled': item.disabled }"
|
||||
@click="handleItemClick(item)"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<view class="function-icon-wrap">
|
||||
<image class="function-icon" :src="item.icon" mode="aspectFit" :alt="item.name"></image>
|
||||
</view>
|
||||
<view :class="['function-name', realNameStatus === '已实名' ? 'text-primary' : '']">
|
||||
{{ realNameStatus || '实名认证' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('sync')" role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/data.png" mode="aspectFit" alt="运营数据同步"></image>
|
||||
</view>
|
||||
<view class="function-name">运营数据同步</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'package-order')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/shop.png" mode="aspectFit" alt="套餐订购"></image>
|
||||
</view>
|
||||
<view class="function-name">套餐订购</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'order-list')" role="button"
|
||||
tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/order.png" mode="aspectFit" alt="我的订单"></image>
|
||||
</view>
|
||||
<view class="function-name">我的订单</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'back')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/back.png" mode="aspectFit" alt="后台管理"></image>
|
||||
</view>
|
||||
<view class="function-name">后台管理</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'switch')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/change.png" mode="aspectFit" alt="切换运营商"></image>
|
||||
</view>
|
||||
<view class="function-name">切换运营商</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'asset-package')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/shop.png" mode="aspectFit" alt="资产套餐历史"></image>
|
||||
</view>
|
||||
<view class="function-name">资产套餐历史</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="handleBindPhone" role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/bind-phone.png" mode="aspectFit" alt="绑定手机号"></image>
|
||||
</view>
|
||||
<view :class="['function-name', alreadyBindPhone ? 'text-primary' : '']">
|
||||
{{ alreadyBindPhone ? '已绑定' : '绑定手机号' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'change-phone')" role="button"
|
||||
tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/change-phone.png" mode="aspectFit" alt="更换手机号"></image>
|
||||
</view>
|
||||
<view class="function-name">更换手机号</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" v-if="isDevice"
|
||||
@tap="$emit('enter', 'device-exchange')" role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/change.png" mode="aspectFit" alt="设备换货"></image>
|
||||
</view>
|
||||
<view class="function-name">设备换货</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'wallet')" role="button"
|
||||
tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/wallet.png" mode="aspectFit" alt="我的钱包"></image>
|
||||
</view>
|
||||
<view class="function-name">我的钱包</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'recover')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/recover.png" mode="aspectFit" alt="重启设备"></image>
|
||||
</view>
|
||||
<view class="function-name">重启设备</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" v-if="isDevice" @tap="$emit('enter', 'restart')"
|
||||
role="button" tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/restart.png" mode="aspectFit" alt="恢复出厂"></image>
|
||||
</view>
|
||||
<view class="function-name">恢复出厂</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'out')" role="button"
|
||||
tabindex="0">
|
||||
<view class="function-icon">
|
||||
<image src="/static/out.png" mode="aspectFit" alt="退出登录"></image>
|
||||
</view>
|
||||
<view class="function-name">退出登录</view>
|
||||
<text class="function-name" :class="{ 'text-primary-color': item.highlight }">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -114,6 +25,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
realNameStatus: {
|
||||
type: String,
|
||||
@@ -131,62 +44,95 @@
|
||||
|
||||
const emit = defineEmits(['enter', 'sync']);
|
||||
|
||||
const handleBindPhone = () => {
|
||||
if (props.alreadyBindPhone) {
|
||||
// 已绑定,不可点击
|
||||
return;
|
||||
const functions = computed(() => {
|
||||
const list = [
|
||||
{ key: 'authentication', name: props.realNameStatus || '实名认证', icon: '/static/authentication.png', action: 'authentication', highlight: props.realNameStatus === '已实名' },
|
||||
{ key: 'sync', name: '运营数据同步', icon: '/static/data.png', action: 'sync' },
|
||||
{ key: 'package-order', name: '套餐订购', icon: '/static/shop.png', action: 'package-order' },
|
||||
{ key: 'order-list', name: '我的订单', icon: '/static/order.png', action: 'order-list' },
|
||||
{ key: 'back', name: '后台管理', icon: '/static/back.png', action: 'back', deviceOnly: true },
|
||||
{ key: 'switch', name: '切换运营商', icon: '/static/change.png', action: 'switch', deviceOnly: true },
|
||||
{ key: 'asset-package', name: '资产套餐历史', icon: '/static/shop.png', action: 'asset-package' },
|
||||
{ key: 'bind', name: props.alreadyBindPhone ? '已绑定' : '绑定手机号', icon: '/static/bind-phone.png', action: 'bind', highlight: props.alreadyBindPhone, disabled: props.alreadyBindPhone },
|
||||
{ key: 'change-phone', name: '更换手机号', icon: '/static/change-phone.png', action: 'change-phone' },
|
||||
{ key: 'device-exchange', name: '设备换货', icon: '/static/change.png', action: 'device-exchange', deviceOnly: true },
|
||||
{ key: 'wallet', name: '我的钱包', icon: '/static/wallet.png', action: 'wallet' },
|
||||
{ key: 'recover', name: '重启设备', icon: '/static/recover.png', action: 'recover', deviceOnly: true },
|
||||
{ key: 'restart', name: '恢复出厂', icon: '/static/restart.png', action: 'restart', deviceOnly: true },
|
||||
{ key: 'out', name: '退出登录', icon: '/static/out.png', action: 'out' }
|
||||
];
|
||||
|
||||
return list.filter(item => !item.deviceOnly || props.isDevice);
|
||||
});
|
||||
|
||||
const displayFunctions = computed(() => functions.value);
|
||||
|
||||
const handleItemClick = (item) => {
|
||||
if (item.disabled) return;
|
||||
if (item.action === 'bind' && props.alreadyBindPhone) return;
|
||||
if (item.action === 'sync') {
|
||||
emit('sync');
|
||||
} else {
|
||||
emit('enter', item.action);
|
||||
}
|
||||
// 未绑定,可以点击进入绑定页面
|
||||
emit('enter', 'bind');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.function-card {
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.function-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 16rpx;
|
||||
width: 100%;
|
||||
|
||||
.function-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20rpx;
|
||||
|
||||
.function-icon {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.function-name {
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
text-align: center;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
}
|
||||
padding-bottom: var(--space-4);
|
||||
border-bottom: 1rpx solid var(--gray-100);
|
||||
}
|
||||
}
|
||||
|
||||
.text-primary {
|
||||
color: var(--primary) !important;
|
||||
.function-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: var(--space-4);
|
||||
padding-top: var(--space-5);
|
||||
}
|
||||
|
||||
.function-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-3);
|
||||
border-radius: var(--radius-md);
|
||||
transition: background var(--duration-fast) var(--ease-out);
|
||||
|
||||
&:active {
|
||||
background: var(--gray-50);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.function-icon-wrap {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--gray-50);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.function-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.function-name {
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: var(--text-secondary);
|
||||
text-align: center;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -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>
|
||||
@@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<view class="card user-info-card interactive">
|
||||
<view class="flex-row-g20">
|
||||
<view class="user-info-card">
|
||||
<view class="card-main">
|
||||
<view class="user-avatar">
|
||||
<image :src="avatarUrl" mode="aspectFill" alt="用户头像" />
|
||||
</view>
|
||||
<view class="user-details flex-col-g8">
|
||||
<view class="flex-row-g20">
|
||||
<view class="title">{{ currentCardNo || '-' }}</view>
|
||||
<view class="user-details">
|
||||
<view class="user-id">
|
||||
<text class="device-id">{{ currentCardNo || '-' }}</text>
|
||||
<view class="status-badge" :class="isOnline ? 'status-online' : 'status-offline'">
|
||||
<text class="status-dot"></text>
|
||||
<text class="status-text">{{ isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="user-meta">
|
||||
<text class="meta-text" v-if="isDevice">IMEI:{{ deviceInfo.imei || '-' }}</text>
|
||||
<text class="meta-text" v-else>手机号:{{ deviceInfo.bound_phone || '-' }}</text>
|
||||
</view>
|
||||
<view class="caption" v-if="isDevice">IMEI:{{ deviceInfo.imei || '-' }}</view>
|
||||
<view class="caption" v-else>手机号:{{ deviceInfo.bound_phone || '-' }}</view>
|
||||
</view>
|
||||
<view v-if="isDevice" class="tag-apple" :class="onlineStatus === '在线' ? 'tag-success' : 'tag-warning'">
|
||||
{{ onlineStatus }}
|
||||
</view>
|
||||
<view v-else class="tag-apple" :class="networkStatus == 1 ? 'tag-success' : 'tag-warning'">
|
||||
</view>
|
||||
<view class="card-footer" v-if="!isDevice">
|
||||
<view class="network-badge" :class="networkStatus == 1 ? 'network-ok' : 'network-stop'">
|
||||
{{ networkStatus == 1 ? '正常' : '停机' }}
|
||||
</view>
|
||||
</view>
|
||||
@@ -25,36 +30,137 @@
|
||||
import { computed } from 'vue';
|
||||
import { useUserStore } from '@/store/index.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
currentCardNo: { type: String, default: '' },
|
||||
deviceInfo: { type: Object, default: () => ({}) },
|
||||
onlineStatus: { type: String, default: '离线' },
|
||||
networkStatus: { type: String, default: '离线' },
|
||||
networkStatus: { type: [String, Number], default: '离线' },
|
||||
isDevice: { type: Boolean, default: true }
|
||||
});
|
||||
|
||||
// 默认头像
|
||||
const userStore = useUserStore();
|
||||
|
||||
const defaultAvatar = 'https://img1.baidu.com/it/u=2462918877,1866131262&fm=253&fmt=auto&app=138&f=JPEG?w=506&h=500';
|
||||
|
||||
// 用户头像,优先使用 store 中的头像,否则使用默认头像
|
||||
const avatarUrl = computed(() => {
|
||||
return userStore.state.userInfo.avatar || defaultAvatar;
|
||||
});
|
||||
|
||||
const isOnline = computed(() => {
|
||||
return props.onlineStatus === '在线';
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user-info-card {
|
||||
color: var(--text-primary);
|
||||
.user-avatar {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: var(--radius-medium);
|
||||
overflow: hidden;
|
||||
border: 2rpx solid var(--border-light);
|
||||
image { width: 100%; height: 100%; object-fit: cover; }
|
||||
}
|
||||
.user-details { flex: 1; }
|
||||
background: var(--bg-surface);
|
||||
border-radius: var(--radius-xl);
|
||||
padding: var(--space-5);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
</style>
|
||||
|
||||
.card-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
border: 4rpx solid var(--gray-100);
|
||||
flex-shrink: 0;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.user-details {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.user-id {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.device-id {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: var(--radius-full);
|
||||
font-size: 20rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.status-online {
|
||||
background: var(--success-light);
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.status-offline {
|
||||
background: var(--warning-light);
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
}
|
||||
|
||||
.status-text {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.user-meta {
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
.meta-text {
|
||||
font-size: 24rpx;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
margin-top: var(--space-4);
|
||||
padding-top: var(--space-4);
|
||||
border-top: 1rpx solid var(--gray-100);
|
||||
}
|
||||
|
||||
.network-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: var(--space-2) var(--space-4);
|
||||
border-radius: var(--radius-full);
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.network-ok {
|
||||
background: var(--success-light);
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.network-stop {
|
||||
background: var(--danger-light);
|
||||
color: var(--danger);
|
||||
}
|
||||
</style>
|
||||
@@ -1,25 +1,29 @@
|
||||
<template>
|
||||
<view class="card wifi-card">
|
||||
<view class="card-header flex-row-sb">
|
||||
<view class="title">WiFi配置</view>
|
||||
<view class="btn-group">
|
||||
<button class="btn-apple btn-primary btn-mini" @tap="$emit('modify')">修改</button>
|
||||
</view>
|
||||
<view class="wifi-card">
|
||||
<view class="card-header">
|
||||
<text class="text-heading">WiFi配置</text>
|
||||
<button class="btn btn-mini btn-primary" @tap="$emit('modify')">修改</button>
|
||||
</view>
|
||||
<view class="wifi-info flex-col-g16 mt-30">
|
||||
<view class="wifi-item flex-row-sb">
|
||||
<view class="wifi-details flex-col-g8">
|
||||
<view class="caption">网络名称</view>
|
||||
<view class="subtitle">{{ deviceInfo.ssidName }}</view>
|
||||
<view class="wifi-list">
|
||||
<view class="wifi-item">
|
||||
<view class="wifi-icon-wrap">
|
||||
<text class="wifi-icon-text">📶</text>
|
||||
</view>
|
||||
<button class="btn-apple btn-primary btn-mini" @tap="$emit('copy', deviceInfo.ssidName)">复制</button>
|
||||
<view class="wifi-content">
|
||||
<text class="wifi-label">网络名称</text>
|
||||
<text class="wifi-value">{{ deviceInfo.ssidName }}</text>
|
||||
</view>
|
||||
<button class="btn-copy" @tap="$emit('copy', deviceInfo.ssidName)">复制</button>
|
||||
</view>
|
||||
<view class="wifi-item flex-row-sb">
|
||||
<view class="wifi-details flex-col-g8">
|
||||
<view class="caption">连接密码</view>
|
||||
<view class="subtitle">{{ deviceInfo.ssidPwd }}</view>
|
||||
<view class="wifi-item">
|
||||
<view class="wifi-icon-wrap">
|
||||
<text class="wifi-icon-text">🔑</text>
|
||||
</view>
|
||||
<button class="btn-apple btn-primary btn-mini" @tap="$emit('copy', deviceInfo.ssidPwd)">复制</button>
|
||||
<view class="wifi-content">
|
||||
<text class="wifi-label">连接密码</text>
|
||||
<text class="wifi-value">{{ deviceInfo.ssidPwd }}</text>
|
||||
</view>
|
||||
<button class="btn-copy" @tap="$emit('copy', deviceInfo.ssidPwd)">复制</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -35,13 +39,86 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wifi-card {
|
||||
.wifi-item {
|
||||
padding: var(--space-md);
|
||||
background: var(--gray-100);
|
||||
border-radius: var(--radius-medium);
|
||||
margin-bottom: var(--space-sm);
|
||||
&:last-child { margin-bottom: 0; }
|
||||
.wifi-details { 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);
|
||||
}
|
||||
|
||||
.wifi-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.wifi-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
padding: var(--space-4);
|
||||
background: var(--gray-50);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.wifi-icon-wrap {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--bg-surface);
|
||||
border-radius: var(--radius-sm);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wifi-icon-text {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.wifi-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rpx;
|
||||
}
|
||||
|
||||
.wifi-label {
|
||||
font-size: 22rpx;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.wifi-value {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-copy {
|
||||
padding: var(--space-2) var(--space-4);
|
||||
background: var(--bg-surface);
|
||||
color: var(--primary);
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
border-radius: var(--radius-full);
|
||||
line-height: 1.5;
|
||||
flex-shrink: 0;
|
||||
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user