优化彩金池安全线触发方式
This commit is contained in:
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前彩金池(Redis 实例化,无则按 type=0 创建),含 profit_amount 实时值
|
||||
* 获取当前彩金池(Redis 实例化,无则按 type=0 创建),含玩家累计盈利 profit_amount 实时值
|
||||
*/
|
||||
getCurrentPool() {
|
||||
return request.get<{
|
||||
@@ -130,5 +130,14 @@ export default {
|
||||
url: '/core/dice/lottery_pool_config/DiceLotteryPoolConfig/updateCurrentPool',
|
||||
data: params
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置当前彩金池的玩家累计盈利(profit_amount 置为 0)
|
||||
*/
|
||||
resetProfitAmount() {
|
||||
return request.post<any>({
|
||||
url: '/core/dice/lottery_pool_config/DiceLotteryPoolConfig/resetProfitAmount'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,19 +16,21 @@
|
||||
</div>
|
||||
<div class="profit-row mb-3">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-gray-500">彩金池盈利(profit_amount):</span>
|
||||
<span class="font-mono text-lg" :class="profitAmountClass">{{ displayProfitAmount }}</span>
|
||||
<span class="text-gray-500">玩家累计盈利(profit_amount):</span>
|
||||
<span class="font-mono text-lg" :class="profitAmountClass">{{
|
||||
displayProfitAmount
|
||||
}}</span>
|
||||
<span class="realtime-badge">实时</span>
|
||||
</div>
|
||||
<div class="profit-calc-hint">
|
||||
计算方式:每局抽奖扣除本局发放成本(普通档位 real_ev + 中大奖时 BIGWIN.real_ev),弹窗打开期间每 2 秒自动刷新
|
||||
计算方式:每局按“当前中奖金额(含超级大奖 BIGWIN)减去抽奖券费用 100”累加,弹窗打开期间每 2 秒自动刷新
|
||||
</div>
|
||||
</div>
|
||||
<div class="tip-block">
|
||||
<div class="tip-title">抽奖档位规则</div>
|
||||
<div class="tip-content">
|
||||
当彩金池盈利 <strong>低于安全线</strong> 时,按<strong>玩家</strong>的 T*_weight 权重抽取抽奖档位;
|
||||
当彩金池盈利 <strong>高于或等于安全线</strong> 时,按<strong>当前彩金池</strong>的 T*_weight 权重抽取档位。
|
||||
当玩家在当前彩金池的累计盈利 <strong>低于安全线</strong> 时,按<strong>玩家</strong>的 T*_weight 权重抽取档位;
|
||||
当累计盈利 <strong>高于或等于安全线</strong> 时,按<strong>当前彩金池</strong>的 T*_weight 权重抽取档位(杀分)。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,6 +70,9 @@
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">关闭</el-button>
|
||||
<el-button :loading="resetting" :disabled="!pool" @click="handleResetProfit">
|
||||
重置玩家累计盈利
|
||||
</el-button>
|
||||
<el-button type="primary" :loading="saving" :disabled="!pool" @click="handleSubmit">
|
||||
保存权重与安全线
|
||||
</el-button>
|
||||
@@ -102,6 +107,7 @@
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const resetting = ref(false)
|
||||
const pool = ref<PoolData | null>(null)
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
@@ -221,6 +227,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleResetProfit() {
|
||||
if (!pool.value) return
|
||||
try {
|
||||
resetting.value = true
|
||||
await api.resetProfitAmount()
|
||||
ElMessage.success('玩家累计盈利已重置为 0')
|
||||
await loadPool()
|
||||
emit('success')
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message ?? '重置失败')
|
||||
} finally {
|
||||
resetting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
stopPolling()
|
||||
visible.value = false
|
||||
|
||||
Reference in New Issue
Block a user