Initial project commit

This commit is contained in:
2026-05-09 16:40:29 +08:00
commit 02b0259a9e
267 changed files with 54891 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
export const formatSpotPrice = (spot) => {
if (!spot) {
return { label: "", isFree: false };
}
if (spot.is_free) {
return { label: "免费", isFree: true };
}
const min = spot.price_min;
const max = spot.price_max;
if (min != null && max != null) {
if (Number(min) === Number(max)) {
return { label: `收费 ¥${min}`, isFree: false };
}
return { label: `收费 ¥${min} - ¥${max}`, isFree: false };
}
if (min != null || max != null) {
return { label: `收费 ¥${min ?? max}`, isFree: false };
}
return { label: "收费", isFree: false };
};