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 || '';