diff --git a/src/components/play/GamePage.vue b/src/components/play/GamePage.vue index a870088..0fc68cd 100644 --- a/src/components/play/GamePage.vue +++ b/src/components/play/GamePage.vue @@ -9,7 +9,9 @@
{{ regionDesc || (region === 'Q' ? 'QQ区' : region === 'V' ? '微信区' : region) }}
{{ displayStatus }}
-
{{ completedPoints || 0 }}/{{ totalPoints || 0 }}
+
{{ completedPoints || 0 }}/{{ totalPoints || 0 }}
+
差:{{ remainingPoints }}
+
@@ -93,6 +95,10 @@ export default { codeNo: { type: String, default: null + }, + progressDisplayFormat: { + type: String, + default: '1' } }, data() { @@ -100,6 +106,14 @@ export default { timestamp: Date.now() } }, + computed: { + remainingPoints() { + const total = this.totalPoints || 0 + const completed = this.completedPoints || 0 + const diff = total - completed + return diff > 0 ? diff : 0 + } + }, mounted() { this.setupImageRefresh() }, diff --git a/src/composables/usePlayState.js b/src/composables/usePlayState.js index f0af8ce..bfb6592 100644 --- a/src/composables/usePlayState.js +++ b/src/composables/usePlayState.js @@ -25,6 +25,7 @@ export function usePlayState() { currentPoints: 0, totalPoints: 1000, completedPoints: 0, + progressDisplayFormat: '1', error: null, qrDelaySeconds: 0, isWaitingQr: false, @@ -114,6 +115,9 @@ export function usePlayState() { } state.completedPoints = gameData.completedPoints || 0 + if (gameData.progressDisplayFormat) { + state.progressDisplayFormat = String(gameData.progressDisplayFormat) + } state.currentPoints = 0 console.log('handleLoggedInStatus 执行完成,最终状态:', { @@ -164,6 +168,9 @@ export function usePlayState() { state.totalPoints = gameData.totalPoints || 50 state.completedPoints = gameData.completedPoints || state.totalPoints + if (gameData.progressDisplayFormat) { + state.progressDisplayFormat = String(gameData.progressDisplayFormat) + } state.currentPoints = state.totalPoints console.log('已完成状态更新完成:', { @@ -207,6 +214,10 @@ export function usePlayState() { if (data.completedPoints !== undefined) { state.completedPoints = data.completedPoints } + + if (data.progressDisplayFormat) { + state.progressDisplayFormat = String(data.progressDisplayFormat) + } if (data.assets && data.assets.totalPoints) { state.totalPoints = data.assets.totalPoints diff --git a/src/views/Play.vue b/src/views/Play.vue index fbfd74f..b0402f7 100644 --- a/src/views/Play.vue +++ b/src/views/Play.vue @@ -38,6 +38,7 @@ :display-status="getDisplayStatus()" :completed-points="state.completedPoints" :total-points="state.totalPoints" + :progress-display-format="state.progressDisplayFormat" :status-message="getStatusMessage()" :status-message-class="getStatusMessageClass()" :assets="state.assets"