From 9fadbd297b1652bd3f5fb3cd3600a267c65414f9 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Wed, 6 May 2026 10:16:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/FunctionCard.vue | 18 ++++++++++++------ components/UserInfoCard.vue | 18 +++++++++++++----- pages/index/index.vue | 14 ++++++++++++-- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/components/FunctionCard.vue b/components/FunctionCard.vue index 6c2e805..c7c311b 100644 --- a/components/FunctionCard.vue +++ b/components/FunctionCard.vue @@ -3,7 +3,7 @@ 功能菜单 @@ -82,9 +82,9 @@ - 我的钱包 + 钱包 - 我的钱包 + {{ walletText }} @@ -114,6 +114,8 @@ @@ -189,4 +195,4 @@ .text-primary { color: var(--primary) !important; } - \ No newline at end of file + diff --git a/components/UserInfoCard.vue b/components/UserInfoCard.vue index a48d4fa..22ce06e 100644 --- a/components/UserInfoCard.vue +++ b/components/UserInfoCard.vue @@ -8,6 +8,7 @@ {{ currentCardNo || '-' }} + 套餐名称:{{ deviceInfo.packageName || '-' }} 套餐到期时间:{{ deviceInfo.expireDate || '-' }} @@ -30,14 +31,12 @@ currentCardNo: { type: String, default: '' }, deviceInfo: { type: Object, default: () => ({}) }, onlineStatus: { type: String, default: '离线' }, - networkStatus: { type: String, default: '离线' }, + networkStatus: { type: [String, Number], default: '离线' }, isDevice: { type: Boolean, default: true } }); - // 默认头像 const defaultAvatar = 'https://img1.baidu.com/it/u=2462918877,1866131262&fm=253&fmt=auto&app=138&f=JPEG?w=506&h=500'; - // 用户头像,优先使用 store 中的头像,否则使用默认头像 const avatarUrl = computed(() => { return userStore.state.userInfo.avatar || defaultAvatar; }); @@ -46,14 +45,23 @@ diff --git a/pages/index/index.vue b/pages/index/index.vue index 2ffff67..c913052 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ + :isDevice="userInfo.isDevice" :walletBalance="deviceInfo.walletBalance" @enter="enterDetail" @sync="onSync"> @@ -147,7 +147,9 @@ connect: 0, network_status: 1, status: 1, + packageName: '-', expireDate: '-', + walletBalance: 0, currentIccid: '-', category: '-', phone: '-', @@ -206,6 +208,11 @@ let smsCodePhone = ref(''); let smsCode = ref(''); + const formatDate = (dateStr) => { + if (!dateStr) return '-'; + return dateStr.split('T')[0] || '-'; + }; + const loadAssetInfo = async () => { const identifier = userStore.state.identifier; if (!identifier) return; @@ -222,6 +229,9 @@ deviceInfo.imei = data.imei || '-'; deviceInfo.asset_type = data.asset_type || 'device'; deviceInfo.bound_phone = data.bound_phone || ''; + deviceInfo.packageName = data.current_package || '-'; + deviceInfo.expireDate = formatDate(data.current_package_expires_at); + deviceInfo.walletBalance = data.wallet_balance ?? 0; isRealName.value = data.real_name_status === 1; realNameStatus.value = data.real_name_status === 1 ? '已实名' : '未实名'; boundPhone.value = data.bound_phone || '';