优化下注金额

This commit is contained in:
2026-04-12 17:56:16 +08:00
parent adc89240fd
commit d52db10863
4 changed files with 58 additions and 4 deletions
@@ -191,14 +191,14 @@
{{-- 快捷金额 --}}
<div style="display:grid; grid-template-columns:repeat(5,1fr); gap:6px; margin-bottom:10px;">
<template x-for="preset in [100, 500, 1000, 5000, 10000]" :key="preset">
<template x-for="preset in quickBetAmounts" :key="preset">
<button x-on:click="betAmount = preset"
style="border-radius:20px; padding:8px 2px; font-size:13px; font-weight:bold;
cursor:pointer; transition:all .15s; font-family:inherit; text-align:center;"
:style="betAmount === preset ?
'background:#336699; color:#fff; border:none; box-shadow:0 3px 10px rgba(51,102,153,.35); transform:translateY(-1px);' :
'background:#fff; color:#336699; border:1.5px solid #c0d8ef;'"
x-text="preset >= 1000 ? (preset/1000)+'k' : preset">
x-text="preset >= 10000 ? (preset/1000)+'k' : (preset >= 1000 ? (preset/1000)+'k' : preset)">
</button>
</template>
</div>
@@ -463,6 +463,8 @@
// 下注表单
selectedType: '',
betAmount: 100,
minBet: 100,
maxBet: 50000,
submitting: false,
// 结算结果
@@ -481,6 +483,24 @@
autoCloseTimer: null,
autoCloseCountdown: 0,
/**
* 获取快捷下注金额数组
*/
get quickBetAmounts() {
const min = this.minBet || 100;
const max = this.maxBet || 50000;
// 默认比例:1x, 5x, 10x, 50x, 100x (基于最小下注)
// 同时确保不超过最大下注
return [
min,
Math.min(min * 5, max),
Math.min(min * 10, max),
Math.min(min * 50, max),
Math.min(min * 100, max)
].filter((v, i, a) => a.indexOf(v) === i); // 去重
},
/**
* 重置为未开局空状态
*/
@@ -552,6 +572,8 @@
this.betCountBig = data.round.bet_count_big;
this.betCountSmall = data.round.bet_count_small;
this.betCountTriple = data.round.bet_count_triple;
this.minBet = data.round.min_bet || 100;
this.maxBet = data.round.max_bet || 50000;
if (data.round.my_bet) {
this.myBet = true;
this.myBetType = data.round.my_bet.bet_type;