From 5f7247b8a61e71abfbf0fe32d55f012cb6b61c95 Mon Sep 17 00:00:00 2001 From: Timi Date: Fri, 21 Aug 2026 15:50:11 +0800 Subject: [PATCH] fix point consume type --- src/pages/point/PointLedgerDetail.vue | 3 ++- src/pages/point/PointLedgerList.vue | 6 +++++- src/types/Point.ts | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/point/PointLedgerDetail.vue b/src/pages/point/PointLedgerDetail.vue index 6b5919e..afd4449 100644 --- a/src/pages/point/PointLedgerDetail.vue +++ b/src/pages/point/PointLedgerDetail.vue @@ -206,7 +206,8 @@ async function loadPageData(): Promise { function getChangeTypeText(changeType?: PointLedger["changeType"]): string { return ({ - EARN: "积分变化", + EARN: "发放积分", + CONSUME: "消费积分", REVOKE: "撤销积分", ADJUST: "人工调整" } as Record)[changeType || ""] || "未知流水"; diff --git a/src/pages/point/PointLedgerList.vue b/src/pages/point/PointLedgerList.vue index c00a6f2..f2534b0 100644 --- a/src/pages/point/PointLedgerList.vue +++ b/src/pages/point/PointLedgerList.vue @@ -194,6 +194,7 @@ const endDateVisible = ref(false); const changeTypeOptions = [ { label: "全部类型", value: "ALL" }, { label: "获得 EARN", value: "EARN" }, + { label: "消费 CONSUME", value: "CONSUME" }, { label: "撤销 REVOKE", value: "REVOKE" }, { label: "调整 ADJUST", value: "ADJUST" } ]; @@ -386,7 +387,10 @@ function getLedgerDelta(item: PointLedger): string { function getLedgerShortType(item: PointLedger): string { if (item.changeType === "EARN") { - return 0 < (item.pointDelta || 0) ? "获得" : "消耗"; + return "获得"; + } + if (item.changeType === "CONSUME") { + return "消耗"; } return item.changeType === "REVOKE" ? "撤销" : "调整"; } diff --git a/src/types/Point.ts b/src/types/Point.ts index b1336da..1754c60 100644 --- a/src/types/Point.ts +++ b/src/types/Point.ts @@ -4,9 +4,9 @@ import type { Customer } from "@/types/Customer"; export type PointRuleStatus = "DRAFT" | "ACTIVE" | "INACTIVE" | "DELETED"; export type PointRuleTriggerType = "EVERY_TIME" | "FIRST_TIME" | "AFTER_COUNT_EVERY_TIME" | "SOURCE_VALUE" | "CUSTOMER_EVENT_VALUE_TIER"; export type PointRuleMode = "FIXED" | "SOURCE_VALUE" | "TIER"; -export type PointLedgerChangeType = "EARN" | "REVOKE" | "ADJUST"; +export type PointLedgerChangeType = "EARN" | "CONSUME" | "REVOKE" | "ADJUST"; export type PointLedgerDirection = "INCREASE" | "DECREASE"; -export type PointAction = "EARN" | "CONSUME"; +export type PointAction = Extract; export type PointRuleCondition = { min?: number;