兑换复验增加时间展示

This commit is contained in:
yml2213
2026-06-26 11:21:11 +08:00
parent 7cb62c0078
commit 031220d7e7
4 changed files with 81 additions and 13 deletions
+26
View File
@@ -67,6 +67,22 @@ const verifyStats = computed(() => {
return { verified, noRecord, failed, total: entries.length }
})
// 格式化时间戳
const formatTime = (timestamp: string) => {
if (!timestamp) return ''
const ts = parseInt(timestamp)
if (isNaN(ts)) return timestamp
// 斗鱼返回的是秒级时间戳
const date = new Date(ts * 1000)
return date.toLocaleString('zh-CN', {
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
})
}
// 执行复验
const handleVerify = async () => {
showToast('复验开始', '正在查询斗鱼兑换记录...', 'info')
@@ -203,6 +219,7 @@ const handleVerify = async () => {
<template v-if="entry.success">
<div v-if="entry.count > 0" class="verify-records">
<div v-for="(record, idx) in entry.records" :key="idx" class="verify-record">
<span class="record-time">{{ formatTime(record.time) }}</span>
<span class="record-name">{{ record.commodityName }}</span>
<span class="record-role">{{ record.showName }}</span>
</div>
@@ -412,6 +429,14 @@ const handleVerify = async () => {
display: flex;
gap: 12px;
font-size: 12px;
align-items: center;
}
.record-time {
color: var(--muted);
font-size: 11px;
white-space: nowrap;
min-width: 100px;
}
.record-name {
@@ -421,6 +446,7 @@ const handleVerify = async () => {
.record-role {
color: var(--muted);
font-size: 11px;
}
.verify-no-record {