This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</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="caption mb-xs">信号判断</view>
|
||||
<view class="metric-value">{{ deviceInfo.signal_quality || '暂无数据' }}</view>
|
||||
</view>
|
||||
<view class="metric-item flex-col-center">
|
||||
@@ -36,7 +36,7 @@
|
||||
<view class="metric-value">{{ deviceInfo.connCnt }}/{{ deviceInfo.max_clients }}</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-text">{{ deviceInfo.signal_bad_reason }}</text>
|
||||
</view>
|
||||
@@ -52,6 +52,10 @@
|
||||
});
|
||||
|
||||
defineEmits(['authentication']);
|
||||
|
||||
const shouldShowSignalReason = (deviceInfo) =>
|
||||
['信号较弱', '信号很差', '暂无数据'].includes(deviceInfo?.signal_quality) &&
|
||||
!!deviceInfo?.signal_bad_reason;
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -86,8 +90,13 @@
|
||||
|
||||
.signal-reason {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
font-size: 24rpx;
|
||||
line-height: 1.5;
|
||||
text-align: center;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
|
||||
@@ -289,19 +289,6 @@
|
||||
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 组件传递过来)
|
||||
const handlePackageLoaded = (activePackage) => {
|
||||
if (activePackage && activePackage.expires_at) {
|
||||
|
||||
@@ -196,9 +196,9 @@ const handleScanLogin = async () => {
|
||||
|
||||
const getPathDeviceId = () => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const deviceId = params.get('device_id');
|
||||
const idf = params.get('identifier');
|
||||
if (deviceId) {
|
||||
identifier.value = deviceId;
|
||||
identifier.value = idf;
|
||||
handleLogin();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user