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