Compare commits

...

6 Commits

Author SHA1 Message Date
sexygoat
368c0d75e7 fix:bug
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 55s
2026-05-21 16:40:43 +08:00
sexygoat
a0b2f69a8e fix: bug
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 11s
2026-05-21 16:21:23 +08:00
sexygoat
b566b0a5ea fix: bug
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m1s
2026-05-21 16:17:48 +08:00
sexygoat
4d9aa59254 fix:单卡设备显示字段
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 56s
2026-05-21 15:04:26 +08:00
sexygoat
1edd299f1b fix:单卡设备显示字段
Some checks failed
构建并部署前端到生产环境 / build-and-deploy (push) Failing after 12s
2026-05-21 14:44:46 +08:00
sexygoat
f9fead83cf fix:单卡设备显示字段
Some checks failed
构建并部署前端到生产环境 / build-and-deploy (push) Has been cancelled
2026-05-21 14:44:10 +08:00
2 changed files with 57 additions and 6 deletions

47
main.js
View File

@@ -1,11 +1,55 @@
import App from './App'
import uviewPlus from 'uview-plus'
const TAB_BAR_STYLE_NOT_FOUND_ERROR = 'setTabBarStyle:fail not TabBar page'
const shouldIgnoreTabBarStyleError = (error) => {
const message = typeof error === 'string'
? error
: error?.errMsg || error?.message || ''
return message.includes(TAB_BAR_STYLE_NOT_FOUND_ERROR)
}
const patchSafeSetTabBarStyle = () => {
if (typeof uni === 'undefined' || typeof uni.setTabBarStyle !== 'function') {
return
}
if (uni.setTabBarStyle.__upSafePatched) {
return
}
const originalSetTabBarStyle = uni.setTabBarStyle.bind(uni)
const safeSetTabBarStyle = (options = {}) => {
try {
const result = originalSetTabBarStyle(options)
if (result && typeof result.catch === 'function') {
return result.catch((error) => {
if (shouldIgnoreTabBarStyleError(error)) {
return undefined
}
return Promise.reject(error)
})
}
return result
} catch (error) {
if (shouldIgnoreTabBarStyleError(error)) {
return undefined
}
throw error
}
}
safeSetTabBarStyle.__upSafePatched = true
uni.setTabBarStyle = safeSetTabBarStyle
}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
patchSafeSetTabBarStyle()
const app = new Vue({
...App
})
@@ -15,6 +59,7 @@ app.$mount()
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
patchSafeSetTabBarStyle()
const app = createSSRApp(App)
// 使用 uview-plus (版本 3.4.0+)
app.use(uviewPlus, () => {
@@ -34,4 +79,4 @@ export function createApp() {
app
}
}
// #endif
// #endif

View File

@@ -216,6 +216,12 @@
return dateStr.split('T')[0] || '-';
};
const resolveCurrentCard = (cards = []) => {
if (cards.length === 1) return cards[0];
if (cards.length > 1) return cards.find(card => card.is_current) || null;
return null;
};
const loadAssetInfo = async () => {
const identifier = userStore.state.identifier;
if (!identifier) return;
@@ -236,18 +242,18 @@
deviceInfo.expireDate = formatDate(data.current_package_expires_at);
deviceInfo.iccid = data.iccid || '-';
deviceInfo.walletBalance = data.wallet_balance ?? 0;
isRealName.value = data.real_name_status === 1;
realNameStatus.value = data.real_name_status === 1 ? '已实名' : '未实名';
const currentCard = resolveCurrentCard(data.cards || []);
const realNameStatusCode = currentCard?.real_name_status ?? data.real_name_status;
isRealName.value = realNameStatusCode === 1;
realNameStatus.value = realNameStatusCode === 1 ? '已实名' : '未实名';
boundPhone.value = data.bound_phone || '';
alreadyBindPhone.value = !!data.bound_phone;
// 流量信息已由 TrafficCard 组件独立获取,这里不再处理
// 当前卡信息
let currentCard = null;
if (data.cards && data.cards.length > 0) {
currentCard = data.cards.find(card => card.is_current) || '';
deviceInfo.currentIccid = currentCard.iccid || '-';
deviceInfo.currentIccid = currentCard?.iccid || '-';
// 卡列表
deviceInfo.mchList = data.cards.map(card => ({