feat(player): 完善 H5 投注端与 API 演示数据
- 球赛/串关/优胜冠军、赛事详情、历史投注与个人资料编辑 - 固定顶栏、公告与底栏,仅内容区滚动 - 底部导航与站点 favicon 使用 logo,登录页精简 - API 种子、冠军盘与历史注单增强 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,12 +25,26 @@ export const useBetSlipStore = defineStore('betSlip', () => {
|
||||
);
|
||||
if (existing >= 0) {
|
||||
items.value.splice(existing, 1);
|
||||
if (items.value.length < 2) mode.value = 'single';
|
||||
return;
|
||||
}
|
||||
items.value.push(item);
|
||||
if (items.value.length >= 2) mode.value = 'parlay';
|
||||
}
|
||||
|
||||
/** 串关:同场只保留一个选项;再次点击已选项则取消 */
|
||||
function addParlayLeg(item: SlipItem) {
|
||||
const samePick = items.value.findIndex((i) => i.selectionId === item.selectionId);
|
||||
if (samePick >= 0) {
|
||||
items.value.splice(samePick, 1);
|
||||
if (items.value.length < 2) mode.value = 'single';
|
||||
return;
|
||||
}
|
||||
items.value = items.value.filter((i) => i.matchId !== item.matchId);
|
||||
items.value.push(item);
|
||||
mode.value = items.value.length >= 2 ? 'parlay' : 'single';
|
||||
}
|
||||
|
||||
function removeItem(selectionId: string) {
|
||||
items.value = items.value.filter((i) => i.selectionId !== selectionId);
|
||||
if (items.value.length < 2) mode.value = 'single';
|
||||
@@ -58,6 +72,16 @@ export const useBetSlipStore = defineStore('betSlip', () => {
|
||||
return new Set(matchIds).size !== matchIds.length;
|
||||
});
|
||||
|
||||
const drawerOpen = ref(false);
|
||||
|
||||
function openDrawer() {
|
||||
drawerOpen.value = true;
|
||||
}
|
||||
|
||||
function closeDrawer() {
|
||||
drawerOpen.value = false;
|
||||
}
|
||||
|
||||
return {
|
||||
items,
|
||||
stake,
|
||||
@@ -67,8 +91,12 @@ export const useBetSlipStore = defineStore('betSlip', () => {
|
||||
totalOdds,
|
||||
potentialReturn,
|
||||
hasSameMatch,
|
||||
drawerOpen,
|
||||
addItem,
|
||||
addParlayLeg,
|
||||
removeItem,
|
||||
clear,
|
||||
openDrawer,
|
||||
closeDrawer,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user