update:对接会员限制次数

This commit is contained in:
2026-06-25 18:16:13 +08:00
parent 4bea563109
commit 4c32bbfb13
13 changed files with 351 additions and 52 deletions
+19
View File
@@ -26,6 +26,17 @@ const getDefaultGame = () => ({
tips: "",
});
const getDefaultDailyCount = () => ({
challenge: {
count: 0,
limit: -1,
},
ranked: {
count: 0,
limit: -1,
},
});
const getLvlName = (rankLvl, rankList = []) => {
if (!rankList) return;
let lvlName = "";
@@ -99,6 +110,7 @@ export default defineStore("store", {
totalShot: 0, // 轮次总箭数(用于 HeaderProgress 恢复状态)
tips: "", // 当前提示文案(用于 HeaderProgress 恢复状态,替代 uni.$emit 避免时序问题)
},
dailyCount: getDefaultDailyCount(),
}),
// 计算属性
@@ -167,12 +179,19 @@ export default defineStore("store", {
updateRoomNumber(number) {
this.game.roomNumber = number;
},
updateDailyCount(data = {}) {
this.dailyCount = {
...getDefaultDailyCount(),
...(data || {}),
};
},
clearSessionState() {
this.$patch({
user: getDefaultUser(),
device: getDefaultDevice(),
online: false,
game: getDefaultGame(),
dailyCount: getDefaultDailyCount(),
});
uni.removeStorageSync(PERSISTED_STORE_KEY);
setTimeout(() => {