diff --git a/src/pages-aigc/pointsDetails/components/LedgerCard/index.vue b/src/pages-aigc/pointsDetails/components/LedgerCard/index.vue index 32f71c0..c575321 100644 --- a/src/pages-aigc/pointsDetails/components/LedgerCard/index.vue +++ b/src/pages-aigc/pointsDetails/components/LedgerCard/index.vue @@ -1,15 +1,15 @@ @@ -23,7 +23,27 @@ const props = defineProps({ }, }); -const isPlus = computed(() => String(props.record.delta || "").startsWith("+")); +const changePoints = computed(() => { + const value = Number(props.record.changePoints); + return Number.isFinite(value) ? value : 0; +}); + +const changePointsText = computed(() => { + return changePoints.value > 0 ? `+${changePoints.value}` : String(changePoints.value); +}); + +const isPlus = computed(() => changePoints.value > 0); +const isMinus = computed(() => changePoints.value < 0); + +const statusText = computed(() => { + const statusName = props.record.statusName; + if (statusName !== undefined && statusName !== null && statusName !== "") { + return statusName; + } + + const status = props.record.status; + return status === undefined || status === null ? "" : String(status); +});