From 4a9730c38df010affecb6939e37bf9b123d6e404 Mon Sep 17 00:00:00 2001 From: lkddi Date: Sun, 1 Mar 2026 15:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E5=95=86=E5=BA=97=E5=90=8C=E6=AD=A5=E5=8A=A0=E3=80=8C?= =?UTF-8?q?=F0=9F=92=8D=20=E6=B1=82=E5=A9=9A=E6=88=92=E6=8C=87=E3=80=8D?= =?UTF-8?q?=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toolbar.blade.php renderShop 补充: - ring 类型分组(存入背包,求婚时消耗) - 图标持有数量红色徽章 - 卡片下方亲密度/魅力加成标注 - 购买按钮走现有 buyItem 流程(后端 buyRing 处理) --- .../views/chat/partials/toolbar.blade.php | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/resources/views/chat/partials/toolbar.blade.php b/resources/views/chat/partials/toolbar.blade.php index 0ddb40b..b475195 100644 --- a/resources/views/chat/partials/toolbar.blade.php +++ b/resources/views/chat/partials/toolbar.blade.php @@ -782,6 +782,8 @@ badge.style.display = 'inline-block'; } + const ringCounts = data.ring_counts || {}; + const groups = [{ label: '⚡ 单次特效卡', desc: '立即播放一次,仅自己可见', @@ -797,6 +799,11 @@ desc: '', type: 'one_time' }, + { + label: '💍 求婚戒指', + desc: '存入背包,求婚时消耗(被拒则遗失)', + type: 'ring' + }, ]; const list = document.getElementById('shop-items-list'); @@ -815,17 +822,31 @@ items.forEach(item => { const isRename = item.slug === 'rename_card'; const canUse = isRename && data.has_rename_card; + const isRing = item.type === 'ring'; + const ownedQty = isRing ? (ringCounts[item.id] || 0) : 0; const card = document.createElement('div'); card.className = 'shop-card'; - // 顶部:图标 + 名称 + // 顶部:图标 + 名称(戒指加持有数徽章) + const iconHtml = isRing && ownedQty > 0 ? + ` + ${item.icon} + ${ownedQty} + ` : + `${item.icon}`; + card.innerHTML = `
- ${item.icon} + ${iconHtml} ${item.name}
${item.description ?? ''}
+ ${isRing && (item.intimacy_bonus > 0 || item.charm_bonus > 0) ? ` +
+ ${item.intimacy_bonus > 0 ? `💞 亲密 +${item.intimacy_bonus}` : ''} + ${item.charm_bonus > 0 ? `✨ 魅力 +${item.charm_bonus}` : ''} +
` : ''} `; // 按钮 @@ -840,7 +861,7 @@ btn.innerHTML = `🪙 ${Number(item.price).toLocaleString()}`; btn.onclick = () => openGiftDialog(item); } else { - // 周卡等其他商品:直接确认购买 + // 周卡、道具、戒指:直接确认购买 btn.className = 'shop-btn'; btn.innerHTML = `🪙 ${Number(item.price).toLocaleString()}`; btn.onclick = () => buyItem(item.id, item.name, item.price, 'all', '');