fix: 实名认证运营商分类
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 55s

This commit is contained in:
luo
2026-07-02 15:33:38 +08:00
parent 85cdeac804
commit 3e81a216ad
2 changed files with 36 additions and 39 deletions

View File

@@ -58,6 +58,7 @@ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /build/dist/build/h5 /usr/share/nginx/html COPY --from=builder /build/dist/build/h5 /usr/share/nginx/html
COPY MP_verify_yU2Z8mp831jh6QX7.txt /usr/share/nginx/html/MP_verify_yU2Z8mp831jh6QX7.txt COPY MP_verify_yU2Z8mp831jh6QX7.txt /usr/share/nginx/html/MP_verify_yU2Z8mp831jh6QX7.txt
COPY MP_verify_0UoX8yClVgREjgPj.txt /usr/share/nginx/html/MP_verify_0UoX8yClVgREjgPj.txt COPY MP_verify_0UoX8yClVgREjgPj.txt /usr/share/nginx/html/MP_verify_0UoX8yClVgREjgPj.txt
COPY MP_verify_4E1dVbOcZ9KzTzoc.txt /usr/share/nginx/html/MP_verify_4E1dVbOcZ9KzTzoc.txt
# 暴露端口 # 暴露端口
EXPOSE 80 EXPOSE 80

View File

@@ -9,11 +9,11 @@
<view class="card" v-for="item in list" :key="item.iccid"> <view class="card" v-for="item in list" :key="item.iccid">
<view class="flex-row-g20"> <view class="flex-row-g20">
<view class="logo"> <view class="logo">
<image :src="getLogo(item.category).logo" mode="aspectFit"></image> <image :src="getCarrier(item.carrier_type).logo" mode="aspectFit"></image>
</view> </view>
<view class="flex-col-g20"> <view class="flex-col-g20">
<view class="iccid">ICCID: {{ item.iccid }}</view> <view class="iccid">ICCID: {{ item.iccid }}</view>
<view class="operator">运营商: {{ getLogo(item.category).name }}</view> <view class="operator">运营商: {{ getCarrier(item.carrier_type).name }}</view>
<view class="slot">卡槽位: {{ item.slot_position || '-' }}</view> <view class="slot">卡槽位: {{ item.slot_position || '-' }}</view>
</view> </view>
</view> </view>
@@ -39,7 +39,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
import { assetApi, deviceApi, realnameApi } from '@/api/index.js'; import { assetApi, realnameApi } from '@/api/index.js';
import { useUserStore } from '@/store/index.js'; import { useUserStore } from '@/store/index.js';
const userStore = useUserStore(); const userStore = useUserStore();
@@ -50,15 +50,25 @@
let currentModalIccid = ref(''); let currentModalIccid = ref('');
let currentCard = ref(null); let currentCard = ref(null);
let opratorList = reactive([ const carrierMap = {
{ category: '124', logo: 'https://img2.baidu.com/it/u=139558247,3893370039&fm=253&fmt=auto?w=529&h=500', name: '中国电信' }, CMCC: '中国移动',
{ category: '125', logo: 'https://img1.baidu.com/it/u=2816777816,1756344384&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500', name: '中国联通' }, CUCC: '中国联通',
{ category: '126', logo: 'https://img2.baidu.com/it/u=915783975,1594870591&fm=253&fmt=auto&app=120&f=PNG?w=182&h=182', name: '中国移动' } CTCC: '中国电信',
]); CBN: '中国广电'
};
const getLogo = (category) => { const carrierLogoMap = {
const operator = opratorList.find(item => item.category === category); CMCC: 'https://img2.baidu.com/it/u=915783975,1594870591&fm=253&fmt=auto&app=120&f=PNG?w=182&h=182',
return operator || opratorList[0]; 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 () => { const loadCards = async () => {
@@ -66,28 +76,22 @@
try { try {
const assetData = await assetApi.getInfo(userStore.state.identifier); const assetData = await assetApi.getInfo(userStore.state.identifier);
// 判断是否为设备
if (assetData.asset_type === 'device') { if (assetData.asset_type === 'device') {
// 是设备,调用设备卡列表接口 list.splice(0, list.length, ...(assetData.cards || []).map(card => ({
const data = await deviceApi.getCards(userStore.state.identifier); iccid: card.iccid,
if (data.cards && data.cards.length > 0) { carrier_type: card.carrier_type,
list.splice(0, list.length, ...data.cards.map(card => ({ slot_position: card.slot_position,
iccid: card.iccid, isRealName: card.real_name_status === 1
category: getCarrierCategory(card.carrier_name), })));
slot_position: card.slot_position, } else if (assetData.identifier) {
isRealName: card.real_name_status === 1 list.splice(0, list.length, {
}))); iccid: assetData.identifier,
} carrier_type: assetData.carrier_type,
slot_position: 1,
isRealName: assetData.real_name_status === 1
});
} else { } else {
// 不是设备(单卡),直接使用 asset info 数据 list.splice(0, list.length);
if (assetData.identifier) {
list.splice(0, list.length, {
iccid: assetData.identifier,
category: getCarrierCategory(assetData.carrier_name),
slot_position: 1,
isRealName: assetData.real_name_status === 1
});
}
} }
} catch (e) { } catch (e) {
console.error('加载卡列表失败', e); console.error('加载卡列表失败', e);
@@ -95,14 +99,6 @@
loading.value = false; 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 toReal = async (card) => { const toReal = async (card) => {
currentCard.value = card; currentCard.value = card;
currentModalIccid.value = card.iccid; currentModalIccid.value = card.iccid;