优化时间展示

This commit is contained in:
yml
2026-05-23 01:56:16 +08:00
parent c9db34ddda
commit 744f572f6c
17 changed files with 85 additions and 24 deletions
@@ -3,6 +3,7 @@ import { ElMessage } from 'element-plus'
import { onMounted, ref } from 'vue'
import { fetchNotifications, markNotificationRead, type NotificationItem } from '@/api/notifications'
import { formatDateTime } from '@/utils/time'
const loading = ref(false)
const notifications = ref<NotificationItem[]>([])
@@ -40,7 +41,7 @@ async function markRead(id: number) {
<span>{{ item.type }}</span>
<h2>{{ item.title }}</h2>
<p>{{ item.content }}</p>
<small>{{ item.created_at }}</small>
<small>{{ formatDateTime(item.created_at) }}</small>
</div>
<div class="notification-actions">
<RouterLink v-if="item.biz_type === 'order' && item.biz_id" :to="`/orders/${item.biz_id}`">
@@ -17,6 +17,7 @@ import {
type Order,
} from '@/api/orders'
import { useSessionStore } from '@/stores/session'
import { formatDateTime } from '@/utils/time'
const route = useRoute()
const router = useRouter()
@@ -207,8 +208,8 @@ function readError(error: unknown, fallback: string) {
<div v-if="order" class="order-panel">
<p>租期{{ order.rent_hours }} 小时</p>
<p>开始{{ order.rent_start_at || '未开始' }}</p>
<p>结束{{ order.rent_end_at || '未设置' }}</p>
<p>开始{{ formatDateTime(order.rent_start_at, '未开始') }}</p>
<p>结束{{ formatDateTime(order.rent_end_at, '未设置') }}</p>
<el-button v-if="order.status === 'pending_handoff'" type="danger" :loading="cancelling" @click="handleCancel">
取消订单并释放账号
</el-button>
@@ -220,7 +221,7 @@ function readError(error: unknown, fallback: string) {
<div v-for="record in handoffRecords" :key="record.id" class="timeline-item">
<strong>{{ record.type }}</strong>
<p>{{ record.content }}</p>
<span>{{ record.created_at }}</span>
<span>{{ formatDateTime(record.created_at) }}</span>
</div>
</div>
+2 -1
View File
@@ -4,6 +4,7 @@ import { onMounted, reactive, ref } from 'vue'
import { getRealnameStatus, startRealname, type RealnameStatus } from '@/api/realname'
import { useSessionStore } from '@/stores/session'
import { formatDateTime } from '@/utils/time'
const session = useSessionStore()
const loading = ref(false)
@@ -61,7 +62,7 @@ function readError(error: unknown, fallback: string) {
<strong>{{ status.status }}</strong>
<p v-if="status.masked_name">姓名{{ status.masked_name }}</p>
<p v-if="status.masked_id_no">证件号{{ status.masked_id_no }}</p>
<p v-if="status.verified_at">通过时间{{ status.verified_at }}</p>
<p v-if="status.verified_at">通过时间{{ formatDateTime(status.verified_at) }}</p>
</div>
<el-form class="login-form" label-position="top">
+4 -1
View File
@@ -2,6 +2,7 @@
import { onMounted, ref } from 'vue'
import { fetchWalletBalance, fetchWalletLedger, type WalletAccount, type WalletLedger } from '@/api/wallet'
import { formatDateTime } from '@/utils/time'
const loading = ref(false)
const account = ref<WalletAccount | null>(null)
@@ -52,7 +53,9 @@ async function loadWallet() {
<el-table-column prop="balance_type" label="余额类型" width="110" />
<el-table-column prop="balance_after" label="变化后余额" width="130" />
<el-table-column prop="remark" label="备注" min-width="220" />
<el-table-column prop="created_at" label="时间" width="180" />
<el-table-column label="时间" width="180">
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
</el-table-column>
</el-table>
</section>
</template>