diff --git a/App.vue b/App.vue
index bbeed2a..1497d36 100644
--- a/App.vue
+++ b/App.vue
@@ -17,7 +17,21 @@ export default {
Vue.prototype.$toastHide = this.$refs.uToast.hide;
});
},
- onLaunch: function () {},
+ onLaunch: function () {
+ // 检查 URL 参数中的语言设置
+ // #ifdef H5
+ const urlParams = new URLSearchParams(window.location.search);
+ const language = urlParams.get('language');
+ if (language && ['cn', 'tw', 'en', 'yn', 'kr', 'tl', 'in'].includes(language)) {
+ // 更新语言设置
+ this.$store.commit('app/setState', {
+ state: 'language',
+ value: language
+ });
+ localStorage.setItem('language', language);
+ }
+ // #endif
+ },
onShow: function () {
// this.setLanguage();
},
diff --git a/language/cn.js b/language/cn.js
index 8155a24..4df4bfb 100644
--- a/language/cn.js
+++ b/language/cn.js
@@ -38,6 +38,16 @@ var cn = {
buyu: "捕鱼游戏",
qipai: "棋牌游戏",
+ // 主页
+ guest: "游客",
+ onlineCount: "在线人数",
+ loading: "加载中...",
+ maxLimit: "上限",
+ minLimit: "下限",
+ betting: "下注中",
+ dealing: "发牌中",
+ preparing: "准备中",
+
recharge: "存款",
rechargeWithdrawNetwork: "充/提币网络",
pleaseChoose: "请选择",
diff --git a/language/en.js b/language/en.js
index 53be44b..58d0ca9 100644
--- a/language/en.js
+++ b/language/en.js
@@ -38,6 +38,16 @@ var en = {
buyu: "Fishing",
qipai: "Slots",
+ // Home page
+ guest: "Guest",
+ onlineCount: "Online",
+ loading: "Loading...",
+ maxLimit: "Max",
+ minLimit: "Min",
+ betting: "Betting",
+ dealing: "Dealing",
+ preparing: "Preparing",
+
recharge: "Recharge",
rechargeWithdrawNetwork: "Recharge / Withdraw Network",
pleaseChoose: "Please Choose",
diff --git a/pages/index.vue b/pages/index.vue
index 3deec0c..47dfeec 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -11,7 +11,7 @@
- {{ userInfo.username || 'Guest' }}
+ {{ userInfo.username || $lang.guest }}
{{ userInfo.money || '0.00' }}
@@ -45,13 +45,13 @@
- {{ cat.name }}
+ {{ $lang[cat.nameKey] }}
({{ getCategoryCount(cat.id) }})
- 在线人数
+ {{ $lang.onlineCount }}
2506
@@ -60,7 +60,7 @@
-
+
{{ item.table_name }}
@@ -138,15 +138,10 @@ export default {
],
currentCategory: 0, // 0 = All or default category
categories: [
- /*
- { id: 0, name: '国际厅', uIcon: 'grid', gameIds: [1,2,3,4,5] },
- { id: 1, name: '旗舰厅', uIcon: 'star', gameIds: [1] },
- */
// Mapping based on common IDs: 1=Baccarat, 2=DT, 4=Bull, 5=ThreeCard
- { id: 1, name: '百家乐', uIcon: 'chrome-circle-fill', gameIds: [1] },
- { id: 2, name: '龙虎', uIcon: 'heart-fill', gameIds: [2] },
- { id: 4, name: '牛牛', uIcon: 'thumb-up-fill', gameIds: [4] },
- // { id: 5, name: '金花/其他', uIcon: 'plus-circle-fill', gameIds: [5] }, // Grouping others
+ { id: 1, nameKey: 'baccarat', uIcon: 'chrome-circle-fill', gameIds: [1] },
+ { id: 2, nameKey: 'longhu', uIcon: 'heart-fill', gameIds: [2] },
+ { id: 4, nameKey: 'niuniu', uIcon: 'thumb-up-fill', gameIds: [4] },
],
allTables: [],
loading: false,
@@ -161,6 +156,7 @@ export default {
...mapState({
storeUserInfo: (state) => state.app.userInfo,
language: (state) => state.app.language,
+ $lang: (state) => state.app.lang[state.app.language],
}),
filteredTables() {
if (!this.allTables.length) return [];
@@ -261,9 +257,9 @@ export default {
return 'status-dealing';
},
getStatusText(status) {
- if (status === 1) return '下注中';
- if (status === 2) return '发牌中';
- return '准备中';
+ if (status === 1) return this.$lang.betting;
+ if (status === 2) return this.$lang.dealing;
+ return this.$lang.preparing;
},
enterGame(item) {
// 跳转到同域名下的 /game 子目录