功能:送花/礼物系统完整开发
- 新增 Gift 模型和 gifts 数据表(7种默认花卉,各有图片/金币/魅力配置) - 7张花卉图片生成并存放于 public/images/gifts/ - 名片弹窗新增送礼物 UI:图片选择列表、金币/魅力标注、数量选择 - sendFlower 控制器方法:按 gift_id 查找礼物、扣金币、加魅力、广播消息 - 聊天消息渲染支持显示礼物图片(含弹跳动画效果) - 后台可在 gifts 表中管理花卉类型(名称、图标、图片、金币、魅力、排序、启禁用)
This commit is contained in:
@@ -240,7 +240,14 @@
|
||||
// 管理员公告/系统传音:大字醒目样式
|
||||
div.style.cssText =
|
||||
'background: linear-gradient(135deg, #fef2f2, #fff1f2); border: 2px solid #ef4444; border-radius: 6px; padding: 8px 12px; margin: 4px 0; box-shadow: 0 2px 4px rgba(239,68,68,0.15);';
|
||||
html = `<div style="font-size: 14px; font-weight: bold; color: #dc2626;">${msg.content}</div>`;
|
||||
// 如果是送花消息,显示礼物图片
|
||||
let giftHtml = '';
|
||||
if (msg.gift_image) {
|
||||
giftHtml =
|
||||
`<img src="${msg.gift_image}" alt="${msg.gift_name || ''}" style="display:inline-block;width:40px;height:40px;vertical-align:middle;margin-left:6px;animation:giftBounce 0.6s ease-in-out;">`;
|
||||
}
|
||||
html =
|
||||
`<div style="font-size: 14px; font-weight: bold; color: #dc2626;">${msg.content}${giftHtml}</div>`;
|
||||
} else {
|
||||
// 其他系统用户(钓鱼播报、AI小助手等):普通样式
|
||||
html =
|
||||
|
||||
Reference in New Issue
Block a user