修复代练大区标签和机器ID显示问题

主要修复:
- 修复代练大区标签显示,现在使用 regionDesc 而不是原始 region 值
- 将 .bottom-status 替换为真正的机器ID显示
- 在 usePlayState 中添加对 regionDesc 和 machineId 字段的支持
- 更新 GamePage 组件的 props 和模板以正确显示这些信息

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zyh
2025-08-29 19:07:20 +08:00
parent 7497817640
commit 7558174e0a
3 changed files with 43 additions and 5 deletions

View File

@@ -6,9 +6,8 @@
<div class="tab-item status-tab">状态</div>
<div class="tab-item target-tab">目标点数</div>
</div>
<div class="tab-header">{{ region }}
<div class="tab-item active" v-if="region === 'Q'">QQ</div>
<div class="tab-item active" v-if="region === 'V'">微信</div>
<div class="tab-header">
<div class="tab-item active">{{ regionDesc || (region === 'Q' ? 'QQ区' : region === 'V' ? '微信区' : region) }}</div>
<div class="tab-item status-tab">{{ displayStatus }}</div>
<div class="tab-item target-tab">{{ completedPoints || 0 }}/{{ totalPoints || 0 }}</div>
</div>
@@ -42,7 +41,7 @@
<!-- 底部状态显示 -->
<div class="bottom-status">
ss{{ currentPoints || 0 }}
机器ID: {{ machineId || 'N/A' }}
</div>
</div>
</div>
@@ -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

View File

@@ -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

View File

@@ -33,6 +33,8 @@
<GamePage
v-else-if="state.status === 'LOGGED_IN' || state.status === 'COMPLETED'"
:region="state.region"
:region-desc="state.regionDesc"
:machine-id="state.machineId"
:display-status="getDisplayStatus()"
:completed-points="state.completedPoints"
:total-points="state.totalPoints"