style(point): use time label component

This commit is contained in:
Timi
2026-11-18 16:48:12 +08:00
parent 754e61eb5d
commit aa48ebf4ad
+12 -7
View File
@@ -21,7 +21,11 @@
<t-cell title="兑换数量" :note="`${quantityText(item.quantity)} ${item.unitSnapshot || ''}`" />
<t-cell title="积分" :note="`${formatPoint(item.actualPointCost)}${item.actualPointCost !== item.defaultPointCost ? '(已减免)' : ''}`" />
<t-cell title="状态" :note="statusText(item.status)" />
<t-cell title="兑换时间" :note="timeText(item.redeemedAt)" />
<t-cell title="兑换时间">
<template #note>
<time-label :timestamp="item.redeemedAt" underline />
</template>
</t-cell>
<t-cell v-if="item.remark" title="备注" :note="item.remark" />
<div class="photo-wrap bg-white">
<attachment-selector :items="redemptionPhotoItems" title="兑换凭证" readonly />
@@ -32,8 +36,12 @@
v-for="record in returnList"
:key="record.id"
:title="`退货 ${quantityText(record.quantity)} ${item?.unitSnapshot || ''}`"
:note="`${formatPoint(record.pointCost)} · ${timeText(record.returnedAt)}`"
/>
:note="formatPoint(record.pointCost)"
>
<template #description>
<time-label :timestamp="record.returnedAt" underline />
</template>
</t-cell>
</t-cell-group>
<t-empty v-if="!item" :description="loading ? '正在加载兑换单' : '兑换单不存在'" />
<t-button
@@ -96,6 +104,7 @@ import { formatWanInteger } from "@/utils/money";
import { comparePackageQuantity, getPackageQuantityText, normalizePackageQuantity } from "@/utils/package";
import { uploadPhotoList } from "@/utils/photo";
import { permissionCodes } from "@/utils/permission";
import { TimeLabel } from "timi-web";
defineOptions({ name: "PointRedemptionDetail" });
@@ -248,10 +257,6 @@ function statusText(value?: PointRedemptionStatus): string {
} as Record<string, string>)[value || ""] || "未知";
}
function timeText(value?: number): string {
return value ? new Date(value).toLocaleString("zh-CN", { hour12: false }) : "-";
}
onMounted(load);
watch(() => [props.redemptionId, route.params.id], load);
</script>