Files
shoot-miniprograms/src/pages/first-try.vue

143 lines
4.2 KiB
Vue
Raw Normal View History

2025-05-01 16:36:24 +08:00
<script setup>
2025-05-10 16:57:36 +08:00
import { ref } from "vue";
2025-05-01 16:36:24 +08:00
import AppBackground from "@/components/AppBackground.vue";
2025-05-01 21:50:12 +08:00
import Header from "@/components/Header.vue";
2025-05-01 22:58:02 +08:00
import Guide from "@/components/Guide.vue";
2025-05-10 16:57:36 +08:00
import SButton from "@/components/SButton.vue";
import Swiper from "@/components/Swiper.vue";
import BowTarget from "@/components/BowTarget.vue";
import ShootProgress from "@/components/ShootProgress.vue";
import ScoreResult from "@/components/ScoreResult.vue";
import ScorePanel from "@/components/ScorePanel.vue";
const scores = ref(new Array(10).fill(9));
const step = ref(0);
const stepButtonTexts = [
"开始",
"进入下一个任务",
"进入下一个任务",
"我准备好了,开始",
"",
"退出新手试炼",
];
const nextStep = () => {
if (step.value === 0) {
step.value = 1;
} else if (step.value === 1) {
step.value = 2;
} else if (step.value === 2) {
step.value = 3;
} else if (step.value === 3) {
step.value = 4;
} else if (step.value === 5) {
uni.navigateBack({
delta: 1,
});
}
};
const showScore = ref(false);
setTimeout(() => {
showScore.value = true;
}, 1000);
const onClose = () => {
showScore.value = false;
setTimeout(() => {
step.value = 5;
}, 500);
};
2025-05-01 16:36:24 +08:00
</script>
<template>
<view>
2025-05-10 22:16:59 +08:00
<AppBackground type="1" />
2025-05-01 21:50:12 +08:00
<Header title="新手试炼场" />
2025-05-10 16:57:36 +08:00
<Guide v-if="step !== 4" :tall="step === 2 || step === 5">
<text v-if="step === 0">
hi<text :style="{ color: '#fed847' }">Rocker</text>
这是新人必刷小任务0基础小白也能快速掌握弓箭技巧和游戏规则哦~
</text>
<text v-if="step === 1"
>这是我们人帅技高的高教练首先请按教练示范尝试自己去做这些动作和手势吧</text
>
<view v-if="step === 2">
2025-05-15 12:43:40 +08:00
<view :style="{ display: 'flex', flexDirection: 'column' }">
<text :style="{ color: '#fed847' }">你知道5米射程有多远吗</text>
<text>
在我们的排位赛中射程小于5米的成绩无效建议平时练习距离至少5米现在来边射箭边调整你的站位点吧
</text>
</view>
2025-05-10 16:57:36 +08:00
</view>
<view v-if="step === 3">
2025-05-15 12:43:40 +08:00
<view :style="{ display: 'flex', flexDirection: 'column' }">
<text :style="{ color: '#fed847' }">一切准备就绪</text>
<text>试着完成一个真正的弓箭手任务吧</text>
</view>
2025-05-10 16:57:36 +08:00
</view>
<view v-if="step === 5">
2025-05-15 12:43:40 +08:00
<view
:style="{ display: 'flex', flexDirection: 'column', marginTop: 20 }"
2025-05-10 16:57:36 +08:00
>
2025-05-15 12:43:40 +08:00
<text :style="{ color: '#fed847' }">新手试炼场通关啦优秀</text>
<text
>反曲弓运动基本知识和射灵世界系统规则你已Get是不是挺容易呀</text
>
<!-- 这行是占位用的 -->
<text :style="{ opacity: 0 }">新手试炼场通关啦优秀</text>
</view>
2025-05-10 16:57:36 +08:00
</view>
</Guide>
<image
src="../static/first-try-tip.png"
class="try-tip"
mode="widthFix"
2025-05-15 12:43:40 +08:00
v-if="step === 0"
2025-05-10 16:57:36 +08:00
/>
2025-05-15 12:43:40 +08:00
<image
src="../static/first-try-tip2.png"
class="try-tip"
mode="widthFix"
v-if="step === 3"
/>
<image
src="../static/first-try-tip3.png"
class="try-tip"
mode="widthFix"
v-if="step === 5"
/>
<view style="height: 570px" v-if="step === 1">
2025-05-10 16:57:36 +08:00
<Swiper
:data="[
'../static/first-try-tip.png',
'../static/first-try-tip.png',
'../static/first-try-tip.png',
]"
/>
</view>
<ShootProgress v-if="step === 4" tips="请开始连续射箭" total="10" />
<BowTarget
avatar="../static/avatar.png"
power="45"
:debug="step === 2"
v-if="step === 2 || step === 4"
:tips="step === 4 ? '' : '本次射程5.2米,已达到距离要求'"
/>
<ScorePanel v-if="step === 4" :scores="scores" :total="12" :rowCount="6" />
<ScoreResult
:total="12"
:rowCount="6"
:show="showScore"
v-if="step === 4"
:onClose="onClose"
/>
<SButton v-if="step !== 4" :onClick="nextStep">{{
stepButtonTexts[step]
}}</SButton>
2025-05-01 16:36:24 +08:00
</view>
</template>
<style scoped>
2025-05-01 22:58:02 +08:00
.try-tip {
width: calc(100% - 20px);
margin: 10px 10px;
2025-05-01 16:36:24 +08:00
}
</style>