1
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user