This commit is contained in:
eric
2026-03-10 11:48:50 -05:00
parent eb33ed9360
commit 296d703307
41 changed files with 9072 additions and 121 deletions

28
config/promo.config.ts Normal file
View File

@@ -0,0 +1,28 @@
/**
* 限时特惠 / 促销展示配置
* 恢复原价日期 = 当天 + 2 天
*/
const DAYS_OFFSET = 2;
function getRestoreDate(): Date {
const d = new Date();
d.setDate(d.getDate() + DAYS_OFFSET);
return d;
}
/**
* 格式化为中文展示3月12日
*/
export function formatRestoreDateShort(): string {
const d = getRestoreDate();
return `${d.getMonth() + 1}${d.getDate()}`;
}
/**
* 格式化为完整中文2025年3月12日
*/
export function formatRestoreDateFull(): string {
const d = getRestoreDate();
return `${d.getFullYear()}${d.getMonth() + 1}${d.getDate()}`;
}