优化游戏页面进度显示逻辑,新增剩余积分计算和展示格式选择,提升用户体验
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user