优化发送金币后自动关闭

This commit is contained in:
2026-04-12 22:39:22 +08:00
parent c297b61493
commit d739fc7028
@@ -1169,6 +1169,15 @@
return v.toLocaleString() + ' 金币';
},
closeRelatedModals() {
this.show = false;
const userModalElement = document.getElementById('user-modal-container');
if (!window.Alpine || !userModalElement) return;
const userModalData = window.Alpine.$data(userModalElement);
if (!userModalData) return;
userModalData.showUserModal = false;
},
async open(username) {
this.targetUsername = username;
this.amount = '';
@@ -1218,6 +1227,7 @@
this.quota.recent_rewards.unshift({ target: this.targetUsername, amount: amt, created_at: mm + '-' + dd + ' ' + hh + ':' + mi });
if (this.quota.recent_rewards.length > 10) this.quota.recent_rewards.pop();
this.amount = '';
this.closeRelatedModals();
window.chatDialog.alert(data.message, '🎉 奖励发放成功', '#d97706');
} else {
window.chatDialog.alert(data.message || '发放失败', '操作失败', '#cc4444');
@@ -1294,29 +1304,30 @@
</div>
{{-- 操作按钮 --}}
<div style="display:flex; justify-content:center; gap:10px; margin-bottom:20px;">
<div style="display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,0.85fr); gap:12px; width:min(100%, 360px); margin:0 auto 22px;">
<button x-on:click="send()"
style="background: linear-gradient(135deg, #3b82f6, #2563eb); color:#fff; border:none; border-radius:8px;
padding:8px 20px; font-size:13px; font-weight:bold; cursor:pointer;
box-shadow: 0 4px 12px rgba(37,99,235,0.4);
transition:transform .12s, box-shadow .12s, opacity .12s;"
:style="(sending || !amount) ? 'opacity: 0.5; cursor: not-allowed; box-shadow: none;' : ''"
style="background: linear-gradient(135deg, #fef08a, #facc15 48%, #f59e0b); color:#7c2d12;
border:2px solid rgba(255,255,255,0.5); border-radius:14px;
padding:14px 22px; min-height:56px; font-size:18px; font-weight:900; letter-spacing:1px; cursor:pointer;
box-shadow: 0 14px 28px rgba(124,45,18,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
transition:transform .12s, box-shadow .12s, opacity .12s, filter .12s;"
:style="(sending || !amount) ? 'opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: grayscale(0.15);' : ''"
:disabled="sending || !amount"
onmouseover="if(!this.disabled) this.style.transform='translateY(-2px)'"
onmouseout="if(!this.disabled) this.style.transform=''"
onmouseover="if(!this.disabled) { this.style.transform='translateY(-3px) scale(1.01)'; this.style.boxShadow='0 18px 34px rgba(124,45,18,0.42), inset 0 1px 0 rgba(255,255,255,0.55)'; }"
onmouseout="if(!this.disabled) { this.style.transform=''; this.style.boxShadow='0 14px 28px rgba(124,45,18,0.35), inset 0 1px 0 rgba(255,255,255,0.45)'; }"
onmousedown="if(!this.disabled) this.style.transform='translateY(1px)'"
onmouseup="if(!this.disabled) this.style.transform=''">
<span x-text="sending ? '⏳ 发放中…' : '💰 确认发放'"></span>
onmouseup="if(!this.disabled) { this.style.transform=''; this.style.boxShadow='0 14px 28px rgba(124,45,18,0.35), inset 0 1px 0 rgba(255,255,255,0.45)'; }">
<span x-text="sending ? '⏳ 发放中…' : '💰 立即发放'"></span>
</button>
<button x-on:click="show = false"
style="background:rgba(255,255,255,0.15); color:#fff; border:none; border-radius:8px;
padding:8px 20px; font-size:13px; font-weight:bold; cursor:pointer;
box-shadow:0 4px 12px rgba(0,0,0,0.25); transition:background .15s, transform .12s;"
onmouseover="this.style.background='rgba(255,255,255,0.25)';this.style.transform='translateY(-1px)'"
onmouseout="this.style.background='rgba(255,255,255,0.15)';this.style.transform=''"
style="background:rgba(124,45,18,0.22); color:rgba(255,255,255,0.96); border:1px solid rgba(255,255,255,0.16); border-radius:14px;
padding:12px 18px; min-height:56px; font-size:15px; font-weight:800; cursor:pointer;
box-shadow:0 10px 20px rgba(0,0,0,0.18); transition:background .15s, transform .12s, opacity .12s;"
onmouseover="this.style.background='rgba(124,45,18,0.34)';this.style.transform='translateY(-1px)'"
onmouseout="this.style.background='rgba(124,45,18,0.22)';this.style.transform=''"
onmousedown="this.style.transform='translateY(1px)'"
onmouseup="this.style.transform=''">
取消
取消
</button>
</div>