fix: carrier_type
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m33s

This commit is contained in:
sexygoat
2026-04-27 12:33:26 +08:00
parent f86281017a
commit fbf5371086
3 changed files with 13 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
<view class="card device-status-card"> <view class="card device-status-card">
<view class="card-header mb-md flex-row-sb"> <view class="card-header mb-md flex-row-sb">
<view class="title">设备信息</view> <view class="title">设备信息</view>
<view class="tag-apple tag-success">{{ getOperator(deviceInfo.currentIccid) }}</view> <view class="tag-apple tag-success">{{ deviceInfo.carrier_name || '-' }}</view>
</view> </view>
<view class="device-info flex-col-g16"> <view class="device-info flex-col-g16">
<view class="info-row flex-row-sb"> <view class="info-row flex-row-sb">
@@ -54,10 +54,6 @@
defineEmits(['authentication']); defineEmits(['authentication']);
const getOperator = (iccid) => {
return '中国电信';
};
const getSignalText = (rssi) => rssi || '强'; const getSignalText = (rssi) => rssi || '强';
const statusText = computed(() => { const statusText = computed(() => {

View File

@@ -229,9 +229,9 @@
// 流量信息已由 TrafficCard 组件独立获取,这里不再处理 // 流量信息已由 TrafficCard 组件独立获取,这里不再处理
// 当前卡信息 // 当前卡信息
let currentCard = null;
if (data.cards && data.cards.length > 0) { if (data.cards && data.cards.length > 0) {
// 找到当前卡 currentCard = data.cards.find(card => card.is_current) || '';
const currentCard = data.cards.find(card => card.is_current) || data.cards[0];
deviceInfo.currentIccid = currentCard.iccid || '-'; deviceInfo.currentIccid = currentCard.iccid || '-';
// 卡列表 // 卡列表
@@ -245,6 +245,15 @@
deviceInfo.mchList = []; deviceInfo.mchList = [];
} }
// 运营商信息
const carrierTypeMap = {
CMCC: '中国移动',
CUCC: '中国联通',
CTCC: '中国电信',
CBN: '中国广电'
};
deviceInfo.carrier_name = (currentCard && carrierTypeMap[currentCard.carrier_type]) || '-';
// 设备实时信息 // 设备实时信息
if (data.device_realtime) { if (data.device_realtime) {
const rt = data.device_realtime; const rt = data.device_realtime;

View File

@@ -36,7 +36,7 @@ export const useUserStore = () => {
}; };
const setUserInfo = (userInfo) => { const setUserInfo = (userInfo) => {
state.userInfo = userInfo; Object.assign(state.userInfo, userInfo);
uni.setStorageSync('userInfo', userInfo); uni.setStorageSync('userInfo', userInfo);
}; };