彩票购票:清除按钮同时清空购物车

This commit is contained in:
2026-03-12 16:06:47 +08:00
parent cfd5345e93
commit d6d246ee63

View File

@@ -204,13 +204,13 @@
onmouseout="this.style.background='#f0f6ff'; this.style.borderColor='#c0d8ef'">
<EFBFBD> 机选
</button>
<button type="button" @click.prevent="selectedReds=[]; selectedBlue=null;"
<button type="button" @click.prevent="selectedReds=[]; selectedBlue=null; cart=[];"
style="flex:1; padding:10px 0; border-radius:10px; font-size:13px; font-weight:bold;
background:#f9fafb; color:#6b7280; border:1.5px solid #e5e7eb;
cursor:pointer; transition:all .15s; font-family:inherit;"
onmouseover="this.style.background='#f3f4f6'"
onmouseout="this.style.background='#f9fafb'">
🗑
🗑 空选号
</button>
<button @click="addToCart()" :disabled="selectedReds.length !== 3 || !selectedBlue"
style="flex:1.3; padding:10px 0; border-radius:10px; font-size:13px; font-weight:bold;
@@ -253,19 +253,15 @@
</template>
</div>
<button @click="submitCart()" :disabled="buying"
style="width:100%; margin-top:10px; border:none; border-radius:12px;
padding:13px 0; font-size:15px; font-weight:bold; letter-spacing:1px;
cursor:pointer; transition:all .2s; font-family:inherit;
text-shadow:0 1px 2px rgba(0,0,0,.2); display:flex; align-items:center; justify-content:center; gap:6px;"
onmousedown="this.style.transform='scale(0.98)'"
onmouseup="this.style.transform='scale(1)'"
onmouseleave="this.style.transform='scale(1)'"
style="width:100%; border:none; border-radius:12px; padding:13px 0; font-size:14px; font-weight:bold; cursor:pointer; transition:all .2s; font-family:inherit; margin-top:10px;"
:style="buying
?
'background:#e0e8f0; color:#99a8b8; cursor:not-allowed; box-shadow:none; text-shadow:none;' :
'background:linear-gradient(135deg,#dc2626,#e11d48); color:#fff; box-shadow:0 6px 16px rgba(220,38,38,.4), 0 2px 4px rgba(0,0,0,.1) inset;'">
'background:#e0e8f0; color:#99a8b8; cursor:not-allowed; box-shadow:none;' :
'background:linear-gradient(135deg,#dc2626,#e11d48); color:#fff; box-shadow:0 4px 14px rgba(220,38,38,.3);'"
onmouseover="if(!this.disabled) this.style.transform='translateY(-1px)'; if(!this.disabled) this.style.boxShadow='0 6px 16px rgba(220,38,38,.4)'"
onmouseout="if(!this.disabled) this.style.transform=''; if(!this.disabled) this.style.boxShadow='0 4px 14px rgba(220,38,38,.3)'">
<span
x-text="buying ? '🔄 购买中…' : '🎟️ 按下购买 ' + cart.length + ' 注(共 ' + (cart.length*100).toLocaleString() + ' 金币)'"></span>
x-text="buying ? '🔄 提交中…' : '🎟️ 确认购买 ' + cart.length + ' 注(共 ' + (cart.length*100).toLocaleString() + ' 金币)'"></span>
</button>
{{-- 内联购买结果提示 --}}
<div id="lottery-buy-msg"