Initial commit: GamePortrait 竖屏版 - 深色豪华主题

This commit is contained in:
li
2026-01-16 17:47:53 +08:00
commit 40976e4b45
26611 changed files with 2843638 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
const getters = {
// 获取单张台信息
getTableById: (state) => (id) => {
let data = { ludan: {}, game_id: 1 }
if (state.app.allTableData && state.app.allTableData.length > 0) {
data = state.app.allTableData.find((v) => v.id == id)
}
return data
}
}
export default getters
+15
View File
@@ -0,0 +1,15 @@
import { createStore } from "vuex"
import getters from "./getters"
const modulesFiles = require.context("./modules", true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, "$1")
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default createStore({
modules,
getters
})
+252
View File
@@ -0,0 +1,252 @@
import $store from "@/store"
import router from "@/router/index"
import { getAllTableData, getUserInfo } from "@/utils/api"
//import axios from "axios"
import md5 from "js-md5"
import {
showToast,
showLoadingToast,
closeToast,
showDialog,
closeDialog
} from "vant"
let userData = {}
var waitLogoutTime = 600
try {
userData = localStorage.getItem("userInfo")
userData = userData ? JSON.parse(userData) : {}
} catch (err) {
console.log(err)
}
let routerStack = ""
try {
routerStack = localStorage.getItem("routerStack") || "baccarat"
} catch (err) {
console.log(err)
}
const state = {
game_id: 1,
gameUrl: "",
chooseChip: { key: "1s", value: 10 },
userInfo: userData,
allTableData: [],
routerStack: routerStack,
standbyTime: null,
musicPlayer: null
}
const mutations = {
// 更新用户信息
updateUserInfo: (state, data) => {
try {
let userInfo = Object.assign(state.userInfo, {
...data
})
userInfo = JSON.stringify(userInfo)
localStorage.setItem("userInfo", userInfo)
state.userInfo = JSON.parse(userInfo)
} catch (err) {
console.log(err)
}
},
// 清空用户信息
removeUserInfo: (state) => {
localStorage.removeItem("userInfo")
state.userInfo = {}
const protocol = document.location.protocol
const hostname = document.location.hostname
const port = document.location.port
let url = ""
if (port) {
url = `${protocol}//${hostname}:${port}`
} else {
url = `${protocol}//${hostname}`
}
window.location.href = url
},
// 更新选择下注筹码
updateChooseChip: (state, data) => {
state.chooseChip = data
},
updateGameId(state, id) {
state.game_id = id
},
// 更新栈
routerStack(state, type) {
state.routerStack = type
localStorage.setItem("routerStack", state.routerStack)
},
// 记录待机时间
standbyTime(state) {
const minute = $store.state.config.waitLogoutTime
let autoClose = null
if (minute) {
waitLogoutTime = minute * 60
if (state.standbyTime == null) {
state.standbyTime = setInterval(() => {
waitLogoutTime--
// console.log(waitLogoutTime)
if (waitLogoutTime <= 1) {
clearInterval(state.standbyTime)
state.standbyTime = null
waitLogoutTime = ($store.state.config.waitLogoutTime || 10) * 60
showDialog({
title: $store.state.config.$lang[$store.state.config.$Type].tips,
message:
$store.state.config.$lang[$store.state.config.$Type].time_logout
}).then(() => {
clearTimeout(autoClose)
$store.commit("app/removeUserInfo")
})
autoClose = setTimeout(() => {
closeDialog()
$store.commit("app/removeUserInfo")
}, 4000)
}
}, 1000)
} else {
waitLogoutTime = ($store.state.config.waitLogoutTime || 10) * 60
}
}
},
// 播放器对象
musicPlayer(state, player) {
state.musicPlayer = player
}
}
const actions = {
init({ state, dispatch }) {
dispatch("getGameUrl")
dispatch("getAllTableData")
$store.commit("socket/link", state.userInfo)
},
// 退出登录
logout({ commit }) {
commit("removeUserInfo")
setTimeout(() => {
router.replace({ name: "login" })
}, 200)
},
// 获取用户信息
getUserInfo({ commit }, token) {
showLoadingToast({
message: `${
$store.state.config.$lang[$store.state.config.$Type].loading
}...`,
forbidClick: true
})
getUserInfo({ api_token: token })
.then((res) => {
closeToast()
if (res.Success == 1) {
const data = res.Data
commit("updateUserInfo", data)
$store.dispatch("app/init")
$store.dispatch("socket/getGoodTabData")
} else {
$store.commit("app/removeUserInfo")
}
})
.catch((err) => {
showToast(err)
$store.commit("app/removeUserInfo")
})
},
// 获取所有桌子信息
getGameUrl({ state }) {
//默认跳转语言
const language = localStorage.getItem("language") || "en"
let lang = "zh-CN"
if (language == "tw") {
lang = "zh-CN"
} else if (language == "en") {
lang = "en-US"
} else if (language == "yn") {
lang = "vi-VN"
} else if (language == "kr") {
lang = "en-US"
} else {
lang = "zh-CN"
}
if (state.userInfo && state.userInfo.api_token) {
const params = {
account: state.userInfo.username,
lang: lang,
time: Math.round(new Date().getTime() / 1000).toString()
}
params.sign = md5(
`account=${params.account}lang=${params.lang}time=${params.time}354b335dd5dbc6740a8a55d4461249b9`
)
/*
const gapi = $store.state.config.gapi
axios
.post(`${gapi}/geturl`, params)
.then((res) => {
if (res.data.status_code == 200) {
state.gameUrl = res.data.data.url
}
})
.catch((err) => {
console.log(err)
})
*/
}
},
getAllTableData({ state }) {
if (state.userInfo && state.userInfo.api_token) {
const params = {
user_id: state.userInfo.id,
api_token: state.userInfo.api_token,
title: ""
}
showLoadingToast({
message: `${
$store.state.config.$lang[$store.state.config.$Type].loading
}...`,
forbidClick: true
})
let autoClose = null
getAllTableData(params)
.then((res) => {
closeToast()
if (res.Success == 1) {
state.allTableData = res.Data ? res.Data : []
$store.commit("app/standbyTime")
if (res.Msg == "获取信息失败") {
showDialog({
title:
$store.state.config.$lang[$store.state.config.$Type].tips,
message:
$store.state.config.$lang[$store.state.config.$Type]
.login_expired
}).then(() => {
$store.commit("app/removeUserInfo")
clearTimeout(autoClose)
})
autoClose = setTimeout(() => {
closeDialog()
$store.commit("app/removeUserInfo")
}, 4000)
}
} else {
showToast(res.Msg)
}
})
.catch((err) => {
showToast(err)
})
}
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
+249
View File
@@ -0,0 +1,249 @@
// 语言配置
import { cn } from "@/language/cn"
import { tw } from "@/language/tw"
import { en } from "@/language/en"
import { yn } from "@/language/yn"
import { kr } from "@/language/kr"
import { tl } from "@/language/tl"
import { In } from "@/language/in"
let sysVolume = {}
try {
sysVolume = localStorage.getItem("volume")
sysVolume = sysVolume
? JSON.parse(sysVolume)
: {
music: 70,
effects: 70
}
} catch (err) {
console.log(err)
}
const state = {
phoneScreen: "portrait",
phoneModel: "android",
showMenu: false,
showAplayer: false,
fullScreen: false,
showSetFree: false,
fonstSize: 12,
timeStamp: 0,
hallWayType: "allway",
baccaratType: 0,
baccaratPlayType: "classics",
showBaccaratPlayType: false,
showTableInfo: false,
showRecord: false,
showOnLine: false,
showSystem: false,
showShare: false,
$lang: { cn, tw, en, yn, kr, tl, in: In },
$Type: localStorage.getItem("language") || "en",
chipArry: [
{ key: "1s", show: true, value: 10 },
{ key: "5s", show: true, value: 50 },
{ key: "1b", show: true, value: 100 },
{ key: "5b", show: true, value: 500 },
{ key: "1k", show: true, value: 1000 },
{ key: "5k", show: true, value: 5000 },
{ key: "1w", show: false, value: 10000 },
{ key: "2w", show: false, value: 20000 },
{ key: "5w", show: false, value: 50000 },
{ key: "10w", show: false, value: 100000 }
],
soundList: {},
online: false,
switchVideo: true,
switchSound: true,
toningShowBigWay: false,
volume: sysVolume,
roulette_type: "french",
rouletteLockTable: false,
// 音乐音效筹码
musicVolume: localStorage.getItem("musicVolume") == "false" ? false : true,
effectsVolume:
localStorage.getItem("effectsVolume") == "false" ? false : true,
showOtherChip:
localStorage.getItem("showOtherChip") == "false" ? false : true,
apiUrl: "",
sockUrl: "",
gapi: "",
h5: "",
loginLogo: "",
titlePng: "",
title: "",
language: "",
flopTime: 100,
waitLogoutTime: 10,
outRoomTimes: 10,
soundUrl: "",
video: {
definition: 1,
line: 1,
player: "",
proportion: [],
scale: 0,
offset: {
iosLandscape: "",
iosPortrait: "",
android: "",
pc: ""
}
}
}
const mutations = {
// 设置配置
setConfig: (state, data) => {
if (data.title) {
document.title = data.title
Object.keys(data).forEach((v) => {
state[v] = data[v]
})
}
// 设置默认语言
const language = localStorage.getItem("language")
if (!language) {
state.$Type = data.language || "en"
}
},
soundList: (state, data) => {
state.soundList = data
},
setValue: (state, { name, type }) => {
state[name] = type
localStorage.setItem([name], type)
},
// 音量控制
volumeSeting: (state, data) => {
if (data.type == "add") {
if (state.volume[data.name] >= 100) {
state.volume[data.name] = 100
} else {
state.volume[data.name] += 5
}
} else {
if (state.volume[data.name] <= 0) {
state.volume[data.name] = 0
} else {
state.volume[data.name] -= 5
}
}
localStorage.setItem("volume", JSON.stringify(state.volume))
},
// 横竖屏
phoneScreen: (state, data) => {
state.phoneScreen = data
},
// 系统类型
phoneModel: (state, data) => {
state.phoneModel = data
},
// 全屏
checkFullscreen: (state, data) => {
state.fullScreen = data
},
// 显示侧滑菜单
showMenu: (state, data) => {
state.showMenu = data
},
// 显示音乐播放器
showAplayer: (state) => {
state.showAplayer = !state.showAplayer
},
// rem自适应根字号
resizeView: (state, data) => {
state.fonstSize = data
state.timeStamp = new Date().getTime()
},
// 列表桌子显示风格
updateHallWayType: (state, data) => {
state.hallWayType = data
},
// 切换免佣
setBaccaratType: (state, data) => {
state.baccaratType = data
},
// 显示免佣设置
showSetFree: (state) => {
state.showSetFree = !state.showSetFree
},
// 更新玩法
updateBaccaratPlayType: (state, type) => {
state.baccaratPlayType = type
},
// 显示玩法选择
showBaccaratPlayType: (state) => {
state.showBaccaratPlayType = !state.showBaccaratPlayType
},
// 显示桌台信息
showTableInfo: (state, data) => {
state.showTableInfo = data
},
// 排名
showOnLine: (state) => {
state.showOnLine = !state.showOnLine
},
// 历史记录
showRecord: (state) => {
state.showRecord = !state.showRecord
},
// 系统设置
showSystem: (state) => {
state.showSystem = !state.showSystem
},
// 显示分享窗口
showShare: (state) => {
state.showShare = !state.showShare
},
// 设置语言
updateLang: (state, type) => {
localStorage.setItem("language", type)
state.$Type = type
},
// 更新在线
updateOnline: (state, online) => {
state.online = online
},
// 设置视频开关
switchVideo: (state, type) => {
state.switchVideo = type
},
// 设置声音开关
switchSound: (state, type) => {
state.switchSound = type
},
// 更新视频线路清晰度
updateVideo: (state, data) => {
state.video[data.type] = data.choose
},
// 色碟露珠切换
toningShowBigWay: (state) => {
state.toningShowBigWay = !state.toningShowBigWay
},
// 切换轮盘下注玩法
switchRouletteType: (state, data) => {
if (data) {
state.roulette_type = data
} else if (state.roulette_type == "european") {
state.roulette_type = "french"
} else {
state.roulette_type = "european"
}
},
// 锁定下注模式
rouletteLockTable: (state, data) => {
state.rouletteLockTable = data
}
}
const actions = {}
export default {
namespaced: true,
state,
mutations,
actions
}
+505
View File
@@ -0,0 +1,505 @@
import VueSocketIO from "vue-socket.io"
import SocketIO from "socket.io-client"
import router from "@/router/index"
import $store from "@/store"
import { getSingletable, getGoodRoad } from "@/utils/api"
import {
sendScanResult,
updateBetAmount,
resetCardInfo,
baccaratData,
nnData,
toningData,
diceData,
rouletteData
} from "@/utils/common"
import { showToast, showLoadingToast, closeToast, showDialog } from "vant"
let socket = null
const state = {
io: null,
betInfo: [],
goodRoadList: []
}
const mutations = {
link(state, { id, username, login_token }) {
const sockUrl = $store.state.config.sockUrl
socket = new VueSocketIO({
debug: false,
connection: SocketIO(
`${sockUrl}/?connect=user&userid=${id}&account=${username}&login_token=${login_token} `,
{ transports: ["websocket"] }
),
vuex: {
store: $store,
actionPrefix: "socket_",
mutationPrefix: "socket_"
}
})
state.io = socket.io
},
// 重连成功回调
socket_reconnect_failed() {
console.log("重连失败")
showLoadingToast({
forbidClick: true,
message:
$store.state.config.$lang[$store.state.config.$Type].reconnection_failed
})
},
socket_reconnect(socket) {
state.io = socket.io
showLoadingToast({
forbidClick: true,
message:
$store.state.config.$lang[$store.state.config.$Type].reconnected_success
})
},
socket_disconnect(socket) {
state.io = socket.io
showLoadingToast({
duration: 0,
forbidClick: true,
message: $store.state.config.$lang[$store.state.config.$Type].reconnecting
})
},
// 链接登录回调 更新钱
socket_onlineLogin(state, data) {
closeToast()
const { status, money } = data
if (status) {
$store.commit("app/updateUserInfo", { money })
}
},
// 获取所有座子状态
socket_getState(state, data) {
const { table_id, status, round = null } = data
if (status && round) {
const sendMode = "getState"
$store.dispatch("socket/updateTable", { table_id, sendMode, round })
}
},
// 开始抢庄
socket_startRob(state, data) {
const { table_id, status, round } = data
if (status) {
const sendMode = "startRob"
const rob_status = round.number_tab_status.rob_status
$store.dispatch("socket/updateTable", { table_id, sendMode, rob_status })
}
},
// 开始游戏
socket_startBet(state, data) {
const { table_id, status } = data
if (status) {
const sendMode = "startBet"
$store.dispatch("socket/updateTable", { table_id, sendMode })
}
},
// 抢庄倒计时
socket_startRobCountDown(state, data) {
const { table_id, count_down, status } = data
if (status) {
const sendMode = "startRobCountDown"
$store.dispatch("socket/updateTable", { table_id, count_down, sendMode })
}
},
// 停止抢庄
socket_endRob(state, data) {
const { table_id, status, round } = data
if (status) {
const sendMode = "endRob"
const rob_status = round.number_tab_status.rob_status
$store.dispatch("socket/updateTable", { table_id, sendMode, rob_status })
}
},
// 抢庄结果
socket_toRob(state, data) {
const { table_id, RobMsg, status } = data
if (status) {
const sendMode = "toRob"
$store.dispatch("socket/updateTable", { table_id, RobMsg, sendMode })
} else {
showToast("抢庄失败")
}
},
//下注倒计时
socket_startBetCountDown(state, data) {
const { table_id, count_down, status } = data
if (status) {
const sendMode = "startBetCountDown"
$store.dispatch("socket/updateTable", { table_id, count_down, sendMode })
}
},
// 下注成功回调
socket_toBet(state, data) {
const { status, money, table_id, betAmountMsg } = data
if (status) {
const sendMode = "toBet"
$store.commit("app/updateUserInfo", { money })
$store.dispatch("socket/updateTable", {
table_id,
sendMode,
betAmountMsg
})
} else {
const sendMode = "toBetFlase"
$store.dispatch("socket/updateTable", { table_id, sendMode })
showToast($store.state.config.$lang[$store.state.config.$Type][data.msg])
}
},
// 下注取消下注回调
socket_cancelBet(state, data) {
const { status, money, table_id } = data
if (status) {
const sendMode = "cancelBet"
$store.commit("app/updateUserInfo", { money })
$store.dispatch("socket/updateTable", { table_id, sendMode })
}
},
//停止下注
socket_endBet(state, data) {
const { status, table_id } = data
if (status) {
const sendMode = "endBet"
$store.dispatch("socket/updateTable", { table_id, sendMode })
}
},
// 百家乐结果
socket_openingBaccaratResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingBaccaratResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 龙虎结果
socket_openingDtResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingDtResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 牛牛结果
socket_openingNnResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingNnResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 三卡NN结果
socket_openingTcResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingTcResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 色碟结果
socket_openingToningResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingToningResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 骰宝结果
socket_openingDiceResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingDiceResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 轮盘结果
socket_openingRouletteResult(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "openingRouletteResult"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 换靴
socket_changeBoot(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "changeBoot"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
// 更新余额
socket_opening(state, data) {
const { status, round } = data
if (status) {
$store.commit("app/updateUserInfo", { money: round.money })
}
},
// 重置靴
socket_resetBoot(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "resetBoot"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
socket_resetNumberTab(state, data) {
const { status, table_id, round } = data
if (status) {
const sendMode = "resetNumberTab"
$store.dispatch("socket/updateSingletable", { table_id, sendMode, round })
}
},
//扫牌
socket_sendScanResult(state, data) {
const { table_id, round, status } = data
if (status) {
const sendMode = "sendScanResult"
const flopTime = $store.state.config.flopTime
setTimeout(() => {
$store.dispatch("socket/updateTable", { table_id, round, sendMode })
}, flopTime)
}
},
// 顶下线
socket_RepeatedEntry(state, data) {
const { status } = data
if (status) {
showDialog({
title: $store.state.config.$lang[$store.state.config.$Type].tips,
message: $store.state.config.$lang[$store.state.config.$Type].offline
}).then(() => {
$store.commit("app/removeUserInfo")
})
}
},
updateBetInfo(state, data) {
state.betInfo = data
}
}
const actions = {
// 发送socket
sendMsg(store, data) {
// console.log(data)
const { id: uid } = $store.state.app.userInfo
socket.io.emit(data.mode, { user_id: uid, ...data })
},
// 更新单桌信息
updateTable(store, data) {
const tableData = $store.getters.getTableById(data.table_id)
if (tableData && tableData.id) {
tableData.sendMode = data.sendMode
switch (data.sendMode) {
case "getState":
// 恢复下注
if (data.round && data.round.bet && data.round.bet.length > 0) {
const { id } = $store.state.app.userInfo
const info = data.round.bet.filter((v) => v.user_id == id)
if (info.length > 0) {
store.commit("updateBetInfo", info)
}
} else {
store.commit("updateBetInfo", [])
}
//恢复翻牌
tableData.bet_status = data.round.bet_status
if (
data.round &&
data.round.show_card &&
data.round.show_card.length > 0
) {
data.round.show_card.forEach((v) => {
const cardInfo = { round: v }
sendScanResult(tableData, cardInfo)
})
}
$store.commit("config/updateOnline", true)
break
case "startBet": //开始游戏
tableData.round = {}
break
case "startRob": //开始抢庄
tableData.rob_status = data.rob_status || 0
break
case "toRob": //抢庄结果
tableData.rob_banker_id = data.RobMsg.rob_banker_id
tableData.rob_banker_username = data.RobMsg.rob_banker_username
break
case "endRob":
tableData.rob_status = data.rob_status || 2
break
case "startRobCountDown":
tableData.rob_count_down = data.count_down
break
case "startBetCountDown":
tableData.count_down = data.count_down
break
case "toBet": //下注
updateBetAmount(tableData, data)
break
case "cancelBet": //撤销下注
break
case "endBet": //结束游戏
tableData.count_down = 0
if (tableData.is_scavenging == 1) {
tableData.bet_status = 2
}
break
case "sendScanResult": //扫牌
sendScanResult(tableData, data)
tableData.round = data.round
break
}
Object.apply(tableData, { ...data })
}
},
// 更新虚假金额
updateVirtually(store, data) {
if (data && data.table_id) {
const tableData = $store.getters.getTableById(data.table_id)
if (tableData.id) {
updateBetAmount(tableData, data)
}
}
},
// getResult
updateSingletable(store, socketData) {
const { type = null, table_id, sendMode, round = {} } = socketData
const tableData = $store.getters.getTableById(table_id)
const { id: uid, api_token } = $store.state.app.userInfo
if (tableData && tableData.id) {
if (type == "update") {
showLoadingToast({
message: `${
$store.state.config.$lang[$store.state.config.$Type].loading
}...`,
forbidClick: true
})
}
getSingletable({
table_id: tableData.id,
user_id: uid,
api_token
})
.then((res) => {
if (res.Success == 1) {
const revertData = res.Data
// console.log(revertData)
// 处理幸运6 大小规则
if (tableData.game_id == 1) {
tableData.can_bet_big_small = revertData.can_bet_big_small
tableData.can_bet_luck_six = revertData.can_bet_luck_six
}
if (type != "update") {
tableData.previous_number_tab_id = round.previous_number_tab_id
} else {
tableData.sendMode = ""
}
tableData.boot_id = revertData.boot_id
tableData.boot_num = revertData.boot_num
tableData.number_tab_id = revertData.number_tab_id
tableData.number_tab_number = revertData.number_tab_number
tableData.ludan = revertData.ludan
if (type != "update") {
// 处理牛牛逻辑
if (tableData.game_id == 4 || tableData.game_id == 5) {
tableData.rob_status = 0
tableData.rob_banker_id = 0
tableData.rob_banker_username = null
}
let gameAmountKey = []
if (tableData.game_id == 1) {
store.dispatch("getGoodTabData")
tableData.banker_pair_Count = revertData.banker_pair_Count
tableData.player_pair_Count = revertData.player_pair_Count
tableData.bankerCount = revertData.bankerCount
tableData.playerCount = revertData.playerCount
tableData.tieCount = revertData.tieCount
tableData.ludan_banker = revertData.ludan_banker
tableData.ludan_player = revertData.ludan_player
gameAmountKey = baccaratData.key
} else if (tableData.game_id == 2) {
tableData.bankerCount = revertData.bankerCount
tableData.playerCount = revertData.playerCount
tableData.tieCount = revertData.tieCount
gameAmountKey = ["banker_amount", "player_amount", "tie_amount"]
} else if (tableData.game_id == 4 || tableData.game_id == 5) {
tableData.player_1_count = revertData.player_1_count
tableData.player_2_count = revertData.player_2_count
tableData.player_3_count = revertData.player_3_count
gameAmountKey = nnData.key
} else if (tableData.game_id == 6) {
tableData.count = revertData.count
gameAmountKey = toningData.key
} else if (tableData.game_id == 7) {
tableData.count = revertData.count
gameAmountKey = diceData.key
} else if (tableData.game_id == 8) {
tableData.count = revertData.count
gameAmountKey = rouletteData.key
}
// 清0 下注金额
if (gameAmountKey.length) {
gameAmountKey.forEach((v) => {
tableData.bet_amount_msg[v] = 0
})
}
resetCardInfo(tableData)
}
tableData.sendMode = sendMode || ""
tableData.round = round
if (type == "update") {
resetCardInfo(tableData)
store.dispatch("sendMsg", {
mode: "getState",
table_id: tableData.id
})
}
if (revertData.isout == 1) {
showToast("你已经断开连接!")
setTimeout(() => {
localStorage.removeItem("userInfo")
router.push({ path: "/" })
window.location.reload()
}, 2000)
}
} else {
localStorage.removeItem("userInfo")
router.push({ path: "/" })
window.location.reload()
}
})
.catch((err) => {
console.log(err)
})
.finally(() => {
if (type == "update") {
closeToast()
}
})
}
},
getGoodTabData({ state }) {
const { id: uid, api_token } = $store.state.app.userInfo
getGoodRoad({ user_id: uid, api_token })
.then((res) => {
if (res.Success == 1) {
state.goodRoadList = res.Data
}
})
.catch((err) => {
console.log(err)
})
}
}
export default {
namespaced: true,
state,
mutations,
actions
}