first commit

This commit is contained in:
sexygoat
2026-04-11 14:42:14 +08:00
commit b962c9c716
62 changed files with 7323 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<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>
<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">{{ deviceInfo.statusStr }}</view>
</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>
<view class="metric-item flex-col-center">
<view class="caption mb-xs">设备电量</view>
<view class="metric-value">{{ deviceInfo.battery }} %</view>
</view>
<view class="metric-item flex-col-center">
<view class="caption mb-xs">连接数量</view>
<view class="metric-value">{{ deviceInfo.connCnt }} </view>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
deviceInfo: { type: Object, default: () => ({}) },
isRealName: { type: Boolean, default: false },
opratorList: { type: Array, default: () => [] }
});
defineEmits(['authentication']);
const getOperator = (iccid) => {
return '中国电信';
};
const getSignalText = (rssi) => rssi || '强';
</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; }
}
}
</style>

View File

@@ -0,0 +1,75 @@
<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>
</view>
<view class="service-btn">立即联系</view>
</view>
</template>
<script setup>
const emit = defineEmits(['tap']);
const handleClick = () => {
emit('tap');
};
</script>
<style scoped lang="scss">
.floating-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);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24rpx 0 24rpx;
z-index: 1000;
}
.service-left {
display: flex;
align-items: center;
gap: 20rpx;
.service-icon {
width: 60rpx;
height: 60rpx;
}
.service-content {
display: flex;
flex-direction: column;
gap: 4rpx;
.service-title {
font-size: 28rpx;
font-weight: 600;
color: var(--text-primary);
}
.service-desc {
font-size: 22rpx;
color: var(--text-tertiary);
}
}
}
.service-btn {
padding: 16rpx 32rpx;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
color: #fff;
font-size: 26rpx;
font-weight: 600;
border-radius: 40rpx;
}
</style>

143
components/FunctionCard.vue Normal file
View File

@@ -0,0 +1,143 @@
<template>
<view class="card function-card">
<view class="card-header">
<view class="title">功能菜单</view>
<view class="header-actions">
<button class="btn-apple btn-primary btn-mini" @tap="$emit('sync')">运营商数据同步</button>
</view>
</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>
<view :class="['function-name', realNameStatus === '已实名' ? 'text-primary' : '']">
{{ realNameStatus || '实名认证' }}
</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" v-if="isDevice" @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="$emit('enter', 'bind')" role="button" tabindex="0">
<view class="function-icon">
<image src="/static/bind-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', '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" v-if="isDevice" @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>
</view>
</view>
<slot></slot>
</view>
</template>
<script setup>
defineProps({
realNameStatus: { type: String, default: '' },
alreadyBindPhone: { type: Boolean, default: false },
isDevice: { type: Boolean, default: true }
});
defineEmits(['enter', 'sync']);
</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;
}
}
}
}
.text-primary { color: var(--primary) !important; }
</style>

View File

@@ -0,0 +1,80 @@
<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>
</view>
<view class="progress-section mb-lg">
<view class="progress-apple">
<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">
<text class="stat-value">{{ formatDataSize(deviceInfo.totalBytesCnt) }}</text>
<text class="stat-unit">{{ isDevice ? 'GB' : 'MB' }}</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">{{ formatDataSize(deviceInfo.flowSize) }}</text>
<text class="stat-unit">{{ isDevice ? 'GB' : 'MB' }}</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">{{ formatDataSize(deviceInfo.flowSize - deviceInfo.totalBytesCnt) }}</text>
<text class="stat-unit">{{ isDevice ? 'GB' : 'MB' }}</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
const props = defineProps({
deviceInfo: { type: Object, default: () => ({}) },
isDevice: { type: Boolean, default: true }
});
const usedFlowPercent = computed(() => {
if (props.deviceInfo.flowSize && props.deviceInfo.totalBytesCnt) {
return (props.deviceInfo.totalBytesCnt / props.deviceInfo.flowSize * 100).toFixed(2);
}
return '0';
});
const formatDataSize = (size) => {
if (!size) return '0';
const num = parseFloat(size);
if (num < 0.01) return '0';
return num.toFixed(2);
};
</script>
<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; }
}
}
</style>

View File

@@ -0,0 +1,41 @@
<template>
<view class="card user-info-card interactive">
<view class="flex-row-g20">
<view class="user-avatar">
<image src="https://img1.baidu.com/it/u=2462918877,1866131262&fm=253&fmt=auto&app=138&f=JPEG?w=506&h=500" mode="aspectFill" alt="用户头像" />
</view>
<view class="user-details flex-col-g8">
<view class="flex-row-g20">
<view class="title">{{ currentCardNo }}</view>
</view>
<view class="caption">到期时间{{ deviceInfo.expireDate }}</view>
</view>
<view class="tag-apple" :class="onlineStatus === '在线' ? 'tag-success' : 'tag-warning'">
{{ onlineStatus }}
</view>
</view>
</view>
</template>
<script setup>
defineProps({
currentCardNo: { type: String, default: '' },
deviceInfo: { type: Object, default: () => ({}) },
onlineStatus: { type: String, default: '离线' }
});
</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; }
}
</style>

70
components/VoiceCard.vue Normal file
View File

@@ -0,0 +1,70 @@
<template>
<view class="card voice-card">
<view class="card-header flex-row-sb mb-lg">
<view class="title">通话使用</view>
<view class="date-range-selector" @tap="$emit('openDatePicker')">
<text>{{ dateRangeText }}</text>
<text class="ml-10"></text>
</view>
</view>
<view class="voice-stats flex-row-sb">
<view class="stat-item flex-col-center">
<view class="caption mb-xs">总通话</view>
<view class="stat-value-container">
<text class="stat-value">{{ voiceStats.totalVoice }}</text>
<text class="stat-unit">分钟</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">{{ voiceStats.usedVoice }}</text>
<text class="stat-unit">分钟</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">{{ voiceStats.remainingVoice }}</text>
<text class="stat-unit">分钟</text>
</view>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
voiceStats: { type: Object, default: () => ({ totalVoice: 0, usedVoice: 0, remainingVoice: 0 }) },
dateRangeText: { type: String, default: '' }
});
defineEmits(['openDatePicker']);
</script>
<style scoped lang="scss">
.voice-card {
.date-range-selector {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
background: var(--gray-100);
border-radius: var(--radius-small);
cursor: pointer;
font-size: 22rpx;
color: var(--text-primary);
max-width: 360rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:active { opacity: 0.7; }
}
.voice-stats {
background: var(--gray-100);
border-radius: var(--radius-small);
padding: 20rpx;
.stat-item { flex: 1; }
}
}
.ml-10 { margin-left: 10rpx; }
</style>

View File

@@ -0,0 +1,63 @@
<template>
<view class="card whitelist-card">
<view class="card-header flex-row-sb mb-lg">
<view class="title">语音白名单</view>
<view class="flex-row-g20">
<button class="btn-apple btn-secondary btn-mini" @tap="$emit('refresh')">刷新</button>
<button class="btn-apple btn-primary btn-mini" @tap="$emit('add')">添加白名单</button>
</view>
</view>
<view v-if="whitelistData.length === 0" class="empty-whitelist">
<text class="caption">暂无白名单</text>
</view>
<view v-else class="whitelist-list">
<view class="whitelist-item" v-for="(item, index) in whitelistData" :key="index">
<view class="whitelist-info flex-col-g8">
<view class="flex-row-sb">
<text class="subtitle">{{ item.name }}</text>
<view class="tag-apple" :class="getStateClass(item.state)">
{{ getStateText(item.state) }}
</view>
</view>
<text class="caption">{{ item.phone }}</text>
<text class="caption caption-sm">{{ item.createTime }}</text>
<button v-if="item.state === '5' || item.state === '3'"
class="btn-apple btn-warning btn-mini mt-10"
@tap="$emit('showSms', item.phone, item.state)">
上传短信码
</button>
</view>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
whitelistData: { type: Array, default: () => [] }
});
defineEmits(['refresh', 'add', 'showSms']);
const getStateText = (state) => ({ '1': '添加中', '2': '已添加', '3': '添加失败', '5': '短信确认中' })[state] || '未知';
const getStateClass = (state) => ({ '1': 'tag-warning', '2': 'tag-success', '3': 'tag-danger', '5': 'tag-primary' })[state] || '';
</script>
<style scoped lang="scss">
.whitelist-card {
.empty-whitelist { padding: 40rpx; text-align: center; }
.whitelist-list {
display: flex;
flex-direction: column;
gap: 16rpx;
.whitelist-item {
padding: 20rpx;
background: var(--gray-100);
border-radius: var(--radius-small);
.caption-sm { font-size: 20rpx; }
}
}
}
</style>

47
components/WifiCard.vue Normal file
View File

@@ -0,0 +1,47 @@
<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>
<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>
<button class="btn-apple btn-primary btn-mini" @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>
<button class="btn-apple btn-primary btn-mini" @tap="$emit('copy', deviceInfo.ssidPwd)">复制</button>
</view>
</view>
</view>
</template>
<script setup>
defineProps({
deviceInfo: { type: Object, default: () => ({}) }
});
defineEmits(['modify', 'copy']);
</script>
<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; }
}
}
</style>