This commit is contained in:
2025-12-09 10:54:56 +08:00
parent 46c975591b
commit e539acd414
20 changed files with 491 additions and 102 deletions

View File

@@ -144,6 +144,12 @@ const loadPlayersData = () => {
icon: 'none'
})
}
// 从本地存储加载当前局数
const savedRound = uni.getStorageSync('currentRound')
if (savedRound) {
roundCount.value = parseInt(savedRound)
}
}
// 保存历史状态
@@ -157,6 +163,9 @@ const saveHistoryState = () => {
// 返回上一页
const goBack = () => {
// 保存当前局数到本地存储
uni.setStorageSync('currentRound', roundCount.value)
uni.showModal({
title: '提示',
content: '当前分数未保存,确定要返回吗?',
@@ -324,6 +333,9 @@ const clearInput = () => {
// 确认输入
const confirmInput = () => {
// 保存当前局数到本地存储
uni.setStorageSync('currentRound', roundCount.value)
if (selectedPlayerIndex.value !== -1) {
// 播放音效
if (soundEnabled.value) {