This commit is contained in:
@@ -10,19 +10,22 @@
|
||||
<view class="flex-row-sb mt-30">
|
||||
<view class="flex-row-g20">
|
||||
<view class="logo">
|
||||
<image :src="getLogo(item.category).logo" mode="aspectFit"></image>
|
||||
<image :src="getCarrier(item.carrier_type).logo" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="flex-col-g20">
|
||||
<view class="flex-row-g20">
|
||||
<view class="iccid">{{ item.iccid }}</view>
|
||||
<view class="operator">
|
||||
<up-tag type="success" size="mini">{{ getLogo(item.category).name }}</up-tag>
|
||||
<up-tag type="success" size="mini">{{ getCarrier(item.carrier_type).name }}</up-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row-g20">
|
||||
<view class="operator">
|
||||
<up-tag :type="item.real_name_status === 1 ? 'primary' : 'success'" size="mini">{{ item.real_name_status === 1 ? '已实名' : '未实名' }}</up-tag>
|
||||
</view>
|
||||
<view v-if="item.network_status" class="operator">
|
||||
<up-tag type="info" size="mini">{{ item.network_status }}</up-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="slot">卡槽位: {{ item.slot_position || '-' }}</view>
|
||||
</view>
|
||||
@@ -67,15 +70,25 @@
|
||||
let showIccidModal = ref(false);
|
||||
let currentModalIccid = ref('');
|
||||
|
||||
let opratorList = reactive([
|
||||
{ category: '124', logo: 'https://img2.baidu.com/it/u=139558247,3893370039&fm=253&fmt=auto?w=529&h=500', name: '中国电信' },
|
||||
{ category: '125', logo: 'https://img1.baidu.com/it/u=2816777816,1756344384&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500', name: '中国联通' },
|
||||
{ category: '126', logo: 'https://img2.baidu.com/it/u=915783975,1594870591&fm=253&fmt=auto&app=120&f=PNG?w=182&h=182', name: '中国移动' }
|
||||
]);
|
||||
const carrierMap = {
|
||||
CMCC: '中国移动',
|
||||
CUCC: '中国联通',
|
||||
CTCC: '中国电信',
|
||||
CBN: '中国广电'
|
||||
};
|
||||
|
||||
const getLogo = (category) => {
|
||||
const operator = opratorList.find(item => item.category === category);
|
||||
return operator || opratorList[0];
|
||||
const carrierLogoMap = {
|
||||
CMCC: 'https://img2.baidu.com/it/u=915783975,1594870591&fm=253&fmt=auto&app=120&f=PNG?w=182&h=182',
|
||||
CUCC: 'https://img1.baidu.com/it/u=2816777816,1756344384&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
|
||||
CTCC: 'https://img2.baidu.com/it/u=139558247,3893370039&fm=253&fmt=auto?w=529&h=500',
|
||||
CBN: 'https://img1.baidu.com/it/u=3160680953,3401650303&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
|
||||
};
|
||||
|
||||
const getCarrier = (carrierType) => {
|
||||
return {
|
||||
name: carrierMap[carrierType] || '-',
|
||||
logo: carrierLogoMap[carrierType] || carrierLogoMap.CMCC
|
||||
};
|
||||
};
|
||||
|
||||
const loadCards = async () => {
|
||||
@@ -90,11 +103,12 @@
|
||||
if (data.cards && data.cards.length > 0) {
|
||||
mchList.splice(0, mchList.length, ...data.cards.map(card => ({
|
||||
iccid: card.iccid,
|
||||
carrier_type: card.carrier_type,
|
||||
carrier_name: card.carrier_name,
|
||||
is_current: card.is_active,
|
||||
real_name_status: card.real_name_status,
|
||||
slot_position: card.slot_position,
|
||||
category: getCarrierCategory(card.carrier_name)
|
||||
network_status: card.network_status,
|
||||
slot_position: card.slot_position
|
||||
})));
|
||||
}
|
||||
} else {
|
||||
@@ -102,11 +116,12 @@
|
||||
if (assetData.identifier) {
|
||||
mchList.splice(0, mchList.length, {
|
||||
iccid: assetData.identifier,
|
||||
carrier_type: assetData.carrier_type,
|
||||
carrier_name: assetData.carrier_name,
|
||||
is_current: true,
|
||||
real_name_status: assetData.real_name_status,
|
||||
slot_position: 1,
|
||||
category: getCarrierCategory(assetData.carrier_name)
|
||||
network_status: assetData.network_status,
|
||||
slot_position: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -116,14 +131,6 @@
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
const getCarrierCategory = (carrierName) => {
|
||||
if (!carrierName) return '126';
|
||||
if (carrierName.includes('电信')) return '124';
|
||||
if (carrierName.includes('联通')) return '125';
|
||||
if (carrierName.includes('移动')) return '126';
|
||||
return '126';
|
||||
};
|
||||
|
||||
const switchOperator = async (item) => {
|
||||
switching.value = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user