更换测距页面
This commit is contained in:
@@ -8,8 +8,9 @@ import ScoreResult from "@/components/ScoreResult.vue";
|
||||
import SButton from "@/components/SButton.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import BowPower from "@/components/BowPower.vue";
|
||||
import TestDistance from "@/components/TestDistance.vue";
|
||||
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||
import { generateCanvasImage, checkConnection } from "@/util";
|
||||
import { generateCanvasImage } from "@/util";
|
||||
import { MESSAGETYPES, roundsName } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -70,7 +71,6 @@ async function onComplete() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
checkConnection();
|
||||
uni.$on("socket-inbox", onReceiveMessage);
|
||||
});
|
||||
|
||||
@@ -82,44 +82,42 @@ onUnmounted(() => {
|
||||
<template>
|
||||
<Container :bgType="1" title="个人单组练习">
|
||||
<view>
|
||||
<ShootProgress
|
||||
:tips="`${
|
||||
!start || scores.length === 12
|
||||
? ''
|
||||
: `请开始射箭第${roundsName[Math.ceil((scores.length + 1) / 3)]}轮`
|
||||
}`"
|
||||
:start="start"
|
||||
:total="120"
|
||||
/>
|
||||
<view class="infos">
|
||||
<Avatar :src="user.avatar" :size="35" />
|
||||
<BowPower :power="power" />
|
||||
</view>
|
||||
<BowTarget
|
||||
:start="start"
|
||||
:totalRound="start ? total / 4 : 0"
|
||||
:currentRound="currentRound"
|
||||
:scores="scores"
|
||||
:tips="
|
||||
!start && scores.length > 0
|
||||
? `本次射程${scores[scores.length - 1].dst / 100}米,${
|
||||
scores[scores.length - 1].dst / 100 >= 5 ? '已' : '未'
|
||||
}达到距离要求`
|
||||
: ''
|
||||
"
|
||||
/>
|
||||
<ScorePanel2 v-if="start" :scores="scores.map((s) => s.ring)" />
|
||||
<ScoreResult
|
||||
v-if="practiseResult.arrows"
|
||||
:rowCount="6"
|
||||
:total="total"
|
||||
:onClose="onComplete"
|
||||
:result="practiseResult"
|
||||
:tipSrc="`../static/${
|
||||
practiseResult.arrows.length < total ? 'un' : ''
|
||||
}finish-tip.png`"
|
||||
/>
|
||||
<canvas class="share-canvas" canvas-id="shareCanvas"></canvas>
|
||||
<TestDistance v-if="!start && !practiseResult.arrows" />
|
||||
<block v-if="start || practiseResult.arrows">
|
||||
<ShootProgress
|
||||
:tips="`${
|
||||
!start || scores.length === 12
|
||||
? ''
|
||||
: `请开始射箭第${
|
||||
roundsName[Math.ceil((scores.length + 1) / 3)]
|
||||
}轮`
|
||||
}`"
|
||||
:start="start"
|
||||
:total="120"
|
||||
/>
|
||||
<view class="infos">
|
||||
<Avatar :src="user.avatar" :size="35" />
|
||||
<BowPower :power="power" />
|
||||
</view>
|
||||
<BowTarget
|
||||
:start="start"
|
||||
:totalRound="start ? total / 4 : 0"
|
||||
:currentRound="currentRound"
|
||||
:scores="scores"
|
||||
/>
|
||||
<ScorePanel2 :scores="scores.map((s) => s.ring)" />
|
||||
<ScoreResult
|
||||
v-if="practiseResult.arrows"
|
||||
:rowCount="6"
|
||||
:total="total"
|
||||
:onClose="onComplete"
|
||||
:result="practiseResult"
|
||||
:tipSrc="`../static/${
|
||||
practiseResult.arrows.length < total ? 'un' : ''
|
||||
}finish-tip.png`"
|
||||
/>
|
||||
<canvas class="share-canvas" canvas-id="shareCanvas"></canvas>
|
||||
</block>
|
||||
</view>
|
||||
<view :style="{ marginBottom: '20px' }">
|
||||
<SButton v-if="!start" :onClick="onReady">准备好了,直接开始</SButton>
|
||||
|
||||
Reference in New Issue
Block a user