250 lines
5.8 KiB
JavaScript
250 lines
5.8 KiB
JavaScript
// 语言配置
|
|
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
|
|
}
|