+
+
+
+
+
-
-
-
User
-
{{ record.userName }}
-
...
+
+
+
+
+ {{
+ record.type
+ ? record.acceptUserAccount.userNickName
+ : record.userAccount.userNickName
+ }}
-
-
- ID
- :
- {{ record.account }}
-
-
+
+
+ ID:{{ record.type ? record.acceptUserAccount.account : record.userAccount.account }}
+
-
-
{{ record.amount }} {{ t('coins') }}
-
{{ record.time }}
+
+
+
+
+ {{ record.amount }} {{ t('coins') }}
+
+
+ {{ record.time }}
+
-
-
📋
-
{{ t('no_transaction_records') }}
-
{{ t('no_selling_records_yet') }}
+
+
+
📋
+
+ {{ t('no_transaction_records') }}
+
+
{{ t('no_selling_records_yet') }}
@@ -130,6 +247,7 @@ import { getFreightWaterFlow } from '@/api/wallet.js'
import { formatUTCCustom } from '@/utils/utcFormat.js'
import { getUserId } from '@/utils/userStore.js'
import { setDocumentDirection } from '@/locales/i18n'
+import { handleAvatarImageError } from '@/utils/imageHandler.js'
const { t, locale } = useI18n()
@@ -204,18 +322,10 @@ const fetchRecords = async () => {
if (response && response.status && response.body) {
// 处理返回的数据
records.value = response.body.map((item) => ({
- id: item.id,
- account: item.account,
- userId: item.acceptUserId,
- userName: `${item.acceptUserId.toString().slice(-6)}`, // 显示最后6位
- amount: getAmountDisplay(item.type, item.quantity),
- time: formatUTCCustom(item.createTime),
- type: item.type,
- quantity: item.quantity,
- balance: item.balance,
- origin: item.origin,
- remark: item.remark,
- rechargeType: item.rechargeType,
+ ...item,
+
+ amount: getAmountDisplay(item.type, item.quantity), //添加±号
+ time: formatUTCCustom(item.createTime), //格式化时间
}))
} else {
records.value = []
@@ -278,22 +388,6 @@ onMounted(async () => {
display: none;
}
-.content {
- padding: 16px;
- position: relative;
- z-index: 2;
-}
-
-/* 加载状态 */
-.loading-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 60px 20px;
- color: #666;
-}
-
.loading-spinner {
width: 32px;
height: 32px;
@@ -313,117 +407,12 @@ onMounted(async () => {
}
}
-.loading-state p {
- margin: 0;
- font-size: 14px;
-}
-
-/* 记录列表 */
-.records-list {
- display: flex;
- flex-direction: column;
- gap: 12px;
-}
-
-.record-item {
- background-color: white;
- padding: 16px;
- border-radius: 12px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
- display: flex;
- align-items: center;
- justify-content: space-between;
-}
-
-.record-info {
- display: flex;
- align-items: center;
- flex: 1;
-}
-
-.user-avatar {
- width: 50px;
- height: 50px;
- border-radius: 25px;
- background-color: #9ca3af;
- display: flex;
- align-items: center;
- justify-content: center;
- color: white;
- font-size: 18px;
- font-weight: 600;
- margin-right: 12px;
-}
-
-.record-details {
- flex: 1;
-}
-
-.record-details h4 {
- margin-bottom: 4px;
- font-size: 0.9em;
- font-weight: 600;
- color: #333;
-}
-
-.record-details p {
- font-size: 0.8em;
- font-weight: 590;
- color: rgba(0, 0, 0, 0.4);
-}
-
-.record-time {
- font-size: 0.8em;
- font-weight: 510;
- color: rgba(0, 0, 0, 0.4);
-}
-
-.record-amount {
- display: flex;
- flex-direction: column;
- align-items: flex-end;
- gap: 4px;
-}
-
-.coins-amount {
- font-size: 0.9em;
- color: rgba(0, 0, 0, 0.4);
- font-weight: 510;
-}
-
.transaction-type {
font-size: 12px;
color: #9ca3af;
margin-top: 2px;
}
-/* 空状态 */
-.empty-state {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 60px 20px;
- color: #666;
- text-align: center;
-}
-
-.empty-icon {
- font-size: 48px;
- margin-bottom: 16px;
-}
-
-.empty-state p {
- margin: 0 0 8px 0;
- font-size: 16px;
- font-weight: 500;
-}
-
-.empty-state span {
- font-size: 14px;
- color: #9ca3af;
-}
-
input::placeholder {
font-weight: bold;
color: rgba(0, 0, 0, 0.4);
@@ -463,17 +452,4 @@ input::placeholder {
[dir='rtl'] .search-icon {
transform: scaleX(-1);
}
-
-[dir='rtl'] .user-avatar {
- margin-right: 0;
- margin-left: 12px;
-}
-
-[dir='rtl'] .record-info {
- text-align: right;
-}
-
-[dir='rtl'] .record-amount {
- align-items: flex-start;
-}