feat: chat integration, tenant admin spec, backend chat service, miniprogram updates, DEMO moved to tmp, XCX-TEST removed, migrations & docs

This commit is contained in:
Neo
2026-03-20 09:02:10 +08:00
parent 3d2e5f8165
commit beb88d5bea
388 changed files with 6436 additions and 25458 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 '💙'
}