From d32738631a05a90bd2b38e910f22aa26eccfa36e Mon Sep 17 00:00:00 2001 From: yahaozhang Date: Mon, 15 Sep 2025 14:58:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=B8=E6=88=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=BF=9B=E5=BA=A6=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=89=A9=E4=BD=99=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=92=8C=E5=B1=95=E7=A4=BA=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/play/GamePage.vue | 16 +++++++++++++++- src/composables/usePlayState.js | 11 +++++++++++ src/views/Play.vue | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) 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"