Compare commits
33 Commits
9c554a9366
...
new-race-m
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c0a24fd44 | |||
| a151f2f293 | |||
| 4352fffde7 | |||
| 74ca0bb3d7 | |||
| f44c22c594 | |||
| 4518c66a65 | |||
| 72a3443ff1 | |||
| 131d3f70a2 | |||
| 542c370ace | |||
| c094fc7bef | |||
| e3c33da40c | |||
| bededd89fa | |||
| d38454453b | |||
| e70ae0add5 | |||
| fcf346905b | |||
| bf3f3a3afe | |||
| 5c36af30cd | |||
| df2e8c80bb | |||
| 79088d0902 | |||
| bf72c9c63e | |||
| efff88db8e | |||
| 9a6ca0700e | |||
| 2c0edb533e | |||
| 245daaff9b | |||
| 20bf9e1637 | |||
| 89885a59f4 | |||
| 1c75c06eaa | |||
| 34a32b108c | |||
| c168a909db | |||
| 9d45abd693 | |||
| 6db2142cf6 | |||
| c3570afeba | |||
| 4761206a6e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,7 +12,7 @@ node_modules
|
||||
.github
|
||||
openspec
|
||||
CLAUDE.md
|
||||
dosc
|
||||
docs
|
||||
.DS_Store
|
||||
dist
|
||||
*.local
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4060620250520001",
|
||||
"@dcloudio/uni-ui": "^1.5.11",
|
||||
"pinia": "2.0.36",
|
||||
"pinia-plugin-persistedstate": "3.2.1",
|
||||
"vue": "^3.4.21",
|
||||
"vue-i18n": "^9.1.9"
|
||||
},
|
||||
|
||||
23
src/App.vue
23
src/App.vue
@@ -21,10 +21,7 @@
|
||||
} = storeToRefs(store);
|
||||
const {
|
||||
updateUser,
|
||||
updateOnline,
|
||||
updateDevice,
|
||||
updateGame,
|
||||
updateRoomNumber
|
||||
updateOnline
|
||||
} = store;
|
||||
|
||||
watch(
|
||||
@@ -49,22 +46,6 @@
|
||||
updateUser(value);
|
||||
}
|
||||
|
||||
function onSessionKickedOut() {
|
||||
uni.removeStorageSync(
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
updateUser();
|
||||
updateDevice("", "");
|
||||
updateOnline(false);
|
||||
updateGame(false, "");
|
||||
updateRoomNumber("");
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "账号已在其他设备登录",
|
||||
showCancel: false,
|
||||
});
|
||||
}
|
||||
|
||||
async function emitUpdateOnline() {
|
||||
const data = await getDeviceBatteryAPI();
|
||||
updateOnline(data.online);
|
||||
@@ -84,7 +65,6 @@
|
||||
onShow(() => {
|
||||
uni.$on("update-user", emitUpdateUser);
|
||||
uni.$on("update-online", emitUpdateOnline);
|
||||
uni.$on("session-kicked-out", onSessionKickedOut);
|
||||
const token = uni.getStorageSync(
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
@@ -97,7 +77,6 @@
|
||||
onHide(() => {
|
||||
uni.$off("update-user", emitUpdateUser);
|
||||
uni.$off("update-online", emitUpdateOnline);
|
||||
uni.$off("session-kicked-out", onSessionKickedOut);
|
||||
websocket.closeWebSocket();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -6,7 +6,7 @@ try {
|
||||
|
||||
switch (envVersion) {
|
||||
case "develop": // 开发版
|
||||
// BASE_URL = "http://localhost:8000/api/shoot";
|
||||
// BASE_URL = "http://192.168.1.30:8000/api/shoot";
|
||||
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
||||
break;
|
||||
case "trial": // 体验版
|
||||
@@ -46,8 +46,6 @@ function request(method, url, data = {}) {
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
uni.$emit("update-user");
|
||||
reject({ type: "AUTH_INVALID", message });
|
||||
return;
|
||||
}
|
||||
if (message === "ROOM_FULL") {
|
||||
resolve({full: true});
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
export const audioFils = {
|
||||
tententen: "https://static.shelingxingqiu.com/shootmini/static/audio/tententen.mp3",
|
||||
点击按钮: "https://static.shelingxingqiu.com/shootmini/static/audio/%E7%82%B9%E5%87%BB%E6%8C%89%E9%92%AE.mp3",
|
||||
"20CM全环靶": "https://static.shelingxingqiu.com/shootmini/static/audio/20CM%E5%85%A8%E7%8E%AF%E9%9D%B6-%E6%97%A0%E6%95%88.mp3",
|
||||
"40CM全环靶": "https://static.shelingxingqiu.com/shootmini/static/audio/40CM%E5%85%A8%E7%8E%AF%E9%9D%B6-%E6%97%A0%E6%95%88.mp3",
|
||||
// 激光已校准:
|
||||
// "https://static.shelingxingqiu.com/attachment/2025-10-29/ddupaur1vdkyhzaqdc.mp3",
|
||||
胜利: "https://static.shelingxingqiu.com/attachment/2025-09-17/dcuo9yjp0kt5msvmvd.mp3",
|
||||
@@ -36,7 +40,7 @@ export const audioFils = {
|
||||
请开始射击:
|
||||
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutzdrl5u0iromqhf.mp3",
|
||||
射击无效:
|
||||
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutya55ufiiw8oo55.mp3",
|
||||
"https://static.shelingxingqiu.com/shootmini/static/audio/%E5%B0%84%E7%AE%AD%E6%97%A0%E6%95%88%E6%A3%80%E6%9F%A5%E8%B7%9D%E7%A6%BB%E5%92%8C%E9%9D%B6%E7%BA%B8.mp3",
|
||||
未上靶:
|
||||
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6n45o3tsm1v4unam.mp3",
|
||||
"1环":
|
||||
|
||||
@@ -31,7 +31,7 @@ function handleTabClick(index) {
|
||||
v-for="(tab, index) in tabs"
|
||||
:key="index"
|
||||
class="tab-item"
|
||||
@click="handleTabClick(index)"
|
||||
@click="$clickSound(() => handleTabClick(index))"
|
||||
:style="{
|
||||
width: index === 1 ? '36%' : '20%',
|
||||
}"
|
||||
|
||||
@@ -19,8 +19,12 @@ const props = defineProps({
|
||||
});
|
||||
const loading = ref(false);
|
||||
|
||||
/** 统一获取当前环境 token,用于守卫:无有效 token 时不发起接口请求 */
|
||||
const getToken = () =>
|
||||
uni.getStorageSync(`${uni.getAccountInfoSync().miniProgram.envVersion}_token`);
|
||||
|
||||
onShow(async () => {
|
||||
if (user.value.id) {
|
||||
if (user.value.id && getToken()) {
|
||||
setTimeout(async () => {
|
||||
const state = await getUserGameState();
|
||||
updateGame(state.gaming, state.roomId);
|
||||
@@ -33,7 +37,8 @@ watch(
|
||||
async (value) => {
|
||||
if (!value.id) {
|
||||
updateGame(false, "");
|
||||
} else {
|
||||
} else if (getToken()) {
|
||||
// 有有效 token 时才查询在局状态,避免 token 失效时反复发起无效请求
|
||||
const state = await getUserGameState();
|
||||
updateGame(state.gaming, state.roomId);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ const goCalibration = async () => {
|
||||
<button hover-class="none" @click="() => (showHint = false)">
|
||||
取消
|
||||
</button>
|
||||
<button hover-class="none" @click="cancelMatching">确认</button>
|
||||
<button hover-class="none" @click="$clickSound(cancelMatching)">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="hintType === 4" class="tip-content">
|
||||
|
||||
@@ -17,12 +17,19 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const battleMode = ref(1);
|
||||
const targetMode = ref(1);
|
||||
/** 对战模式:0=未选 1=1v1 2=乱斗 3=2v2 4=3v3 */
|
||||
const battleMode = ref(0);
|
||||
/** 靶纸尺寸:0=未选 1=20cm 2=40cm */
|
||||
const targetMode = ref(0);
|
||||
const loading = ref(false);
|
||||
const roomNumber = ref("");
|
||||
|
||||
const createRoom = debounce(async () => {
|
||||
// 校验必填项:对战模式与靶纸均必须选择
|
||||
if (!battleMode.value || !targetMode.value) {
|
||||
uni.showToast({ title: '请完善创建信息', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (game.value.inBattle) {
|
||||
uni.$showHint(1);
|
||||
return;
|
||||
@@ -105,7 +112,7 @@ const createRoom = debounce(async () => {
|
||||
<text>40厘米全环靶</text>
|
||||
</view>
|
||||
</view>
|
||||
<SButton :onClick="createRoom">创建房间</SButton>
|
||||
<SButton :onClick="() => $clickSound(createRoom)">创建房间</SButton>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -19,12 +19,17 @@ const ended = ref(false);
|
||||
const halfTime = ref(false);
|
||||
const currentShot = ref(0);
|
||||
const totalShot = ref(0);
|
||||
/** 标记组件是否已完成挂载,防止 immediate watcher 在挂载前用旧 store 值触发意外播音 */
|
||||
const isMounted = ref(false);
|
||||
|
||||
watch(
|
||||
() => tips.value,
|
||||
(newVal) => {
|
||||
// 挂载完成前不播音(避免 immediate store watcher 用旧值触发多余播报)
|
||||
if (!isMounted.value) return;
|
||||
// 空字符串或含"重回"的 tips 均不播音
|
||||
if (!newVal || newVal.includes("重回")) return;
|
||||
let key = [];
|
||||
if (newVal.includes("重回")) return;
|
||||
if (currentRoundEnded.value) {
|
||||
// 播放当前轮次语音
|
||||
key.push(`第${["一", "二", "三", "四", "五"][currentRound.value]}轮`);
|
||||
@@ -60,8 +65,12 @@ async function onReceiveMessage(message) {
|
||||
audioManager.play("比赛结束", false);
|
||||
} else if (type === MESSAGETYPESV2.ShootResult) {
|
||||
if (melee.value && current.playerId !== user.value.id) return;
|
||||
// 仅计用户自己的命中箭,并加上限防护,防止超过 totalShot(如重入时 currentShot 初始值偏高)
|
||||
if (current.playerId === user.value.id && currentShot.value < totalShot.value) currentShot.value++;
|
||||
// 从 indexMap 按当前用户 id 取已射箭数,由后端维护准确值,不在前端自增。
|
||||
// 注意:后端在 ShootResult 中会将 playerId 重置为 0(无当前射手),
|
||||
// 因此不能依赖 playerId === user.id 判断,改为直接读取 indexMap[user.id]。
|
||||
// indexMap[user.id] 只在本人射箭后才增加,队友射箭时该值不变,逻辑等价且更准确。
|
||||
const myShot = current.indexMap?.[user.value.id];
|
||||
if (myShot !== undefined) currentShot.value = myShot;
|
||||
if (message.shootData) {
|
||||
let key = [];
|
||||
key.push(
|
||||
@@ -105,13 +114,15 @@ watch(() => store.game.totalShot, (newVal) => {
|
||||
|
||||
// 监听 Pinia store 中 tips 变化,用于比赛恢复时同步提示文案(替代 uni.$emit 避免时序问题)
|
||||
// 使用 immediate: true 确保组件创建时立即读取 store 当前值(解决 onShow 早于 onMounted 导致 uni.$emit 事件丢失的问题)
|
||||
// 注意:使用 != null 而非 if(newVal),确保空字符串 "" 也能触发清空(避免重新开赛时旧文案残留)
|
||||
watch(() => store.game.tips, (newVal) => {
|
||||
if (newVal) {
|
||||
if (newVal != null) {
|
||||
tips.value = newVal;
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
onMounted(() => {
|
||||
isMounted.value = true;
|
||||
uni.$on("update-tips", onUpdateTips);
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
uni.$on("play-sound", playSound);
|
||||
|
||||
@@ -123,7 +123,7 @@ onBeforeUnmount(() => {
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<button hover-class="none" @click="stopMatch">取消匹配</button>
|
||||
<button hover-class="none" @click="$clickSound(stopMatch)">取消匹配</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ const props = defineProps({
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
/** 当前用户是否为房主;仅房主可见踢人按钮 */
|
||||
isOwner: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const seats = new Array(props.total).fill(1);
|
||||
</script>
|
||||
@@ -45,8 +50,9 @@ const seats = new Array(props.total).fill(1);
|
||||
mode="widthFix"
|
||||
class="player-bg"
|
||||
/> -->
|
||||
<!-- 仅房主(isOwner=true)且非空座位时展示踢人按钮 -->
|
||||
<button
|
||||
v-if="index > 0 && players[index]"
|
||||
v-if="index > 0 && players[index] && isOwner"
|
||||
hover-class="none"
|
||||
class="remove-player"
|
||||
@click="() => removePlayer(players[index])"
|
||||
|
||||
@@ -29,6 +29,33 @@ const updateRemain = (value) => {
|
||||
if (timer.value) clearInterval(timer.value);
|
||||
return
|
||||
}
|
||||
// zeroThenReset:ToSomeoneShoot 到达时,若进度条仍在倒计时则先瞬间清零(约 150ms 停留)再显示下一玩家满值
|
||||
// 若进度条已到 0(loading 状态),直接切换满值
|
||||
if (value.zeroThenReset) {
|
||||
if (timer.value) clearInterval(timer.value);
|
||||
const wasNonZero = remain.value > 0;
|
||||
// 更新下一玩家颜色和方向(在清零和满值时均生效)
|
||||
currentTeam.value = value.team;
|
||||
if (value.team === 'red') barColor.value = "linear-gradient( 180deg, #FFA0A0 0%, #FF6060 100%)";
|
||||
if (value.team === 'blue') barColor.value = "linear-gradient( 180deg, #9AB3FF 0%, #4288FF 100%)";
|
||||
transitionStyle.value = "none";
|
||||
if (wasNonZero) {
|
||||
// 瞬间清零,停留约 150ms 后切换为满值
|
||||
remain.value = 0;
|
||||
loading.value = true;
|
||||
setTimeout(() => {
|
||||
remain.value = value.value;
|
||||
loading.value = false;
|
||||
setTimeout(() => { transitionStyle.value = "all 1s linear"; }, 50);
|
||||
}, 150);
|
||||
} else {
|
||||
// 已在底部,直接切换满值
|
||||
remain.value = value.value;
|
||||
loading.value = false;
|
||||
setTimeout(() => { transitionStyle.value = "all 1s linear"; }, 50);
|
||||
}
|
||||
return;
|
||||
}
|
||||
loading.value = false;
|
||||
currentTeam.value = value.team
|
||||
if (value.team === 'red')
|
||||
|
||||
15
src/main.js
15
src/main.js
@@ -1,11 +1,26 @@
|
||||
import { createSSRApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
import App from './App.vue'
|
||||
import audioManager from './audioManager'
|
||||
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
const pinia = createPinia()
|
||||
pinia.use(piniaPluginPersistedstate)
|
||||
app.use(pinia)
|
||||
|
||||
/**
|
||||
* 全局点击音效工具函数,用于在任意按钮/元素点击时自动播放音效。
|
||||
* 用法:@click="$clickSound(handler)" 或 @click="$clickSound(() => doSomething())"
|
||||
* @param {Function} handler - 原始点击回调函数(可选,点击时直接调用)
|
||||
* @param {string} [soundKey='点击按钮'] - audioManager 中的音效 key
|
||||
*/
|
||||
app.config.globalProperties.$clickSound = (handler, soundKey = '点击按钮') => {
|
||||
audioManager.play(soundKey);
|
||||
if (typeof handler === 'function') handler();
|
||||
};
|
||||
|
||||
return {
|
||||
app
|
||||
}
|
||||
|
||||
@@ -9,9 +9,7 @@ import Avatar from "@/components/Avatar.vue";
|
||||
import ScreenHint from "@/components/ScreenHint.vue";
|
||||
import {
|
||||
getRoomAPI,
|
||||
destroyRoomAPI,
|
||||
exitRoomAPI,
|
||||
startRoomAPI,
|
||||
chooseTeamAPI,
|
||||
getReadyAPI,
|
||||
kickPlayerAPI,
|
||||
@@ -19,6 +17,7 @@ import {
|
||||
import { MESSAGETYPES, MESSAGETYPESV2 } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
import audioManager from "@/audioManager";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
|
||||
@@ -57,6 +56,8 @@ const ready = ref(false);
|
||||
const allReady = ref(false);
|
||||
const timer = ref(null);
|
||||
const goBattle = ref(false);
|
||||
/** 从结算页返回时为 true,跳过进场靶纸语音 */
|
||||
const skipTargetAudio = ref(false);
|
||||
|
||||
/**
|
||||
* 从服务端刷新当前房间数据,更新成员列表、准备状态等信息
|
||||
@@ -135,10 +136,6 @@ async function refreshRoomData() {
|
||||
// timer.value = setTimeout(refreshRoomData, 2000);
|
||||
}
|
||||
|
||||
const startGame = async () => {
|
||||
const result = await startRoomAPI(room.value.number);
|
||||
};
|
||||
|
||||
const getReady = async () => {
|
||||
await getReadyAPI(roomNumber.value);
|
||||
};
|
||||
@@ -213,14 +210,6 @@ const chooseTeam = async (team) => {
|
||||
refreshMembers(result.members);
|
||||
};
|
||||
|
||||
const destroyRoom = async () => {
|
||||
if (roomNumber.value) await destroyRoomAPI(roomNumber.value);
|
||||
};
|
||||
|
||||
const exitRoom = async () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
/** 待确认踢出的玩家信息 */
|
||||
const playerToKick = ref(null);
|
||||
/** 控制踢出确认弹窗的显示状态 */
|
||||
@@ -276,11 +265,26 @@ const shareTitle = computed(() => {
|
||||
return '星球论箭,来一决高下敢否?';
|
||||
});
|
||||
|
||||
/**
|
||||
* 根据对战类型和靶纸尺寸动态返回分享封面图路径,共 4 张图:
|
||||
* contest_share_20.png — 约战/对抗赛 + 20cm 靶
|
||||
* contest_share_40.png — 约战/对抗赛 + 40cm 靶
|
||||
* melee_share_20.png — 多人乱斗 + 20cm 靶
|
||||
* melee_share_40.png — 多人乱斗 + 40cm 靶
|
||||
*
|
||||
* 当 targetSize 未知时默认取 20cm 图。
|
||||
*/
|
||||
const shareImage = computed(() => {
|
||||
const type = room.value.battleType === 2 ? 'melee' : 'contest';
|
||||
const size = targetSize.value === 40 ? '40' : '20';
|
||||
return `https://static.shelingxingqiu.com/shootmini/static/share/${type}_share_${size}.png`;
|
||||
});
|
||||
|
||||
onShareAppMessage(() => {
|
||||
return {
|
||||
title: shareTitle.value,
|
||||
path: "/pages/friend-battle?roomID=" + roomNumber.value,
|
||||
imageUrl: "",
|
||||
imageUrl: shareImage.value,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -300,6 +304,8 @@ onShow(() => {
|
||||
* - 同步到 Pinia Store(供 Header 组件展示房号胶囊)
|
||||
*/
|
||||
onLoad(async (options) => {
|
||||
// 从结算页跳回时携带 fromResult=1,标记跳过进场语音
|
||||
if (options.fromResult) skipTargetAudio.value = true;
|
||||
if (options.roomNumber) {
|
||||
roomNumber.value = options.roomNumber;
|
||||
store.updateRoomNumber(options.roomNumber);
|
||||
@@ -324,6 +330,13 @@ onMounted(() => {
|
||||
keepScreenOn: true,
|
||||
});
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
// 页面加载完成 1 秒后根据靶纸尺寸播报对应语音;从结算页返回时跳过
|
||||
setTimeout(() => {
|
||||
if (!skipTargetAudio.value) {
|
||||
const key = targetSize.value === 40 ? '40CM全环靶' : '20CM全环靶';
|
||||
audioManager.play(key);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@@ -385,7 +398,8 @@ onBeforeUnmount(() => {
|
||||
<view v-for="(item, index) in players" :key="index">
|
||||
<Avatar v-if="item.id" :src="item.avatar" :size="36" />
|
||||
<text v-if="owner.id === item.id">管理员</text>
|
||||
<button v-if="owner.id !== item.id && item.id" hover-class="none" class="remove-player"
|
||||
<!-- 仅房主可见踢人按钮,且不能踢自己 -->
|
||||
<button v-if="owner.id !== item.id && item.id && owner.id === user.id" hover-class="none" class="remove-player"
|
||||
@click="() => removePlayer(item)" :style="{ top: '-10rpx', right: '-10rpx' }">
|
||||
<image src="../static/close-white.png" mode="widthFix" />
|
||||
</button>
|
||||
@@ -425,10 +439,11 @@ onBeforeUnmount(() => {
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- isOwner:当前用户是房主时才展示踢人按钮 -->
|
||||
<PlayerSeats v-if="room.battleType === 2" :total="room.count || 10" :players="players"
|
||||
:removePlayer="removePlayer" />
|
||||
:removePlayer="removePlayer" :isOwner="owner.id === user.id" />
|
||||
<view>
|
||||
<SButton :disabled="!canClick" :onClick="getReady">
|
||||
<SButton :disabled="!canClick" :onClick="() => $clickSound(getReady)">
|
||||
{{
|
||||
allReady.value
|
||||
? "即将进入对局..."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { onLoad } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import UserUpgrade from "@/components/UserUpgrade.vue";
|
||||
import { getBattleAPI } from "@/apis";
|
||||
import { getBattleAPI, getRoomAPI } from "@/apis";
|
||||
import { getBattleResultTips } from "@/constants";
|
||||
import audioManager from "@/audioManager";
|
||||
import useStore from "@/store";
|
||||
@@ -208,13 +208,14 @@ onLoad(async (options) => {
|
||||
audioManager.play(ifWin.value ? "胜利" : "失败");
|
||||
}
|
||||
|
||||
// 数据加载完成后显示覆盖动效层
|
||||
showOverlay.value = true;
|
||||
|
||||
// 2.5 秒后自动关闭覆盖层
|
||||
overlayTimer.value = setTimeout(() => {
|
||||
closeOverlay();
|
||||
}, 2500);
|
||||
// 数据加载完成后延迟 1 秒再显示激励弹窗,避免进场时画面太杂
|
||||
setTimeout(() => {
|
||||
showOverlay.value = true;
|
||||
// 弹窗显示后 2.5 秒自动关闭
|
||||
overlayTimer.value = setTimeout(() => {
|
||||
closeOverlay();
|
||||
}, 2500);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@@ -239,17 +240,42 @@ function closeOverlay() {
|
||||
/**
|
||||
* 底部按钮文案:好友约战显示“返回房间”,排位赛等其他模式显示“返回”
|
||||
*/
|
||||
const exitBtnText = computed(() => data.value.way === 1 ? '返回房间' : '返回');
|
||||
const exitBtnText = computed(() => data.value.way === 1 ? '再来一局' : '返回');
|
||||
|
||||
/**
|
||||
* 点击底部按钮跳转
|
||||
* - 好友约战(way=1):返回对战房间
|
||||
* - 好友约战(way=1):先调接口确认用户仍在房间
|
||||
* - 已被踢出或房间不存在 → toast 提示并 reLaunch 到首页
|
||||
* - 仍在房间 → 跳回对战房间
|
||||
* - 其他模式(排位赛等):跳转到排位赛首页
|
||||
*/
|
||||
function exit() {
|
||||
async function exit() {
|
||||
if (data.value.way === 1) {
|
||||
try {
|
||||
const roomInfo = await getRoomAPI(data.value.roomId);
|
||||
const members = roomInfo?.members || [];
|
||||
const myIdStr = String(user.value.id);
|
||||
// 判断当前用户是否仍在房间成员列表中
|
||||
const stillInRoom = members.some(
|
||||
(m) => String(m.userInfo?.id) === myIdStr
|
||||
);
|
||||
if (!stillInRoom) {
|
||||
uni.showToast({ title: '您已经不在当前房间', icon: 'none' });
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/index' });
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
// 接口异常(如房间已解散)同样视为已不在房间
|
||||
uni.showToast({ title: '您已经离开了房间', icon: 'none' });
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/index' });
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-room?roomNumber=${data.value.roomId}`,
|
||||
url: `/pages/battle-room?roomNumber=${data.value.roomId}&fromResult=1`,
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
@@ -855,8 +881,8 @@ function goBack() {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 200;
|
||||
/* rgba 写法等价于 background:#000 + opacity:0.7,且不影响子元素不透明度 */
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
/* rgba 写法等价于 background:#000 + opacity:0.5,且不影响子元素不透明度 */
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
@@ -98,8 +98,10 @@ onLoad(async (options) => {
|
||||
<Container title="好友约战" :showBackToGame="true">
|
||||
<view :style="{ width: '100%', height: '100%' }">
|
||||
<GuideTwo>
|
||||
<text :style="{color: 'rgba(255,217,71,0.8)'}">约上朋友开几局,欢乐多,不寂寞</text>
|
||||
<text>一起练升级更快,早日加入全国排位赛!</text>
|
||||
<view class="guide-tips">
|
||||
<text class="guide-tips__main">约上朋友开几局,欢乐多,不寂寞</text>
|
||||
<text class="guide-tips__sub">一起练升级更快,早日加入全国排位赛!</text>
|
||||
</view>
|
||||
</GuideTwo>
|
||||
<view class="my-data">
|
||||
<view>
|
||||
@@ -139,7 +141,7 @@ onLoad(async (options) => {
|
||||
<image src="../static/founded-room.png" mode="widthFix" />
|
||||
<view>
|
||||
<input placeholder="输入房间号" v-model="roomNumber" placeholder-style="color: #ccc" />
|
||||
<view @click="enterRoom(roomNumber)">进入房间</view>
|
||||
<view @click="$clickSound(() => enterRoom(roomNumber))">进入房间</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="create-room">
|
||||
@@ -153,7 +155,7 @@ onLoad(async (options) => {
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<SButton width="80%" :rounded="30" :onClick="onCreateRoom">
|
||||
<SButton width="80%" :rounded="30" :onClick="() => $clickSound(onCreateRoom)">
|
||||
创建约战房
|
||||
</SButton>
|
||||
</view>
|
||||
@@ -162,7 +164,8 @@ onLoad(async (options) => {
|
||||
<view v-if="warnning" class="warnning">
|
||||
{{ warnning }}
|
||||
</view>
|
||||
<CreateRoom v-if="!warnning" :onConfirm="() => (showModal = false)" />
|
||||
<!-- showModal 关闭时立即销毁组件,重开时重建,确保选项重置为 0 -->
|
||||
<CreateRoom v-if="!warnning && showModal" :onConfirm="() => (showModal = false)" />
|
||||
</SModal>
|
||||
<Signin :show="showSignin" :onClose="onSignin" />
|
||||
</view>
|
||||
@@ -170,6 +173,24 @@ onLoad(async (options) => {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.guide-tips {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 112rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.guide-tips__main {
|
||||
font-weight: 400;
|
||||
font-size: 26rpx;
|
||||
color: rgba(255, 217, 71, 0.8);
|
||||
}
|
||||
.guide-tips__sub {
|
||||
font-weight: 400;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.founded-room {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -159,10 +159,10 @@ onShareTimeline(() => {
|
||||
<Container :isHome="true" :showBackToGame="true">
|
||||
<view class="container">
|
||||
<view class="top-theme">
|
||||
<image
|
||||
<!-- <image
|
||||
src="https://static.shelingxingqiu.com/attachment/2025-12-31/dfc9dxrq4xn7e6y2pp.png"
|
||||
mode="widthFix"
|
||||
/>
|
||||
/> -->
|
||||
</view>
|
||||
<UserHeader showRank :onSignin="() => (showModal = true)"/>
|
||||
<view :style="{ padding: '12px 10px' }">
|
||||
@@ -178,7 +178,7 @@ onShareTimeline(() => {
|
||||
v-else
|
||||
src="https://static.shelingxingqiu.com/attachment/2026-01-04/dffohwtk1gwh0xfa6h.png"
|
||||
mode="widthFix"
|
||||
@click="() => toPage('/pages/my-device')"
|
||||
@click="$clickSound(() => toPage('/pages/my-device'))"
|
||||
/>
|
||||
<block v-if="user.id">
|
||||
<text v-if="!device.deviceId">绑定我的智能弓</text>
|
||||
@@ -196,10 +196,10 @@ onShareTimeline(() => {
|
||||
</BubbleTip>
|
||||
</view>
|
||||
<view class="play-card">
|
||||
<view @click="() => toPage('/pages/practise')">
|
||||
<view @click="$clickSound(() => toPage('/pages/practise'))">
|
||||
<image src="../static/my-practise.png" mode="widthFix"/>
|
||||
</view>
|
||||
<view @click="() => toPage('/pages/friend-battle')">
|
||||
<view @click="$clickSound(() => toPage('/pages/friend-battle'))">
|
||||
<image src="../static/friend-battle.png" mode="widthFix"/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -211,7 +211,7 @@ onShareTimeline(() => {
|
||||
/>
|
||||
<button
|
||||
class="into-btn"
|
||||
@click="() => toPage('/pages/ranking')"
|
||||
@click="$clickSound(() => toPage('/pages/ranking'))"
|
||||
hover-class="none"
|
||||
></button>
|
||||
<view class="ranking-players" @click="toRankListPage">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount, watch } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, watch, nextTick } from "vue";
|
||||
import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import BowTarget from "@/components/BowTarget.vue";
|
||||
@@ -32,6 +32,8 @@ const halfTimeTip = ref(false);
|
||||
const halfRest = ref(false);
|
||||
/** 控制设备离线提示弹窗的显示状态 */
|
||||
const showOfflineModal = ref(false);
|
||||
/** 记录每位玩家当前半场连续 X 环数,key 为 playerId,用于触发 tententen 音效 */
|
||||
const xRingStreaks = ref({});
|
||||
|
||||
/**
|
||||
* 监听设备在线状态,大乱斗比赛进行中设备离线时弹窗提示用户
|
||||
@@ -120,6 +122,28 @@ onLoad(async (options) => {
|
||||
// });
|
||||
});
|
||||
|
||||
/**
|
||||
* 检测指定玩家连续 X 环是否达到 3 箭,达到则在环数播报入队后追加 tententen 音效
|
||||
* @param {number|string} playerId - 本次射手的 ID(大乱斗中 ShootResult 保留 playerId)
|
||||
* @param {boolean} isXRing - 本次射击是否为 X 环
|
||||
*/
|
||||
function checkAndPlayTententen(playerId, isXRing) {
|
||||
if (!playerId) return;
|
||||
const id = parseInt(playerId);
|
||||
if (isXRing) {
|
||||
xRingStreaks.value[id] = (xRingStreaks.value[id] || 0) + 1;
|
||||
// 同一玩家连续 3 箭均为 X 环,追加到环数音效队列尾部播放
|
||||
if (xRingStreaks.value[id] >= 3) {
|
||||
xRingStreaks.value[id] = 0;
|
||||
// nextTick 确保 HeaderProgress 的环数播报已入队后再追加 tententen,避免播放顺序颠倒
|
||||
nextTick(() => audioManager.play("tententen", false));
|
||||
}
|
||||
} else {
|
||||
// 非 X 环则重置该玩家的连续计数
|
||||
xRingStreaks.value[id] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function onReceiveMessage(msg) {
|
||||
if (Array.isArray(msg)) return;
|
||||
if (msg.type === MESSAGETYPESV2.BattleStart) {
|
||||
@@ -127,7 +151,28 @@ async function onReceiveMessage(msg) {
|
||||
halfRest.value = false;
|
||||
recoverData(msg);
|
||||
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
// 更新前快照各玩家本轮已射箭数,用于事后识别本次射手
|
||||
const curRound = playersScores.value[playersScores.value.length - 1] || {};
|
||||
const prevCounts = {};
|
||||
for (const pid of Object.keys(curRound)) {
|
||||
prevCounts[pid] = (curRound[pid] || []).length;
|
||||
}
|
||||
recoverData(msg);
|
||||
// 对比更新后数据找出箭数增加的玩家(即本次射手),并读取其最新箭的 ring 数据
|
||||
const newRound = playersScores.value[playersScores.value.length - 1] || {};
|
||||
let shooterId = null;
|
||||
let isXRing = false;
|
||||
for (const pid of Object.keys(newRound)) {
|
||||
const newLen = (newRound[pid] || []).length;
|
||||
if (newLen > (prevCounts[pid] || 0)) {
|
||||
shooterId = parseInt(pid);
|
||||
const shot = newRound[pid][newLen - 1];
|
||||
isXRing = !!(shot?.ringX && shot?.ring);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 检测同一玩家三箭全 X 环,触发 tententen 音效
|
||||
checkAndPlayTententen(shooterId, isXRing);
|
||||
} else if (msg.type === MESSAGETYPESV2.HalfRest) {
|
||||
halfTimeTip.value = true;
|
||||
halfRest.value = true;
|
||||
|
||||
@@ -130,7 +130,7 @@ onShow(() => {
|
||||
<template>
|
||||
<Container title="弓箭绑定">
|
||||
<view v-if="!device.deviceId" class="scan-code">
|
||||
<button hover-class="none" @click="handleScan">
|
||||
<button hover-class="none" @click="$clickSound(handleScan)">
|
||||
<image src="../static/scan.png" mode="widthFix" />
|
||||
</button>
|
||||
<button hover-class="none" @click="showTip = true">
|
||||
@@ -269,7 +269,7 @@ onShow(() => {
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ marginTop: '240rpx' }">
|
||||
<SButton :onClick="unbindDevice" width="80vw" :rounded="40"
|
||||
<SButton :onClick="() => $clickSound(unbindDevice)" width="80vw" :rounded="40"
|
||||
>解绑</SButton
|
||||
>
|
||||
</view>
|
||||
|
||||
@@ -114,7 +114,7 @@ onMounted(async () => {
|
||||
/>
|
||||
</view>
|
||||
<template #bottom>
|
||||
<SButton :rounded="50" :onClick="toEditPage">下一步</SButton>
|
||||
<SButton :rounded="50" :onClick="() => $clickSound(toEditPage)">下一步</SButton>
|
||||
</template>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
@@ -198,7 +198,7 @@ onLoad((options) => {
|
||||
</ScreenHint2>
|
||||
</view>
|
||||
<template #bottom>
|
||||
<SButton :rounded="50" :onClick="onSubmit">
|
||||
<SButton :rounded="50" :onClick="() => $clickSound(onSubmit)">
|
||||
{{ currentGroup === groups ? "保存并查看分析" : "下一组" }}
|
||||
</SButton>
|
||||
</template>
|
||||
|
||||
@@ -329,10 +329,10 @@ onShareTimeline(() => {
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<button hover-class="none" @click="toRecordPage" class="image-btn">
|
||||
<button hover-class="none" @click="$clickSound(toRecordPage)" class="image-btn">
|
||||
<image src="../static/record-btn.png" mode="widthFix" />
|
||||
</button>
|
||||
<button hover-class="none" @click="startScoring" class="image-btn">
|
||||
<button hover-class="none" @click="$clickSound(startScoring)" class="image-btn">
|
||||
<image src="../static/start-scoring.png" mode="widthFix" />
|
||||
</button>
|
||||
</view>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, nextTick } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import ShootProgress from "@/components/ShootProgress.vue";
|
||||
@@ -31,6 +31,8 @@ const { user } = storeToRefs(store);
|
||||
const start = ref(false);
|
||||
const scores = ref([]);
|
||||
const total = 12;
|
||||
/** 当前练习中连续 X 环计数,用于触发 tententen 音效 */
|
||||
const xRingStreak = ref(0);
|
||||
const practiseResult = ref({});
|
||||
const practiseId = ref("");
|
||||
const showGuide = ref(false);
|
||||
@@ -46,6 +48,7 @@ onLoad((options) => {
|
||||
const onReady = async () => {
|
||||
await startPractiseAPI();
|
||||
scores.value = [];
|
||||
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
||||
start.value = true;
|
||||
audioManager.play("练习开始");
|
||||
};
|
||||
@@ -55,9 +58,33 @@ const onOver = async () => {
|
||||
start.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 检测连续 X 环是否达到 3 箭,达到则播放 tententen 音效
|
||||
* @param {boolean} isXRing - 本次射击是否为 X 环
|
||||
*/
|
||||
function checkAndPlayTententen(isXRing) {
|
||||
if (isXRing) {
|
||||
xRingStreak.value += 1;
|
||||
// 连续 3 箭均为 X 环,在环数播报入队后追加 tententen,避免播放顺序颠倒
|
||||
if (xRingStreak.value >= 3) {
|
||||
xRingStreak.value = 0;
|
||||
nextTick(() => audioManager.play("tententen", false));
|
||||
}
|
||||
} else {
|
||||
// 非 X 环则重置连续计数
|
||||
xRingStreak.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function onReceiveMessage(msg) {
|
||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
const prevLen = scores.value.length;
|
||||
scores.value = msg.details;
|
||||
// 有新箭时取最后一箭判断是否 X 环并检测连续计数
|
||||
if (scores.value.length > prevLen) {
|
||||
const latestArrow = scores.value[scores.value.length - 1];
|
||||
checkAndPlayTententen(!!(latestArrow?.ringX && latestArrow?.ring));
|
||||
}
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||
// setTimeout(onOver, 1500);
|
||||
}
|
||||
@@ -74,6 +101,7 @@ async function onComplete() {
|
||||
practiseResult.value = {};
|
||||
start.value = false;
|
||||
scores.value = [];
|
||||
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
||||
const result = await createPractiseAPI(total, 120);
|
||||
if (result) practiseId.value = result.id;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, nextTick } from "vue";
|
||||
import Container from "@/components/Container.vue";
|
||||
import ShootProgress from "@/components/ShootProgress.vue";
|
||||
import BowTarget from "@/components/BowTarget.vue";
|
||||
@@ -31,6 +31,8 @@ const { user } = storeToRefs(store);
|
||||
const start = ref(false);
|
||||
const scores = ref([]);
|
||||
const total = 36;
|
||||
/** 当前练习中连续 X 环计数,用于触发 tententen 音效 */
|
||||
const xRingStreak = ref(0);
|
||||
const practiseResult = ref({});
|
||||
const practiseId = ref("");
|
||||
const showGuide = ref(false);
|
||||
@@ -45,6 +47,7 @@ onLoad((options) => {
|
||||
const onReady = async () => {
|
||||
await startPractiseAPI();
|
||||
scores.value = [];
|
||||
xRingStreak.value = 0; // 新一局开始,重置 X 环连续计数
|
||||
start.value = true;
|
||||
audioManager.play("练习开始");
|
||||
};
|
||||
@@ -54,9 +57,33 @@ const onOver = async () => {
|
||||
start.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 检测连续 X 环是否达到 3 箭,达到则播放 tententen 音效
|
||||
* @param {boolean} isXRing - 本次射击是否为 X 环
|
||||
*/
|
||||
function checkAndPlayTententen(isXRing) {
|
||||
if (isXRing) {
|
||||
xRingStreak.value += 1;
|
||||
// 连续 3 箭均为 X 环,在环数播报入队后追加 tententen,避免播放顺序颠倒
|
||||
if (xRingStreak.value >= 3) {
|
||||
xRingStreak.value = 0;
|
||||
nextTick(() => audioManager.play("tententen", false));
|
||||
}
|
||||
} else {
|
||||
// 非 X 环则重置连续计数
|
||||
xRingStreak.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function onReceiveMessage(msg) {
|
||||
if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
const prevLen = scores.value.length;
|
||||
scores.value = msg.details;
|
||||
// 有新箭时取最后一箭判断是否 X 环并检测连续计数
|
||||
if (scores.value.length > prevLen) {
|
||||
const latestArrow = scores.value[scores.value.length - 1];
|
||||
checkAndPlayTententen(!!(latestArrow?.ringX && latestArrow?.ring));
|
||||
}
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||
setTimeout(onOver, 1500);
|
||||
}
|
||||
@@ -89,7 +116,8 @@ async function onComplete() {
|
||||
practiseResult.value = {};
|
||||
start.value = false;
|
||||
scores.value = [];
|
||||
const result = await createPractiseAPI(total, 3600);
|
||||
xRingStreak.value = 0; // 重新开始练习,重置 X 环连续计数
|
||||
const result = await createPractiseAPI(total, 360);
|
||||
if (result) practiseId.value = result.id;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +133,7 @@ onMounted(async () => {
|
||||
});
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
uni.$on("share-image", onClickShare);
|
||||
const result = await createPractiseAPI(total, 3600, targetType.value);
|
||||
const result = await createPractiseAPI(total, 360, targetType.value);
|
||||
if (result) practiseId.value = result.id;
|
||||
});
|
||||
|
||||
@@ -132,7 +160,7 @@ onBeforeUnmount(() => {
|
||||
<ShootProgress
|
||||
:tips="`请连续射${total}支箭`"
|
||||
:start="start"
|
||||
:total="3600"
|
||||
:total="360"
|
||||
:onStop="onOver"
|
||||
/>
|
||||
<view class="user-row">
|
||||
|
||||
@@ -281,27 +281,27 @@ onShow(async () => {
|
||||
<image
|
||||
src="../static/rank/battle1v1.svg"
|
||||
mode="widthFix"
|
||||
@click.stop="() => toMatchPage(1, 2)"
|
||||
@click.stop="$clickSound(() => toMatchPage(1, 2))"
|
||||
/>
|
||||
<image
|
||||
src="../static/rank/battle2v2.svg"
|
||||
mode="widthFix"
|
||||
@click.stop="() => toMatchPage(2, 4)"
|
||||
@click.stop="$clickSound(() => toMatchPage(2, 4))"
|
||||
/>
|
||||
<image
|
||||
src="../static/rank/battle3v3.svg"
|
||||
mode="widthFix"
|
||||
@click.stop="() => toMatchPage(3, 6)"
|
||||
@click.stop="$clickSound(() => toMatchPage(3, 6))"
|
||||
/>
|
||||
<image
|
||||
src="../static/rank/battle5.svg"
|
||||
mode="widthFix"
|
||||
@click.stop="() => toMatchPage(4, 5)"
|
||||
@click.stop="$clickSound(() => toMatchPage(4, 5))"
|
||||
/>
|
||||
<image
|
||||
src="../static/rank/battle10.svg"
|
||||
mode="widthFix"
|
||||
@click.stop="() => toMatchPage(5, 10)"
|
||||
@click.stop="$clickSound(() => toMatchPage(5, 10))"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -41,12 +41,16 @@ const showRoundTip = ref(false);
|
||||
const isFinalShoot = ref(false);
|
||||
const matchStatus = ref(undefined);
|
||||
const updateRemainSecond = ref(0);
|
||||
/** 当前对局每人射击时间(秒),从后端 shootTime 字段动态读取,默认 15 */
|
||||
const shootTimeTotal = ref(15);
|
||||
/** 对战来源类型(1=好友约战,2=匹配对战),用于结算页分流 */
|
||||
const battleWay = ref(0);
|
||||
/** 上一次处理的 ToSomeoneShoot 关键字段,用于去重过滤重复消息 */
|
||||
const lastToSomeoneShootKey = ref("");
|
||||
/** 控制设备离线提示弹窗的显示状态 */
|
||||
const showOfflineModal = ref(false);
|
||||
/** 记录每位玩家当前轮连续 X 环数,key 为 playerId,用于触发 tententen 音效 */
|
||||
const xRingStreaks = ref({});
|
||||
|
||||
/**
|
||||
* 监听设备在线状态,比赛进行中设备离线时弹窗提示用户
|
||||
@@ -100,8 +104,7 @@ const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => {
|
||||
let nextTips = redPlayer ? "请红队射箭" : "请蓝队射箭";
|
||||
if (force) nextTips += "重回";
|
||||
if (
|
||||
battleInfo.current.playerId === user.value.id &&
|
||||
redTeam.value.length > 1
|
||||
battleInfo.current.playerId === user.value.id
|
||||
) {
|
||||
nextTips += "你";
|
||||
}
|
||||
@@ -123,29 +126,42 @@ const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => {
|
||||
}
|
||||
// redPlayer 已在上方 find() 确认:不为 null 则当前射手在红队
|
||||
const targetTeam = redPlayer ? 'red' : 'blue';
|
||||
// 从后端消息读取本局射击时间,动态设置进度条满值与倒计时秒数(降级兜底 15s)
|
||||
shootTimeTotal.value = battleInfo.shootTime ?? 15;
|
||||
if (force) {
|
||||
// force 模式下 start.value 刚由 null 变 true,Vue 异步调度渲染,
|
||||
// ShootProgress2(v-if="start")尚未挂载,update-remain 事件会被丢弃。
|
||||
// 同时 HeaderProgress 对含"重回"的 tips 拦截音频,倒计时无法依赖
|
||||
// onAudioEnded 驱动,需在 nextTick 后直接启动。
|
||||
|
||||
// playerId=0 表示后端处于过渡状态(上一位射手已完成、下一位尚未分配)
|
||||
// 此时 startTime/targetTeam 均不可靠,停止进度条并等待 WS ToSomeoneShoot 驱动
|
||||
if (!battleInfo.current.playerId) {
|
||||
nextTick(() => {
|
||||
uni.$emit("update-tips", nextTips);
|
||||
uni.$emit("update-remain", {stop: true});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const elapsed = (Date.now() - battleInfo.current.startTime) / 1000;
|
||||
console.log(`当前轮已进行${elapsed}秒`);
|
||||
if (elapsed > 0 && elapsed < 15) {
|
||||
updateRemainSecond.value = 15 - elapsed - 0.2;
|
||||
if (elapsed > 0 && elapsed < shootTimeTotal.value) {
|
||||
updateRemainSecond.value = shootTimeTotal.value - elapsed - 0.2;
|
||||
}
|
||||
const actualRemain = updateRemainSecond.value;
|
||||
nextTick(() => {
|
||||
// 在 nextTick 内统一发送,确保 ShootProgress2 和 HeaderProgress 均已挂载
|
||||
uni.$emit("update-tips", nextTips);
|
||||
uni.$emit("update-remain", {reset: true, value: 15, team: targetTeam});
|
||||
uni.$emit("update-remain", {reset: true, value: shootTimeTotal.value, team: targetTeam});
|
||||
// 重置动画完成后,直接启动倒计时(无需依赖音频结束回调)
|
||||
setTimeout(() => {
|
||||
uni.$emit("update-remain", {stop: false, value: actualRemain, team: targetTeam});
|
||||
}, 100);
|
||||
});
|
||||
} else {
|
||||
uni.$emit("update-remain", {reset: true, value: 15, team: targetTeam});
|
||||
updateRemainSecond.value = battleInfo.readyTime;
|
||||
// ToSomeoneShoot 到达时:若进度条仍在倒计时则瞬间清零再切换满值,确保视觉连贯
|
||||
uni.$emit("update-remain", {zeroThenReset: true, value: shootTimeTotal.value, team: targetTeam});
|
||||
updateRemainSecond.value = shootTimeTotal.value;
|
||||
}
|
||||
} else {
|
||||
currentRound.value = battleInfo.current.round || 1;
|
||||
@@ -196,9 +212,12 @@ function onBattleEnd() {
|
||||
function onNewRound(msg, prevRound) {
|
||||
showRoundTip.value = true;
|
||||
isFinalShoot.value = msg.current.goldRound;
|
||||
// 决金箭轮每人只射一箭,重置箭数显示为 (0/1)
|
||||
// 新轮次开始时立即清空靶纸箭迹,避免残留上一轮落点至新轮次第一箭到来
|
||||
scores.value = [];
|
||||
blueScores.value = [];
|
||||
// 决金轮箭数不确定(平局后可能再加一箭),清零 totalShot 隐藏箭数显示
|
||||
if (msg.current.goldRound) {
|
||||
store.updateShotInfo(0, 1);
|
||||
store.updateShotInfo(0, 0);
|
||||
}
|
||||
// 用传入的 prevRound(捕获时刻的旧轮次)展示结算 Tip,与进度条 currentRound 解耦
|
||||
roundTipRound.value = prevRound;
|
||||
@@ -214,6 +233,27 @@ function onNewRound(msg, prevRound) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测指定射手连续 X 环是否达到 3 箭,达到则在环数播报入队后追加 tententen 音效
|
||||
* @param {number} shooterId - 本次射手的 ID(取自 currentShooterId.value)
|
||||
* @param {boolean} isXRing - 本次射击是否为 X 环
|
||||
*/
|
||||
function checkAndPlayTententen(shooterId, isXRing) {
|
||||
if (!shooterId) return;
|
||||
if (isXRing) {
|
||||
xRingStreaks.value[shooterId] = (xRingStreaks.value[shooterId] || 0) + 1;
|
||||
// 同一玩家连续 3 箭均为 X 环,追加到环数音效队列尾部播放
|
||||
if (xRingStreaks.value[shooterId] >= 3) {
|
||||
xRingStreaks.value[shooterId] = 0;
|
||||
// nextTick 确保 HeaderProgress 的环数播报已入队后再追加 tententen,避免播放顺序颠倒
|
||||
nextTick(() => audioManager.play("tententen", false));
|
||||
}
|
||||
} else {
|
||||
// 非 X 环则重置该玩家的连续计数
|
||||
xRingStreaks.value[shooterId] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async function onReceiveMessage(msg) {
|
||||
if (Array.isArray(msg)) return;
|
||||
if (msg.type === MESSAGETYPESV2.BattleStart) {
|
||||
@@ -226,9 +266,11 @@ async function onReceiveMessage(msg) {
|
||||
lastToSomeoneShootKey.value = key;
|
||||
recoverData(msg);
|
||||
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
uni.$emit("update-remain", {stop: true})
|
||||
showRoundTip.value = false;
|
||||
recoverData(msg, {arrowOnly: true});
|
||||
// 检测同一玩家三箭全 X 环,触发 tententen 音效
|
||||
// currentShooterId 在 ToSomeoneShoot 时写入,ShootResult 不会覆盖,可靠识别本次射手
|
||||
checkAndPlayTententen(currentShooterId.value, !!(msg.shootData?.ringX && msg.shootData?.ring));
|
||||
} else if (msg.type === MESSAGETYPESV2.NewRound) {
|
||||
// 在进入延迟前先捕获当前轮次,供 onNewRound 使用,防止 800ms 内 ToSomeoneShoot 提前更新 currentRound 造成 Tip 展示错轮
|
||||
const prevRound = currentRound.value;
|
||||
@@ -280,6 +322,8 @@ onBeforeUnmount(() => {
|
||||
const refreshTimer = ref(null);
|
||||
onShow(async () => {
|
||||
if (battleId.value) {
|
||||
// 延迟 300ms 等待网络恢复,避免小程序从后台切回时网络尚未就绪导致请求失败报错
|
||||
await new Promise(resolve => setTimeout(resolve, 300));
|
||||
const result = await getBattleAPI(battleId.value);
|
||||
if (!result) return;
|
||||
if (result.status === 2) {
|
||||
@@ -290,14 +334,16 @@ onShow(async () => {
|
||||
} else {
|
||||
if (result.status !== 0) {
|
||||
// 比赛进行中,从后端恢复箭数(测距阶段不展示)
|
||||
if (result.shootNumber) {
|
||||
// current.index 为 0 基的已射箭数(0=尚未射出),与 ShootResult 累加语义一致
|
||||
// 注意:不再 +1,避免重进时与后续 ShootResult 自增形成双重计数导致超出 totalShot
|
||||
store.updateShotInfo(result.current?.index ?? 0, result.shootNumber);
|
||||
// 决金轮不展示箭数;其余轮次从 indexMap 按用户 id 取已射箭数
|
||||
if (result.shootNumber && !result.current?.goldRound) {
|
||||
store.updateShotInfo(result.current?.indexMap?.[user.value.id] ?? 0, result.shootNumber);
|
||||
}
|
||||
} else {
|
||||
// 测距阶段重置箭数,防止 ImmediateWatcher 读取 Pinia 保留的旧值
|
||||
// 测距阶段重置箭数和提示文案,防止 ImmediateWatcher 读取 Pinia 保留的旧值
|
||||
store.updateShotInfo(0, 0);
|
||||
// 同步清空 Pinia tips 与本地 tips,避免重新开赛时 HeaderProgress 展示上一场旧文案
|
||||
store.updateTips("");
|
||||
tips.value = "";
|
||||
}
|
||||
recoverData(result, {force: true});
|
||||
}
|
||||
@@ -308,10 +354,12 @@ onShow(async () => {
|
||||
<template>
|
||||
<Container :bgType="start ? 3 : 1">
|
||||
<view class="container">
|
||||
<!-- winner=0 表示对局尚未开始,不显示胜者徽章 -->
|
||||
<BattleHeader
|
||||
v-if="start === false"
|
||||
:redTeam="redTeam"
|
||||
:blueTeam="blueTeam"
|
||||
:winner="0"
|
||||
/>
|
||||
<TestDistance v-if="start === false" :guide="false" :isBattle="true"/>
|
||||
<view v-if="start" class="players-row">
|
||||
@@ -322,6 +370,7 @@ onShow(async () => {
|
||||
/>
|
||||
<ShootProgress2
|
||||
:tips="tips"
|
||||
:total="shootTimeTotal"
|
||||
:currentRound="
|
||||
goldenRound > 0 ? 'gold' + goldenRound : 'round' + currentRound
|
||||
"
|
||||
|
||||
@@ -69,6 +69,10 @@ onMounted(() => {
|
||||
const envVersion = accountInfo.miniProgram.envVersion;
|
||||
if (envVersion !== "release") showLogout.value = true;
|
||||
});
|
||||
|
||||
/* global __BUILD_TIME__ */
|
||||
/** 构建时刻,由 vite.config.js define 在打包时自动注入;仅开发/体验版展示 */
|
||||
const buildVersion = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : '';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -140,6 +144,10 @@ onMounted(() => {
|
||||
:onClick="toAudioTestPage"
|
||||
v-if="showLogout"
|
||||
/>
|
||||
<UserItem
|
||||
title="版本信息(仅用于测试)"
|
||||
v-if="showLogout"
|
||||
>{{ buildVersion }}</UserItem>
|
||||
<UserItem
|
||||
title="退出登录(仅用于测试)"
|
||||
:onClick="logout"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 4.6 KiB |
16
src/store.js
16
src/store.js
@@ -154,14 +154,14 @@ export default defineStore("store", {
|
||||
},
|
||||
},
|
||||
|
||||
// 开启数据持久化
|
||||
// 数据持久化(via pinia-plugin-persistedstate)
|
||||
// 仅持久化 user 和 device:身份凭证需在冷启动时恢复(如从分享链接进入)
|
||||
// config、game 等运行时状态不持久化,每次联网后重新拉取
|
||||
persist: {
|
||||
enabled: true,
|
||||
strategies: [
|
||||
{
|
||||
storage: uni.getStorageSync,
|
||||
paths: ["user", "device", "config"], // 只持久化用户信息
|
||||
},
|
||||
],
|
||||
storage: {
|
||||
getItem: (key) => uni.getStorageSync(key),
|
||||
setItem: (key, value) => uni.setStorageSync(key, value),
|
||||
},
|
||||
paths: ['user', 'device'],
|
||||
},
|
||||
});
|
||||
|
||||
161
src/websocket.js
161
src/websocket.js
@@ -1,91 +1,61 @@
|
||||
import { MESSAGETYPES, getMessageTypeName } from "@/constants";
|
||||
import { getUserGameState } from "@/apis";
|
||||
|
||||
let socket = null;
|
||||
let heartbeatInterval = null;
|
||||
let reconnectTimer = null;
|
||||
let manualClose = false;
|
||||
let checkingSession = false;
|
||||
let kickedOut = false;
|
||||
let isConnecting = false;
|
||||
|
||||
/**
|
||||
* 建立 WebSocket 连接
|
||||
*/
|
||||
function createWebSocket(token, onMessage) {
|
||||
if (!token) return;
|
||||
if (kickedOut) kickedOut = false;
|
||||
if (socket || isConnecting) return;
|
||||
|
||||
manualClose = false;
|
||||
isConnecting = true;
|
||||
|
||||
let url = "wss://api.shelingxingqiu.com/socket";
|
||||
try {
|
||||
const accountInfo = uni.getAccountInfoSync();
|
||||
const envVersion = accountInfo.miniProgram.envVersion;
|
||||
|
||||
switch (envVersion) {
|
||||
case "develop":
|
||||
// url = "ws://localhost:8000/socket";
|
||||
case "develop": // 开发版
|
||||
// url = "ws://192.168.1.30:8000/socket";
|
||||
url = "wss://apitest.shelingxingqiu.com/socket";
|
||||
break;
|
||||
case "trial":
|
||||
case "trial": // 体验版
|
||||
url = "wss://apitest.shelingxingqiu.com/socket";
|
||||
break;
|
||||
case "release":
|
||||
case "release": // 正式版
|
||||
url = "wss://api.shelingxingqiu.com/socket";
|
||||
break;
|
||||
default:
|
||||
// 保持默认值
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("获取 WebSocket 环境信息失败,使用默认正式环境", e);
|
||||
console.error("获取环境信息失败,使用默认正式环境", e);
|
||||
}
|
||||
|
||||
url += `?authorization=${token}`;
|
||||
const socketTask = uni.connectSocket({
|
||||
socket = uni.connectSocket({
|
||||
url,
|
||||
success: () => {
|
||||
console.log("WebSocket 已发起连接");
|
||||
console.log("websocket 连接成功");
|
||||
// 启动心跳
|
||||
startHeartbeat(onMessage);
|
||||
},
|
||||
fail: (err) => {
|
||||
if (socket !== socketTask) return;
|
||||
console.error("WebSocket 连接失败", err);
|
||||
socket = null;
|
||||
isConnecting = false;
|
||||
fail: () => {
|
||||
reconnect(onMessage);
|
||||
},
|
||||
});
|
||||
|
||||
socket = socketTask;
|
||||
|
||||
socketTask.onOpen(() => {
|
||||
if (socket !== socketTask) return;
|
||||
console.log("WebSocket 连接成功");
|
||||
isConnecting = false;
|
||||
startHeartbeat(onMessage);
|
||||
});
|
||||
|
||||
socketTask.onMessage((res) => {
|
||||
if (socket !== socketTask) return;
|
||||
|
||||
// 接收消息
|
||||
uni.onSocketMessage((res) => {
|
||||
const { data, event } = JSON.parse(res.data);
|
||||
if (event === "pong") return;
|
||||
if (data.type) {
|
||||
console.log(
|
||||
"收到 WebSocket 消息",
|
||||
getMessageTypeName(data.type),
|
||||
data.data
|
||||
);
|
||||
console.log("收到消息:", getMessageTypeName(data.type), data.data);
|
||||
if (onMessage) onMessage({ ...(data.data || {}), type: data.type });
|
||||
return;
|
||||
}
|
||||
if (onMessage && data.updates) onMessage(data.updates);
|
||||
const msg = data.updates[0];
|
||||
if (msg) {
|
||||
console.log(
|
||||
"收到 WebSocket 更新",
|
||||
getMessageTypeName(msg.constructor),
|
||||
msg
|
||||
);
|
||||
console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
|
||||
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||
uni.setStorageSync("latestRank", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
||||
@@ -98,109 +68,84 @@ function createWebSocket(token, onMessage) {
|
||||
}
|
||||
});
|
||||
|
||||
socketTask.onError((err) => {
|
||||
if (socket !== socketTask) return;
|
||||
// 错误处理
|
||||
uni.onSocketError((err) => {
|
||||
console.error("WebSocket 错误", err);
|
||||
reconnect(onMessage);
|
||||
});
|
||||
|
||||
socketTask.onClose(async (result) => {
|
||||
if (socket !== socketTask) return;
|
||||
uni.onSocketClose((result) => {
|
||||
console.log("WebSocket 已关闭", result);
|
||||
stopHeartbeat();
|
||||
socket = null;
|
||||
isConnecting = false;
|
||||
|
||||
if (manualClose || kickedOut) return;
|
||||
await handleUnexpectedClose(onMessage);
|
||||
reconnect(onMessage);
|
||||
});
|
||||
}
|
||||
|
||||
async function handleUnexpectedClose(onMessage) {
|
||||
if (checkingSession || manualClose || kickedOut) return;
|
||||
/**
|
||||
* 重连机制
|
||||
*/
|
||||
function reconnect(onMessage) {
|
||||
reconnectTimer && clearTimeout(reconnectTimer);
|
||||
closeWebSocket(); // 确保关闭旧连接
|
||||
|
||||
const token = uni.getStorageSync(
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
if (!token) return;
|
||||
|
||||
checkingSession = true;
|
||||
try {
|
||||
await getUserGameState();
|
||||
if (!manualClose && !kickedOut) reconnect(onMessage);
|
||||
} catch (err) {
|
||||
if (err?.type === "AUTH_INVALID") {
|
||||
kickedOut = true;
|
||||
manualClose = true;
|
||||
reconnectTimer && clearTimeout(reconnectTimer);
|
||||
uni.$emit("session-kicked-out");
|
||||
return;
|
||||
}
|
||||
if (!manualClose && !kickedOut) reconnect(onMessage);
|
||||
} finally {
|
||||
checkingSession = false;
|
||||
}
|
||||
}
|
||||
|
||||
function reconnect(onMessage) {
|
||||
reconnectTimer && clearTimeout(reconnectTimer);
|
||||
|
||||
const token = uni.getStorageSync(
|
||||
`${uni.getAccountInfoSync().miniProgram.envVersion}_token`
|
||||
);
|
||||
if (!token || manualClose || kickedOut || socket || isConnecting) return;
|
||||
|
||||
reconnectTimer = setTimeout(() => {
|
||||
if (manualClose || kickedOut || socket || isConnecting) return;
|
||||
console.log("WebSocket 正在重连...");
|
||||
console.log("reconnecting...");
|
||||
createWebSocket(token, onMessage);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function closeWebSocket(isManual = true) {
|
||||
manualClose = isManual;
|
||||
reconnectTimer && clearTimeout(reconnectTimer);
|
||||
stopHeartbeat();
|
||||
isConnecting = false;
|
||||
|
||||
function closeWebSocket() {
|
||||
if (socket) {
|
||||
const currentSocket = socket;
|
||||
socket = null;
|
||||
reconnectTimer && clearTimeout(reconnectTimer);
|
||||
stopHeartbeat();
|
||||
|
||||
try {
|
||||
currentSocket.close();
|
||||
socket.close();
|
||||
} catch (err) {
|
||||
console.error("关闭 WebSocket 失败", err);
|
||||
console.error("关闭WebSocket连接失败", err);
|
||||
}
|
||||
|
||||
socket = null; // 清除socket引用
|
||||
}
|
||||
}
|
||||
|
||||
function sendHeartbeat(onMessage) {
|
||||
if (!socket) return;
|
||||
|
||||
const currentSocket = socket;
|
||||
currentSocket.send({
|
||||
uni.sendSocketMessage({
|
||||
data: JSON.stringify({ event: "ping", data: {} }),
|
||||
success: () => {},
|
||||
success: () => {
|
||||
// console.log("发送心跳成功");
|
||||
},
|
||||
fail: (err) => {
|
||||
if (socket !== currentSocket) return;
|
||||
console.error("心跳发送失败", err);
|
||||
console.error("发送心跳失败", err);
|
||||
stopHeartbeat();
|
||||
closeWebSocket(false);
|
||||
reconnect(onMessage);
|
||||
closeWebSocket(); // 关闭失效的连接
|
||||
reconnect(onMessage); // 触发重连
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动心跳
|
||||
*/
|
||||
function startHeartbeat(onMessage) {
|
||||
stopHeartbeat();
|
||||
stopHeartbeat(); // 防止重复启动
|
||||
|
||||
heartbeatInterval = setInterval(() => {
|
||||
if (socket) {
|
||||
if (socket && socket.readyState === 1) {
|
||||
// 检查连接状态
|
||||
sendHeartbeat(onMessage);
|
||||
}
|
||||
}, 10000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止心跳
|
||||
*/
|
||||
function stopHeartbeat() {
|
||||
if (heartbeatInterval) {
|
||||
clearInterval(heartbeatInterval);
|
||||
|
||||
@@ -12,6 +12,14 @@ export default defineConfig({
|
||||
plugins: [
|
||||
uni(),
|
||||
],
|
||||
/** 构建时常量注入:__BUILD_TIME__ 在源码中展开为精确的打包时刻字符串 */
|
||||
define: (() => {
|
||||
const d = new Date();
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
// 格式:YYYY.MMDD.HHmm,如 2026.0514.1530
|
||||
const version = `${d.getFullYear()}.${pad(d.getMonth() + 1)}${pad(d.getDate())}.${pad(d.getHours())}${pad(d.getMinutes())}`;
|
||||
return { __BUILD_TIME__: JSON.stringify(version) };
|
||||
})(),
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -3468,6 +3468,11 @@ pify@^2.3.0:
|
||||
resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz"
|
||||
integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==
|
||||
|
||||
pinia-plugin-persistedstate@3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.npmmirror.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.1.tgz#66780602aecd6c7b152dd7e3ddc249a1f7a13fe5"
|
||||
integrity sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==
|
||||
|
||||
pinia@2.0.36:
|
||||
version "2.0.36"
|
||||
resolved "https://registry.npmjs.org/pinia/-/pinia-2.0.36.tgz"
|
||||
|
||||
Reference in New Issue
Block a user