细节完善
This commit is contained in:
@@ -73,7 +73,7 @@ defineProps({
|
||||
<text class="player-name">{{ player.name }}</text>
|
||||
</view>
|
||||
<image
|
||||
v-if="winner === 0"
|
||||
v-if="winner === 2"
|
||||
src="../static/winner-badge.png"
|
||||
mode="widthFix"
|
||||
class="right-winner-badge"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onBeforeUnmount } from "vue";
|
||||
import audioManager from "@/audioManager";
|
||||
import { MESSAGETYPES, MESSAGETYPESV2 } from "@/constants";
|
||||
import { MESSAGETYPESV2 } from "@/constants";
|
||||
import { getDirectionText } from "@/util";
|
||||
|
||||
import useStore from "@/store";
|
||||
@@ -80,7 +80,7 @@ async function onReceiveMessage(message) {
|
||||
title: "距离不足,无效",
|
||||
icon: "none",
|
||||
});
|
||||
audioManager.pLay("射击无效");
|
||||
audioManager.play("射击无效");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,12 +143,12 @@ async function onReceiveMessage(msg) {
|
||||
} else if (msg.type === MESSAGETYPESV2.HalfRest) {
|
||||
halfTime.value = true;
|
||||
audioManager.play("中场休息");
|
||||
} else if (type === MESSAGETYPESV2.InvalidShot) {
|
||||
} else if (msg.type === MESSAGETYPESV2.InvalidShot) {
|
||||
uni.showToast({
|
||||
title: "距离不足,无效",
|
||||
icon: "none",
|
||||
});
|
||||
audioManager.pLay("射击无效");
|
||||
audioManager.play("射击无效");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,28 +87,34 @@ const handleLogin = async () => {
|
||||
});
|
||||
}
|
||||
loading.value = true;
|
||||
const wxResult = await wxLogin();
|
||||
const fileManager = uni.getFileSystemManager();
|
||||
const avatarBase64 = fileManager.readFileSync(avatarUrl.value, "base64");
|
||||
const base64Url = `data:image/png;base64,${avatarBase64}`;
|
||||
const result = await loginAPI(
|
||||
phone.value,
|
||||
nickName.value,
|
||||
base64Url,
|
||||
wxResult.code
|
||||
);
|
||||
const data = await getHomeData();
|
||||
if (data.user) updateUser(data.user);
|
||||
const devices = await getMyDevicesAPI();
|
||||
if (devices.bindings && devices.bindings.length) {
|
||||
updateDevice(devices.bindings[0].deviceId, devices.bindings[0].deviceName);
|
||||
try {
|
||||
try {
|
||||
const wxResult = await wxLogin();
|
||||
const fileManager = uni.getFileSystemManager();
|
||||
const avatarBase64 = fileManager.readFileSync(avatarUrl.value, "base64");
|
||||
const base64Url = `data:image/png;base64,${avatarBase64}`;
|
||||
const result = await loginAPI(
|
||||
phone.value,
|
||||
nickName.value,
|
||||
base64Url,
|
||||
wxResult.code
|
||||
);
|
||||
const data = await getHomeData();
|
||||
if (data.user) updateUser(data.user);
|
||||
const devices = await getMyDevicesAPI();
|
||||
if (devices.bindings && devices.bindings.length) {
|
||||
updateDevice(
|
||||
devices.bindings[0].deviceId,
|
||||
devices.bindings[0].deviceName
|
||||
);
|
||||
const data = await getDeviceBatteryAPI();
|
||||
updateOnline(data.online);
|
||||
} catch (error) {}
|
||||
}
|
||||
props.onClose();
|
||||
} catch (error) {
|
||||
console.log("login error", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
loading.value = false;
|
||||
props.onClose();
|
||||
};
|
||||
|
||||
const openServiceLink = () => {
|
||||
|
||||
Reference in New Issue
Block a user