From b1252e8a60adda1a25bebf806ceb6c66252e27f1 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Sat, 27 Sep 2025 15:41:52 +0800 Subject: [PATCH] =?UTF-8?q?style(=E8=BD=AC=E8=B4=A6=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=A1=B5):=20=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/InformationDetailsView.vue | 151 +++++++++++---------------- 1 file changed, 63 insertions(+), 88 deletions(-) diff --git a/src/views/InformationDetailsView.vue b/src/views/InformationDetailsView.vue index 25f8efb..725bdf6 100644 --- a/src/views/InformationDetailsView.vue +++ b/src/views/InformationDetailsView.vue @@ -18,40 +18,30 @@
-
+
- -
- -
- {{ getAvatarPlaceholder(transaction.userNickname) }} -
-
-
-

{{ transaction.eventDescribe }}

- - -
- {{ transaction.amount > 0 ? '+' : '' }}${{ Math.abs(transaction.amount) }} +
+ {{ transaction.amount > 0 ? '+' : '-' }}{{ Math.abs(transaction.amount) }}
@@ -70,7 +60,7 @@ import { ref, onMounted } from 'vue' import MobileHeader from '../components/MobileHeader.vue' import { getWalletDetails, formatDateTime, formatEventDescribe } from '../api/wallet.js' -import {formatUTCTime} from "@/utils/utcFormat.js"; +import { formatUTCTimeClean } from '@/utils/utcFormat.js' const transactions = ref([]) const loading = ref(false) @@ -86,7 +76,7 @@ const fetchData = async () => { // 处理API返回的数据 if (response.body && Array.isArray(response.body)) { - transactions.value = response.body.map(item => { + transactions.value = response.body.map((item) => { // 根据 event 字段判断是加还是减 let amount = item.amount let isPositive = false @@ -118,7 +108,7 @@ const fetchData = async () => { return { id: item.id, eventDescribe: formatEventDescribe(item.eventDescribe), - createTime: formatUTCTime(item.createTime), + createTime: formatUTCTimeClean(item.createTime), amount: amount, balance: item.balance, event: item.event, @@ -126,7 +116,7 @@ const fetchData = async () => { // 添加用户信息字段 userAvatar: item.details?.userAvatar || null, userNickname: item.details?.userNickname || null, - account: item.details?.account || null + account: item.details?.account || null, } }) } else { @@ -146,11 +136,6 @@ const getAvatarPlaceholder = (nickname) => { return nickname.charAt(0).toUpperCase() } -// 处理图片加载错误 -const handleImageError = (event) => { - console.warn('头像加载失败:', event.target.src) -} - // 页面加载时获取数据 onMounted(() => { fetchData() @@ -158,6 +143,11 @@ onMounted(() => {