fix:优化重新进入比赛页面箭数展示逻辑
This commit is contained in:
@@ -80,6 +80,8 @@ export default defineStore("store", {
|
||||
roomID: "",
|
||||
inBattle: false,
|
||||
roomNumber: "", // 当前房间号,供 Header 展示房号胶囊
|
||||
currentShot: 0, // 当前已射箭数(用于 HeaderProgress 恢复状态)
|
||||
totalShot: 0, // 轮次总箭数(用于 HeaderProgress 恢复状态)
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -136,6 +138,11 @@ export default defineStore("store", {
|
||||
this.game.roomID = roomID;
|
||||
this.game.inBattle = inBattle;
|
||||
},
|
||||
/** 更新当前射箭进度(用于 HeaderProgress 恢复状态,替代 uni.$emit 避免时序问题) */
|
||||
updateShotInfo(currentShot = 0, totalShot = 0) {
|
||||
this.game.currentShot = currentShot;
|
||||
this.game.totalShot = totalShot;
|
||||
},
|
||||
/** 更新当前房间号,供 Header 组件展示房号胶囊 */
|
||||
updateRoomNumber(number) {
|
||||
this.game.roomNumber = number;
|
||||
|
||||
Reference in New Issue
Block a user