support consume point

This commit is contained in:
Timi
2026-08-18 16:46:13 +08:00
parent eaee1ae49b
commit eb6b8beb6b
14 changed files with 281 additions and 99 deletions
+10 -3
View File
@@ -34,7 +34,7 @@
@click="toEdit(item)"
>
<template #left-icon>
<div class="point">
<div class="point" :class="{ 'consume': item.pointValue && item.pointValue < 0 }">
<t-icon name="money" />
<span v-text="getPointText(item)" />
</div>
@@ -242,7 +242,10 @@ function getPointText(rule: PointRule): string {
if (rule.pointMode === "TIER") {
return "分档";
}
return rule.pointValue === undefined || rule.pointValue === null ? "?" : String(rule.pointValue);
if (rule.pointValue === undefined || rule.pointValue === null) {
return "?";
}
return `${0 < rule.pointValue ? "+" : "-"}${Math.abs(rule.pointValue)}`;
}
function getStatusText(status?: PointRuleStatus): string {
@@ -323,11 +326,15 @@ onMounted(async () => {
.item {
.point {
width: 3rem;
width: 4rem;
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
&.consume {
color: var(--td-error-color);
}
}
.title {