From f9fead83cf30d038bf107df586bd3f182488e8d9 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 14:44:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=E5=8D=95=E5=8D=A1=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 17 ++++++++++++----- utils/env.js | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index edbcdeb..ef5591a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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,20 +242,21 @@ 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 => ({ deviceInfo.mchList = data.cards.map(card => ({ iccidMark: card.iccid || '-', category: card.slot_position, diff --git a/utils/env.js b/utils/env.js index c0f6995..4a2bc9f 100644 --- a/utils/env.js +++ b/utils/env.js @@ -1,3 +1,3 @@ -export const BASE_URL = 'https://cmp-api.boss160.cn'; +export const BASE_URL = 'https://cmp-api.xm-iot.cn'; export const APP_TYPE = 'official_account'; From 1edd299f1b98eb5fe6a81f738ba8d3e096a7e8a6 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 14:44:46 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=E5=8D=95=E5=8D=A1=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/env.js b/utils/env.js index 4a2bc9f..c0f6995 100644 --- a/utils/env.js +++ b/utils/env.js @@ -1,3 +1,3 @@ -export const BASE_URL = 'https://cmp-api.xm-iot.cn'; +export const BASE_URL = 'https://cmp-api.boss160.cn'; export const APP_TYPE = 'official_account'; From 4d9aa592540645f07a75f42b6289812441d2ce6a Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 15:04:26 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=E5=8D=95=E5=8D=A1=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index ef5591a..8182781 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -256,7 +256,6 @@ deviceInfo.currentIccid = currentCard?.iccid || '-'; // 卡列表 - deviceInfo.mchList = data.cards.map(card => ({ deviceInfo.mchList = data.cards.map(card => ({ iccidMark: card.iccid || '-', category: card.slot_position, From b566b0a5ea25ae362dd7f4aefddb5119b83c5609 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 16:17:48 +0800 Subject: [PATCH 4/6] fix: bug --- utils/env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/env.js b/utils/env.js index c0f6995..4a2bc9f 100644 --- a/utils/env.js +++ b/utils/env.js @@ -1,3 +1,3 @@ -export const BASE_URL = 'https://cmp-api.boss160.cn'; +export const BASE_URL = 'https://cmp-api.xm-iot.cn'; export const APP_TYPE = 'official_account'; From a0b2f69a8ee22c375c1eb362071fd1c4b5cb2780 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 16:21:23 +0800 Subject: [PATCH 5/6] fix: bug --- utils/env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/env.js b/utils/env.js index 4a2bc9f..c0f6995 100644 --- a/utils/env.js +++ b/utils/env.js @@ -1,3 +1,3 @@ -export const BASE_URL = 'https://cmp-api.xm-iot.cn'; +export const BASE_URL = 'https://cmp-api.boss160.cn'; export const APP_TYPE = 'official_account'; From 368c0d75e7860196ca0a353b2154e2c257b7c4fb Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 21 May 2026 16:40:43 +0800 Subject: [PATCH 6/6] fix:bug --- main.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index d700d91..cd0ac36 100644 --- a/main.js +++ b/main.js @@ -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 \ No newline at end of file +// #endif