细节调整

This commit is contained in:
kron
2025-11-11 16:31:47 +08:00
parent 6df7986c47
commit 59a2b173a6
8 changed files with 46 additions and 32 deletions

View File

@@ -88,10 +88,7 @@
"path": "pages/friend-battle" "path": "pages/friend-battle"
}, },
{ {
"path": "pages/battle-room", "path": "pages/battle-room"
"style": {
"disableSwipeBack": true
}
}, },
{ {
"path": "pages/ranking" "path": "pages/ranking"

View File

@@ -5,11 +5,11 @@ import SButton from "@/components/SButton.vue";
import { laserAimAPI, laserCloseAPI } from "@/apis"; import { laserAimAPI, laserCloseAPI } from "@/apis";
import { MESSAGETYPES } from "@/constants"; import { MESSAGETYPES } from "@/constants";
import audioManager from "@/audioManager"; // import audioManager from "@/audioManager";
const guides = [ const guides = [
{ {
title: "箭头面向墙面,直至语音提示激光坐标已校准", title: "箭头面向靶子",
src: "https://static.shelingxingqiu.com/attachment/2025-10-30/ddv9p5fk5wscg7hrfo.png", src: "https://static.shelingxingqiu.com/attachment/2025-10-30/ddv9p5fk5wscg7hrfo.png",
}, },
{ {
@@ -34,7 +34,7 @@ function onReceiveMessage(messages = []) {
if (msg.constructor === MESSAGETYPES.Calibration) { if (msg.constructor === MESSAGETYPES.Calibration) {
done.value = true; done.value = true;
uni.setStorageSync("calibration", true); uni.setStorageSync("calibration", true);
audioManager.play("激光已校准"); // audioManager.play("激光已校准");
} }
}); });
} }
@@ -109,7 +109,7 @@ onBeforeUnmount(async () => {
height: 250rpx; height: 250rpx;
} }
.container > text { .container > text {
font-size: 20rpx; font-size: 24rpx;
color: #fff9; color: #fff9;
margin: 30rpx; margin: 30rpx;
} }

View File

@@ -167,7 +167,13 @@ const onClose = () => {
: 0 : 0
" "
> >
<text v-if="step === 0" :style="{ fontSize: '28rpx' }"> <text
v-if="step === 0"
:style="{
fontSize: '28rpx',
marginTop: user.nickName.length > 6 ? '-10rpx' : '0',
}"
>
hi<text :style="{ color: '#fed847' }">{{ user.nickName }}</text> hi<text :style="{ color: '#fed847' }">{{ user.nickName }}</text>
这是新人必刷小任务0基础小白也能快速掌握弓箭技巧和游戏规则哦~ 这是新人必刷小任务0基础小白也能快速掌握弓箭技巧和游戏规则哦~
</text> </text>

View File

@@ -102,6 +102,12 @@ onLoad(async (options) => {
setTimeout(getCurrentGameAPI, 2000); setTimeout(getCurrentGameAPI, 2000);
} }
} }
uni.enableAlertBeforeUnload({
message: "离开比赛可能导致比赛失败,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
}); });
async function onReceiveMessage(messages = []) { async function onReceiveMessage(messages = []) {
@@ -149,9 +155,6 @@ async function onReceiveMessage(messages = []) {
} }
}); });
} }
const onBack = () => {
uni.$showHint(2);
};
onMounted(async () => { onMounted(async () => {
uni.setKeepScreenOn({ uni.setKeepScreenOn({
keepScreenOn: true, keepScreenOn: true,
@@ -188,7 +191,7 @@ onHide(() => {
</script> </script>
<template> <template>
<Container :title="title" :bgType="1" :onBack="onBack"> <Container :title="title" :bgType="1">
<view class="container"> <view class="container">
<BattleHeader v-if="!start" :players="players" /> <BattleHeader v-if="!start" :players="players" />
<TestDistance v-if="!start" :guide="false" :isBattle="true" /> <TestDistance v-if="!start" :guide="false" :isBattle="true" />

View File

@@ -233,7 +233,7 @@ onShow(() => {
<SButton :onClick="goCalibration" width="60vw" :rounded="40"> <SButton :onClick="goCalibration" width="60vw" :rounded="40">
开启智能弓进行校准 开启智能弓进行校准
</SButton> </SButton>
<text :style="{ marginTop: '20rpx', fontSize: '20rpx', color: '#fff9' }" <text :style="{ marginTop: '20rpx', fontSize: '24rpx', color: '#fff9' }"
>校准时弓箭激光将开启请勿直视激光</text >校准时弓箭激光将开启请勿直视激光</text
> >
</block> </block>
@@ -386,6 +386,7 @@ onShow(() => {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
font-size: 26rpx;
} }
.device-binded > view > image { .device-binded > view > image {
width: 140rpx; width: 140rpx;
@@ -414,7 +415,7 @@ onShow(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
font-size: 14px; font-size: 28rpx;
margin-bottom: 100rpx; margin-bottom: 100rpx;
} }
.has-device > view:nth-child(2) > text, .has-device > view:nth-child(2) > text,
@@ -427,7 +428,7 @@ onShow(() => {
left: 20rpx; left: 20rpx;
} }
.calibration > button { .calibration > button {
font-size: 22rpx; font-size: 26rpx;
color: #287fff; color: #287fff;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -440,11 +441,11 @@ onShow(() => {
} }
.calibration > view { .calibration > view {
position: relative; position: relative;
font-size: 20rpx; font-size: 22rpx;
color: #fff9; color: #fff9;
padding-top: 40rpx; padding-top: 34rpx;
padding-left: 35rpx; padding-left: 35rpx;
width: 300rpx; width: 322rpx;
} }
.calibration > view > image { .calibration > view > image {
position: absolute; position: absolute;

View File

@@ -222,7 +222,7 @@ onShareTimeline(async () => {
/> />
</button> --> </button> -->
</view> </view>
<view :style="{ transform: 'translateY(-45rpx)' }"> <view :style="{ transform: 'translateY(-45rpx) scale(0.9)' }">
<BowTargetEdit <BowTargetEdit
:id="targetId" :id="targetId"
:src="targetSrc" :src="targetSrc"
@@ -291,7 +291,7 @@ onShareTimeline(async () => {
</view> </view>
<ScreenHint2 <ScreenHint2
:show="showTip || showTip2 || showTip3" :show="showTip || showTip2 || showTip3"
:onClose="!notes && showTip3 ? null : closeTip" :onClose="showTip3 ? null : closeTip"
> >
<view class="tip-content"> <view class="tip-content">
<block v-if="showTip"> <block v-if="showTip">

View File

@@ -1,5 +1,6 @@
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue"; import Container from "@/components/Container.vue";
import ScreenHint2 from "@/components/ScreenHint2.vue"; import ScreenHint2 from "@/components/ScreenHint2.vue";
import SButton from "@/components/SButton.vue"; import SButton from "@/components/SButton.vue";
@@ -74,6 +75,15 @@ const onEditDone = (arrow) => {
if (currentArrow.value < amount.value - 1) currentArrow.value++; if (currentArrow.value < amount.value - 1) currentArrow.value++;
}; };
onLoad(() => {
uni.enableAlertBeforeUnload({
message: "现在离开会导致未提交的数据丢失,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
});
onMounted(() => { onMounted(() => {
const pointBook = uni.getStorageSync("last-point-book"); const pointBook = uni.getStorageSync("last-point-book");
if (pointBook.bowtargetType) { if (pointBook.bowtargetType) {
@@ -96,12 +106,7 @@ onMounted(() => {
</script> </script>
<template> <template>
<Container <Container :bgType="2" bgColor="#F5F5F5" :whiteBackArrow="false">
:bgType="2"
bgColor="#F5F5F5"
:whiteBackArrow="false"
:onBack="() => (showTip = true)"
>
<view class="container"> <view class="container">
<BowTargetEdit <BowTargetEdit
:onChange="onEditDone" :onChange="onEditDone"

View File

@@ -39,10 +39,6 @@ const showRoundTip = ref(false);
const isFinalShoot = ref(false); const isFinalShoot = ref(false);
const isEnded = ref(false); const isEnded = ref(false);
const onBack = () => {
uni.$showHint(2);
};
function recoverData(battleInfo) { function recoverData(battleInfo) {
uni.removeStorageSync("last-awake-time"); uni.removeStorageSync("last-awake-time");
battleId.value = battleInfo.id; battleId.value = battleInfo.id;
@@ -282,6 +278,12 @@ onLoad(async (options) => {
setTimeout(getCurrentGameAPI, 2000); setTimeout(getCurrentGameAPI, 2000);
} }
} }
uni.enableAlertBeforeUnload({
message: "离开比赛可能导致比赛失败,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
}); });
onMounted(async () => { onMounted(async () => {
uni.setKeepScreenOn({ uni.setKeepScreenOn({
@@ -319,7 +321,7 @@ onHide(() => {
</script> </script>
<template> <template>
<Container :bgType="start ? 3 : 1" :onBack="onBack"> <Container :bgType="start ? 3 : 1">
<view class="container"> <view class="container">
<BattleHeader v-if="!start" :redTeam="redTeam" :blueTeam="blueTeam" /> <BattleHeader v-if="!start" :redTeam="redTeam" :blueTeam="blueTeam" />
<TestDistance v-if="!start" :guide="false" :isBattle="true" /> <TestDistance v-if="!start" :guide="false" :isBattle="true" />