From 85c7712cecb98347ddd2b6863cf015a601f6909d Mon Sep 17 00:00:00 2001 From: kron Date: Sat, 26 Jul 2025 19:35:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87=E5=B7=B2?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis.js | 5 +++++ src/pages/battle-room.vue | 8 +++++++- src/pages/my-device.vue | 12 +++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/apis.js b/src/apis.js index df6586f..6a9babd 100644 --- a/src/apis.js +++ b/src/apis.js @@ -34,6 +34,11 @@ function request(method, url, data = {}) { resolve({}); return; } + if (message === "BIND_DEVICE") { + resolve({ binded: true }); + return; + + } if (message === "ERROR_ORDER_UNPAY") { uni.showToast({ title: "当前有未支付订单", diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index c501809..3a64d65 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -17,6 +17,7 @@ import ScreenHint from "@/components/ScreenHint.vue"; import RoundEndTip from "@/components/RoundEndTip.vue"; import TestDistance from "@/components/TestDistance.vue"; import PlayerScore from "@/components/PlayerScore.vue"; +import Avatar from "@/components/Avatar.vue"; import { getRoomAPI, destroyRoomAPI, @@ -255,6 +256,7 @@ async function refreshRoomData() { }); } } else if (result.battleType === 2) { + players.value = []; const ownerIndex = result.members.findIndex( (m) => m.userInfo.id === result.creator ); @@ -667,9 +669,13 @@ onHide(() => { :redTeam="redTeam" :currentShooterId="currentShooterId" /> + + + + { const confirmBind = async () => { if (!justBind.value && addDevice.value.id) { - await bindDeviceAPI(addDevice.value); - updateDevice(addDevice.value.id, addDevice.value.name); + const result = await bindDeviceAPI(addDevice.value); confirmBindTip.value = false; + if (result.binded) { + return uni.showToast({ + title: "设备已绑定其他账号,请解绑后再绑定", + icon: "none", + }); + } + updateDevice(addDevice.value.id, addDevice.value.name); justBind.value = true; uni.showToast({ title: "绑定成功", @@ -235,7 +241,7 @@ const backToHome = () => { .confirm-bind > view:last-child { display: flex; justify-content: space-between; - margin-top: 20px; + margin-top: 10px; } .confirm-bind > view:last-child > view { width: 48%;