feat(admin,api,player): 结算预览分页、统计图表与返水限额
完善结算计算与预览 API(含后端分页),加强管理端结算/返水/权限,并优化玩家端投注单与队徽展示。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,19 +30,11 @@ async function placeBet() {
|
||||
success.value = '';
|
||||
|
||||
try {
|
||||
if (slip.mode === 'parlay' && slip.items.length >= PARLAY_MIN_LEGS) {
|
||||
if (slip.hasSameMatch) {
|
||||
error.value = t('bet.parlay_same_match');
|
||||
return;
|
||||
}
|
||||
if (slip.canPlaceParlay) {
|
||||
if (slip.items.length > PARLAY_MAX_LEGS) {
|
||||
error.value = t('bet.parlay_max_legs');
|
||||
return;
|
||||
}
|
||||
if (!slip.canPlaceParlay) {
|
||||
error.value = t('bet.parlay_need_more');
|
||||
return;
|
||||
}
|
||||
await api.post('/player/bets/parlay', {
|
||||
legs: slip.items.map((i) => ({
|
||||
selectionId: i.selectionId,
|
||||
@@ -51,15 +43,17 @@ async function placeBet() {
|
||||
stake: slip.stake,
|
||||
requestId: genId(),
|
||||
});
|
||||
} else if (slip.items.length === 1) {
|
||||
const item = slip.items[0];
|
||||
await api.post('/player/bets/single', {
|
||||
selectionId: item.selectionId,
|
||||
oddsVersion: item.oddsVersion,
|
||||
stake: slip.stake,
|
||||
requestId: genId(),
|
||||
});
|
||||
} else if (slip.canPlaceBatchSingles) {
|
||||
for (const item of slip.items) {
|
||||
await api.post('/player/bets/single', {
|
||||
selectionId: item.selectionId,
|
||||
oddsVersion: item.oddsVersion,
|
||||
stake: slip.stake,
|
||||
requestId: genId(),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
error.value = t('bet.parlay_need_more');
|
||||
return;
|
||||
}
|
||||
success.value = t('bet.place_success');
|
||||
@@ -100,12 +94,19 @@ async function placeBet() {
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p v-if="slip.isParlay" class="mode-hint mode-hint--parlay">
|
||||
<p v-if="slip.canPlaceParlay" class="mode-hint mode-hint--parlay">
|
||||
{{ t('bet.parlay') }} · {{ t('bet.slip_parlay_odds', { odds: slip.totalOdds.toFixed(2) }) }}
|
||||
</p>
|
||||
<p v-else-if="slip.canPlaceBatchSingles && slip.count > 1" class="mode-hint">
|
||||
{{ t('bet.slip_singles_hint', { n: slip.count }) }}
|
||||
</p>
|
||||
|
||||
<div v-if="slip.items.length" class="stake-area">
|
||||
<label>{{ t('bet.stake') }}</label>
|
||||
<label>{{
|
||||
slip.canPlaceBatchSingles && slip.count > 1
|
||||
? t('bet.slip_stake_per_bet')
|
||||
: t('bet.stake')
|
||||
}}</label>
|
||||
<input v-model.number="slip.stake" type="number" min="1" />
|
||||
<div class="return">
|
||||
{{ t('bet.slip_est_return') }}:
|
||||
@@ -119,7 +120,7 @@ async function placeBet() {
|
||||
<button
|
||||
type="button"
|
||||
class="btn-primary"
|
||||
:disabled="loading || !slip.items.length || (slip.mode === 'parlay' && !slip.canPlaceParlay)"
|
||||
:disabled="loading || !slip.canSubmit"
|
||||
@click="placeBet"
|
||||
>
|
||||
{{ loading ? t('bet.placing') : t('bet.place_bet') }}
|
||||
|
||||
Reference in New Issue
Block a user