From 7558174e0a971fe83f71f0d57c63369678243db5 Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 29 Aug 2025 19:07:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=BB=83=E5=A4=A7?= =?UTF-8?q?=E5=8C=BA=E6=A0=87=E7=AD=BE=E5=92=8C=E6=9C=BA=E5=99=A8ID?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要修复: - 修复代练大区标签显示,现在使用 regionDesc 而不是原始 region 值 - 将 .bottom-status 替换为真正的机器ID显示 - 在 usePlayState 中添加对 regionDesc 和 machineId 字段的支持 - 更新 GamePage 组件的 props 和模板以正确显示这些信息 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/components/play/GamePage.vue | 15 +++++++++++---- src/composables/usePlayState.js | 31 ++++++++++++++++++++++++++++++- src/views/Play.vue | 2 ++ 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/components/play/GamePage.vue b/src/components/play/GamePage.vue index f33a2a7..af05961 100644 --- a/src/components/play/GamePage.vue +++ b/src/components/play/GamePage.vue @@ -6,9 +6,8 @@
状态
目标点数
-
{{ region }} -
QQ
-
微信
+
+
{{ regionDesc || (region === 'Q' ? 'QQ区' : region === 'V' ? '微信区' : region) }}
{{ displayStatus }}
{{ completedPoints || 0 }}/{{ totalPoints || 0 }}
@@ -42,7 +41,7 @@
- ss{{ currentPoints || 0 }} + 机器ID: {{ machineId || 'N/A' }}
@@ -56,6 +55,14 @@ export default { type: String, required: true }, + regionDesc: { + type: String, + default: null + }, + machineId: { + type: String, + default: null + }, displayStatus: { type: String, required: true diff --git a/src/composables/usePlayState.js b/src/composables/usePlayState.js index 4a6ca86..bd57eb4 100644 --- a/src/composables/usePlayState.js +++ b/src/composables/usePlayState.js @@ -21,6 +21,7 @@ export function usePlayState() { submitting: false, needRefresh: false, region: null, + regionDesc: null, qrInfo: null, assets: null, currentPoints: 0, @@ -33,7 +34,8 @@ export function usePlayState() { maxQrRetries: 3, qrRetryDelay: 2000, qrError: null, - mecmachineId: null + mecmachineId: null, + machineId: null }) const initializePage = async () => { @@ -110,10 +112,18 @@ export function usePlayState() { console.log('gameData.region 为空,未更新 state.region') } + if (gameData.regionDesc) { + state.regionDesc = gameData.regionDesc + } + if (gameData.mecmachineId) { state.mecmachineId = gameData.mecmachineId } + if (gameData.machineId) { + state.machineId = gameData.machineId + } + if (gameData.totalPoints) { state.totalPoints = gameData.totalPoints } else if (gameData.assets && gameData.assets.totalPoints) { @@ -148,6 +158,23 @@ export function usePlayState() { state.status = 'COMPLETED' + // 更新区域和机器信息 + if (gameData.region) { + state.region = gameData.region + } + + if (gameData.regionDesc) { + state.regionDesc = gameData.regionDesc + } + + if (gameData.mecmachineId) { + state.mecmachineId = gameData.mecmachineId + } + + if (gameData.machineId) { + state.machineId = gameData.machineId + } + state.assets = { homepageUrl: gameData.homepageUrl, firstRewardUrl: gameData.firstRewardUrl, @@ -189,8 +216,10 @@ export function usePlayState() { state.status = data.status state.needRefresh = data.needRefresh || false state.region = data.region + state.regionDesc = data.regionDesc || null state.assets = data.assets state.mecmachineId = data.mecmachineId || null + state.machineId = data.machineId || null if (data.totalPoints) { state.totalPoints = data.totalPoints diff --git a/src/views/Play.vue b/src/views/Play.vue index b3fdae0..6cea359 100644 --- a/src/views/Play.vue +++ b/src/views/Play.vue @@ -33,6 +33,8 @@