添加设备已绑定提示
This commit is contained in:
@@ -34,6 +34,11 @@ function request(method, url, data = {}) {
|
|||||||
resolve({});
|
resolve({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (message === "BIND_DEVICE") {
|
||||||
|
resolve({ binded: true });
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
if (message === "ERROR_ORDER_UNPAY") {
|
if (message === "ERROR_ORDER_UNPAY") {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "当前有未支付订单",
|
title: "当前有未支付订单",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import ScreenHint from "@/components/ScreenHint.vue";
|
|||||||
import RoundEndTip from "@/components/RoundEndTip.vue";
|
import RoundEndTip from "@/components/RoundEndTip.vue";
|
||||||
import TestDistance from "@/components/TestDistance.vue";
|
import TestDistance from "@/components/TestDistance.vue";
|
||||||
import PlayerScore from "@/components/PlayerScore.vue";
|
import PlayerScore from "@/components/PlayerScore.vue";
|
||||||
|
import Avatar from "@/components/Avatar.vue";
|
||||||
import {
|
import {
|
||||||
getRoomAPI,
|
getRoomAPI,
|
||||||
destroyRoomAPI,
|
destroyRoomAPI,
|
||||||
@@ -255,6 +256,7 @@ async function refreshRoomData() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (result.battleType === 2) {
|
} else if (result.battleType === 2) {
|
||||||
|
players.value = [];
|
||||||
const ownerIndex = result.members.findIndex(
|
const ownerIndex = result.members.findIndex(
|
||||||
(m) => m.userInfo.id === result.creator
|
(m) => m.userInfo.id === result.creator
|
||||||
);
|
);
|
||||||
@@ -667,9 +669,13 @@ onHide(() => {
|
|||||||
:redTeam="redTeam"
|
:redTeam="redTeam"
|
||||||
:currentShooterId="currentShooterId"
|
:currentShooterId="currentShooterId"
|
||||||
/>
|
/>
|
||||||
|
<view v-if="battleType === 2" class="user-row">
|
||||||
|
<Avatar :src="user.avatar" :size="35" />
|
||||||
|
<BowPower :power="power" />
|
||||||
|
</view>
|
||||||
<BowTarget
|
<BowTarget
|
||||||
:mode="battleType === 1 ? 'team' : 'solo'"
|
:mode="battleType === 1 ? 'team' : 'solo'"
|
||||||
:power="start ? power : 0"
|
:power="battleType === 1 ? power : 0"
|
||||||
:currentRound="scores.length"
|
:currentRound="scores.length"
|
||||||
:totalRound="battleType === 1 ? 3 : totalRounds"
|
:totalRound="battleType === 1 ? 3 : totalRounds"
|
||||||
:scores="scores"
|
:scores="scores"
|
||||||
|
|||||||
@@ -43,9 +43,15 @@ const handleScan = () => {
|
|||||||
|
|
||||||
const confirmBind = async () => {
|
const confirmBind = async () => {
|
||||||
if (!justBind.value && addDevice.value.id) {
|
if (!justBind.value && addDevice.value.id) {
|
||||||
await bindDeviceAPI(addDevice.value);
|
const result = await bindDeviceAPI(addDevice.value);
|
||||||
updateDevice(addDevice.value.id, addDevice.value.name);
|
|
||||||
confirmBindTip.value = false;
|
confirmBindTip.value = false;
|
||||||
|
if (result.binded) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: "设备已绑定其他账号,请解绑后再绑定",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
updateDevice(addDevice.value.id, addDevice.value.name);
|
||||||
justBind.value = true;
|
justBind.value = true;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "绑定成功",
|
title: "绑定成功",
|
||||||
@@ -235,7 +241,7 @@ const backToHome = () => {
|
|||||||
.confirm-bind > view:last-child {
|
.confirm-bind > view:last-child {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 20px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.confirm-bind > view:last-child > view {
|
.confirm-bind > view:last-child > view {
|
||||||
width: 48%;
|
width: 48%;
|
||||||
|
|||||||
Reference in New Issue
Block a user