feat: batch update - gift card breakdown spec, backend APIs, miniprogram pages, ETL finance recharge, docs & migrations

This commit is contained in:
Neo
2026-03-20 01:43:48 +08:00
parent 075caf067f
commit 79f9a0e1da
437 changed files with 118603 additions and 976 deletions

View File

@@ -0,0 +1,21 @@
/**
* 爱心评分映射工具函数
* 纯函数,无 wx.* 依赖
*/
/**
* 将 0-10 分数映射为爱心 Emoji
* >8.5 → 💖, >7 → 🧡, >5 → 💛, ≤5 → 💙
* 超出 [0,10] 范围的值会被 clamp
* @param score 评分 0-10
* @returns 爱心 Emoji
*/
export function getHeartEmoji(score: number): string {
// clamp 到 [0, 10]
const clamped = Math.min(10, Math.max(0, score))
if (clamped > 8.5) return '💖'
if (clamped > 7) return '🧡'
if (clamped > 5) return '💛'
return '💙'
}