feat: 补齐权益使用成功的弹窗

This commit is contained in:
zoujing committed 2026-09-18 15:00:00 +08:00
1 parent a3698add2a
commit 2f240246bc
6 files changed
+160 -37

No files matched your search

+10
View File
@@ -72,6 +72,15 @@ export const uid = () =>
/** 2026-09-12 / 2026-09-12T02:00:00Z → 2026.09.12(接口时间为 RFC3339 UTC,只取日期段) */
export const dotDate = (str) => String(str || "").slice(0, 10).replace(/-/g, ".");
/** 使用时间文案:RFC3339 → 2026.09.18 14:32(接口为 UTC,按设备时区还原) */
export const dotDateTime = (str) => {
if (!str) return "";
const d = new Date(String(str));
if (Number.isNaN(d.getTime())) return dotDate(str);
const p = (n) => String(n).padStart(2, "0");
return `${d.getFullYear()}.${p(d.getMonth() + 1)}.${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
};
/** 有效期区间文案:2026.09.12 - 09.18 */
export const dateRangeText = (from, to) => {
if (!from && !to) return "";
@@ -93,5 +102,6 @@ export default {
cnDate,
uid,
dotDate,
dotDateTime,
dateRangeText,
};