代码优化
This commit is contained in:
@@ -46,6 +46,7 @@ onMounted(() => {
|
||||
if (scores.value.length === total) {
|
||||
showScore.value = true;
|
||||
}
|
||||
// if (step.value === 2 && msg.target.dst / 100 > 5) {
|
||||
if (step.value === 2 && msg.target.dst > 5) {
|
||||
btnDisabled.value = false;
|
||||
}
|
||||
@@ -68,7 +69,6 @@ const nextStep = async () => {
|
||||
if (step.value === 0) {
|
||||
step.value = 1;
|
||||
} else if (step.value === 1) {
|
||||
await createPractise(1);
|
||||
btnDisabled.value = true;
|
||||
step.value = 2;
|
||||
} else if (step.value === 2) {
|
||||
@@ -95,109 +95,116 @@ const onClose = () => {
|
||||
|
||||
<template>
|
||||
<Container :bgType="1" title="新手试炼场">
|
||||
<Guide v-if="step !== 4" :tall="step === 2 || step === 5">
|
||||
<text v-if="step === 0">
|
||||
hi,<text :style="{ color: '#fed847' }">{{ user.nickName }}</text>
|
||||
,这是新人必刷小任务,0基础小白也能快速掌握弓箭技巧和游戏规则哦~:)
|
||||
</text>
|
||||
<text v-if="step === 1"
|
||||
>这是我们人帅技高的高教练。首先,请按教练示范,尝试自己去做这些动作和手势吧。</text
|
||||
>
|
||||
<view v-if="step === 2">
|
||||
<view :style="{ display: 'flex', flexDirection: 'column' }">
|
||||
<text :style="{ color: '#fed847' }">你知道5米射程有多远吗?</text>
|
||||
<text>
|
||||
在我们的排位赛中,射程小于5米的成绩无效、哦!建议平时练习距离至少5米。现在,来边射箭边调整你的站位点吧!
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="step === 3">
|
||||
<view :style="{ display: 'flex', flexDirection: 'column' }">
|
||||
<text :style="{ color: '#fed847' }">一切准备就绪</text>
|
||||
<text>试着完成一个真正的弓箭手任务吧!</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="step === 5">
|
||||
<view
|
||||
:style="{ display: 'flex', flexDirection: 'column', marginTop: 20 }"
|
||||
<view class="container">
|
||||
<Guide v-if="step !== 4" :tall="step === 2 || step === 5">
|
||||
<text v-if="step === 0">
|
||||
hi,<text :style="{ color: '#fed847' }">{{ user.nickName }}</text>
|
||||
,这是新人必刷小任务,0基础小白也能快速掌握弓箭技巧和游戏规则哦~:)
|
||||
</text>
|
||||
<text v-if="step === 1"
|
||||
>这是我们人帅技高的高教练。首先,请按教练示范,尝试自己去做这些动作和手势吧。</text
|
||||
>
|
||||
<text :style="{ color: '#fed847' }">新手试炼场通关啦,优秀!</text>
|
||||
<text
|
||||
>反曲弓运动基本知识和射灵世界系统规则你已Get,是不是挺容易呀:)</text
|
||||
>
|
||||
<!-- 这行是占位用的 -->
|
||||
<text :style="{ opacity: 0 }">新手试炼场通关啦,优秀!</text>
|
||||
<view v-if="step === 2">
|
||||
<view :style="{ display: 'flex', flexDirection: 'column' }">
|
||||
<text :style="{ color: '#fed847' }">你知道5米射程有多远吗?</text>
|
||||
<text>
|
||||
在我们的排位赛中,射程小于5米的成绩无效、哦!建议平时练习距离至少5米。现在,来边射箭边调整你的站位点吧!
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="step === 3">
|
||||
<view :style="{ display: 'flex', flexDirection: 'column' }">
|
||||
<text :style="{ color: '#fed847' }">一切准备就绪</text>
|
||||
<text>试着完成一个真正的弓箭手任务吧!</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="step === 5">
|
||||
<view
|
||||
:style="{ display: 'flex', flexDirection: 'column', marginTop: 20 }"
|
||||
>
|
||||
<text :style="{ color: '#fed847' }">新手试炼场通关啦,优秀!</text>
|
||||
<text
|
||||
>反曲弓运动基本知识和射灵世界系统规则你已Get,是不是挺容易呀:)</text
|
||||
>
|
||||
<!-- 这行是占位用的 -->
|
||||
<text :style="{ opacity: 0 }">新手试炼场通关啦,优秀!</text>
|
||||
</view>
|
||||
</view>
|
||||
</Guide>
|
||||
<image
|
||||
src="../static/first-try-tip.png"
|
||||
class="try-tip"
|
||||
mode="widthFix"
|
||||
v-if="step === 0"
|
||||
/>
|
||||
<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">
|
||||
<Swiper
|
||||
:data="[
|
||||
'../static/first-try-tip.png',
|
||||
'../static/first-try-tip.png',
|
||||
'../static/first-try-tip.png',
|
||||
]"
|
||||
/>
|
||||
</view>
|
||||
</Guide>
|
||||
<image
|
||||
src="../static/first-try-tip.png"
|
||||
class="try-tip"
|
||||
mode="widthFix"
|
||||
v-if="step === 0"
|
||||
/>
|
||||
<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">
|
||||
<Swiper
|
||||
:data="[
|
||||
'../static/first-try-tip.png',
|
||||
'../static/first-try-tip.png',
|
||||
'../static/first-try-tip.png',
|
||||
]"
|
||||
<ShootProgress
|
||||
v-if="step === 4"
|
||||
tips="请开始连续射箭"
|
||||
:total="100"
|
||||
:start="start"
|
||||
/>
|
||||
<BowTarget
|
||||
:avatar="user.avatarUrl"
|
||||
:power="power"
|
||||
:debug="step === 2"
|
||||
v-if="step === 2 || step === 4"
|
||||
:tips="
|
||||
step === 2 && scores.length > 0
|
||||
? `本次射程${scores[scores.length - 1].dst / 100}米,${
|
||||
scores[scores.length - 1].dst / 100 >= 5 ? '已' : '未'
|
||||
}达到距离要求`
|
||||
: ''
|
||||
"
|
||||
:scores="scores"
|
||||
/>
|
||||
<ScorePanel
|
||||
v-if="step === 4"
|
||||
:total="total"
|
||||
:rowCount="6"
|
||||
:scores="scores.map((s) => s.ring)"
|
||||
/>
|
||||
<ScoreResult
|
||||
:total="total"
|
||||
:rowCount="6"
|
||||
:show="showScore"
|
||||
v-if="step === 4"
|
||||
:onClose="onClose"
|
||||
:result="practiseResult"
|
||||
/>
|
||||
</view>
|
||||
<ShootProgress
|
||||
v-if="step === 4"
|
||||
tips="请开始连续射箭"
|
||||
:total="100"
|
||||
:start="start"
|
||||
/>
|
||||
<BowTarget
|
||||
:avatar="user.avatarUrl"
|
||||
:power="power"
|
||||
:debug="step === 2"
|
||||
v-if="step === 2 || step === 4"
|
||||
:tips="
|
||||
step === 2 && scores.length > 0
|
||||
? `本次射程${scores[scores.length - 1].dst}米,${
|
||||
scores[scores.length - 1].dst >= 5 ? '已' : '未'
|
||||
}达到距离要求`
|
||||
: ''
|
||||
"
|
||||
:scores="scores"
|
||||
/>
|
||||
<ScorePanel
|
||||
v-if="step === 4"
|
||||
:total="total"
|
||||
:rowCount="6"
|
||||
:scores="scores.map((s) => s.ring)"
|
||||
/>
|
||||
<ScoreResult
|
||||
:total="total"
|
||||
:rowCount="6"
|
||||
:show="showScore"
|
||||
v-if="step === 4"
|
||||
:onClose="onClose"
|
||||
:result="practiseResult"
|
||||
/>
|
||||
<SButton v-if="step !== 4" :onClick="nextStep" :disabled="btnDisabled">{{
|
||||
stepButtonTexts[step]
|
||||
}}</SButton>
|
||||
<view :style="{ marginBottom: '25px' }">
|
||||
<SButton v-if="step !== 4" :onClick="nextStep" :disabled="btnDisabled">{{
|
||||
stepButtonTexts[step]
|
||||
}}</SButton>
|
||||
</view>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
width: 100%;
|
||||
}
|
||||
.try-tip {
|
||||
width: calc(100% - 20px);
|
||||
margin: 10px 10px;
|
||||
|
||||
Reference in New Issue
Block a user