新增二维码加载状态管理,优化二维码获取逻辑,支持提前获取二维码并清理定时器,提升用户体验

This commit is contained in:
yahaozhang
2025-09-16 01:20:46 +08:00
parent f250fd07c4
commit de107c0f06
4 changed files with 111 additions and 6 deletions

View File

@@ -34,7 +34,10 @@ export function usePlayState() {
qrRetryDelay: 2000,
qrError: null,
mecmachineId: null,
machineId: null
machineId: null,
qrCreatedAt: null,
qrExpireAt: null,
qrDelayTimeoutId: null
})
const initializePage = async () => {
@@ -206,6 +209,12 @@ export function usePlayState() {
state.assets = data.assets
state.mecmachineId = data.mecmachineId || null
state.machineId = data.machineId || null
if (data.qrCreatedAt) {
state.qrCreatedAt = data.qrCreatedAt
}
if (data.qrExpireAt) {
state.qrExpireAt = data.qrExpireAt
}
if (data.totalPoints) {
state.totalPoints = data.totalPoints