This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="device-metrics flex-row-sb mt-md">
|
<view class="device-metrics flex-row-sb mt-md">
|
||||||
<view class="metric-item flex-col-center">
|
<view class="metric-item flex-col-center">
|
||||||
<view class="caption mb-xs">信号强度</view>
|
<view class="caption mb-xs">信号判断</view>
|
||||||
<view class="metric-value">{{ deviceInfo.signal_quality || '暂无数据' }}</view>
|
<view class="metric-value">{{ deviceInfo.signal_quality || '暂无数据' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="metric-item flex-col-center">
|
<view class="metric-item flex-col-center">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<view class="metric-value">{{ deviceInfo.connCnt }}/{{ deviceInfo.max_clients }}</view>
|
<view class="metric-value">{{ deviceInfo.connCnt }}/{{ deviceInfo.max_clients }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="deviceInfo.signal_bad_reason" class="signal-reason">
|
<view v-if="shouldShowSignalReason(deviceInfo)" class="signal-reason">
|
||||||
<text class="signal-reason-label">怀疑原因:</text>
|
<text class="signal-reason-label">怀疑原因:</text>
|
||||||
<text class="signal-reason-text">{{ deviceInfo.signal_bad_reason }}</text>
|
<text class="signal-reason-text">{{ deviceInfo.signal_bad_reason }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -52,6 +52,10 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
defineEmits(['authentication']);
|
defineEmits(['authentication']);
|
||||||
|
|
||||||
|
const shouldShowSignalReason = (deviceInfo) =>
|
||||||
|
['信号较弱', '信号很差', '暂无数据'].includes(deviceInfo?.signal_quality) &&
|
||||||
|
!!deviceInfo?.signal_bad_reason;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@@ -86,8 +90,13 @@
|
|||||||
|
|
||||||
.signal-reason {
|
.signal-reason {
|
||||||
margin-top: 16rpx;
|
margin-top: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -289,19 +289,6 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 计算信号强度
|
|
||||||
const calculateSignalStrength = (rsrp, rsrq, rssi) => {
|
|
||||||
// 简单的信号强度计算逻辑
|
|
||||||
if (!rsrp && !rsrq && !rssi) return '-';
|
|
||||||
|
|
||||||
const rsrpNum = parseInt(rsrp);
|
|
||||||
if (isNaN(rsrpNum)) return '-';
|
|
||||||
|
|
||||||
if (rsrpNum >= -80) return '强';
|
|
||||||
if (rsrpNum >= -95) return '中';
|
|
||||||
return '弱';
|
|
||||||
};
|
|
||||||
|
|
||||||
// 处理套餐加载完成事件(从 TrafficCard 组件传递过来)
|
// 处理套餐加载完成事件(从 TrafficCard 组件传递过来)
|
||||||
const handlePackageLoaded = (activePackage) => {
|
const handlePackageLoaded = (activePackage) => {
|
||||||
if (activePackage && activePackage.expires_at) {
|
if (activePackage && activePackage.expires_at) {
|
||||||
|
|||||||
@@ -196,9 +196,9 @@ const handleScanLogin = async () => {
|
|||||||
|
|
||||||
const getPathDeviceId = () => {
|
const getPathDeviceId = () => {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const deviceId = params.get('device_id');
|
const idf = params.get('identifier');
|
||||||
if (deviceId) {
|
if (deviceId) {
|
||||||
identifier.value = deviceId;
|
identifier.value = idf;
|
||||||
handleLogin();
|
handleLogin();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user