细节优化
This commit is contained in:
@@ -134,7 +134,7 @@ function calcRealY(num) {
|
|||||||
.container {
|
.container {
|
||||||
width: calc(100% - 30px);
|
width: calc(100% - 30px);
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
overflow: hidden;
|
/* overflow: hidden; */
|
||||||
}
|
}
|
||||||
.target {
|
.target {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import ShootProgress from "@/components/ShootProgress.vue";
|
|||||||
import ScoreResult from "@/components/ScoreResult.vue";
|
import ScoreResult from "@/components/ScoreResult.vue";
|
||||||
import ScorePanel from "@/components/ScorePanel.vue";
|
import ScorePanel from "@/components/ScorePanel.vue";
|
||||||
import Container from "@/components/Container.vue";
|
import Container from "@/components/Container.vue";
|
||||||
|
import Avatar from "@/components/Avatar.vue";
|
||||||
|
import BowPower from "@/components/BowPower.vue";
|
||||||
import { createPractiseAPI } from "@/apis";
|
import { createPractiseAPI } from "@/apis";
|
||||||
import { MESSAGETYPES } from "@/constants";
|
import { MESSAGETYPES } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
@@ -41,6 +43,7 @@ async function onReceiveMessage(content) {
|
|||||||
messages.forEach((msg) => {
|
messages.forEach((msg) => {
|
||||||
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
|
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
|
||||||
scores.value.push(msg.target);
|
scores.value.push(msg.target);
|
||||||
|
power.value = msg.target.battery;
|
||||||
if (scores.value.length === total) {
|
if (scores.value.length === total) {
|
||||||
showScore.value = true;
|
showScore.value = true;
|
||||||
}
|
}
|
||||||
@@ -176,11 +179,17 @@ const onClose = () => {
|
|||||||
:total="100"
|
:total="100"
|
||||||
:start="start"
|
:start="start"
|
||||||
/>
|
/>
|
||||||
|
<view class="infos" v-if="step === 4">
|
||||||
|
<Avatar :src="user.avatar" :size="35" />
|
||||||
|
<BowPower :power="power" />
|
||||||
|
</view>
|
||||||
<BowTarget
|
<BowTarget
|
||||||
:avatar="user.avatar"
|
:avatar="step === 2 ? user.avatar : ''"
|
||||||
:power="power"
|
:power="step === 2 ? power : 0"
|
||||||
:debug="step === 2"
|
:debug="step === 2"
|
||||||
v-if="step === 2 || step === 4"
|
v-if="step === 2 || step === 4"
|
||||||
|
:currentRound="step === 4 ? scores.length : 0"
|
||||||
|
:totalRound="step === 4 ? total : 0"
|
||||||
:tips="
|
:tips="
|
||||||
step === 2 && scores.length > 0
|
step === 2 && scores.length > 0
|
||||||
? `本次射程${scores[scores.length - 1].dst / 100}米,${
|
? `本次射程${scores[scores.length - 1].dst / 100}米,${
|
||||||
@@ -221,4 +230,11 @@ const onClose = () => {
|
|||||||
width: calc(100% - 20px);
|
width: calc(100% - 20px);
|
||||||
margin: 10px 10px;
|
margin: 10px 10px;
|
||||||
}
|
}
|
||||||
|
.infos {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 15px;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const scores = ref([]);
|
|||||||
const total = 12;
|
const total = 12;
|
||||||
const currentRound = ref(0);
|
const currentRound = ref(0);
|
||||||
const practiseResult = ref({});
|
const practiseResult = ref({});
|
||||||
const power = ref(10);
|
const power = ref(0);
|
||||||
|
|
||||||
const onReady = async () => {
|
const onReady = async () => {
|
||||||
await createPractiseAPI(total);
|
await createPractiseAPI(total);
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import BowTarget from "@/components/BowTarget.vue";
|
|||||||
import ScorePanel from "@/components/ScorePanel.vue";
|
import ScorePanel from "@/components/ScorePanel.vue";
|
||||||
import ScoreResult from "@/components/ScoreResult.vue";
|
import ScoreResult from "@/components/ScoreResult.vue";
|
||||||
import SButton from "@/components/SButton.vue";
|
import SButton from "@/components/SButton.vue";
|
||||||
|
import Avatar from "@/components/Avatar.vue";
|
||||||
|
import BowPower from "@/components/BowPower.vue";
|
||||||
import { createPractiseAPI } from "@/apis";
|
import { createPractiseAPI } from "@/apis";
|
||||||
import { MESSAGETYPES } from "@/constants";
|
import { MESSAGETYPES } from "@/constants";
|
||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
@@ -66,11 +68,13 @@ onUnmounted(() => {
|
|||||||
:tips="`请连续射箭${total}支`"
|
:tips="`请连续射箭${total}支`"
|
||||||
:total="120"
|
:total="120"
|
||||||
/>
|
/>
|
||||||
|
<view class="infos">
|
||||||
|
<Avatar :src="user.avatar" :size="35" />
|
||||||
|
<BowPower :power="power" />
|
||||||
|
</view>
|
||||||
<BowTarget
|
<BowTarget
|
||||||
:totalRound="total"
|
:totalRound="total"
|
||||||
:currentRound="scores.length + 1"
|
:currentRound="scores.length + 1"
|
||||||
:avatar="user.avatar"
|
|
||||||
:power="power"
|
|
||||||
:scores="scores"
|
:scores="scores"
|
||||||
:tips="
|
:tips="
|
||||||
!start && scores.length > 0
|
!start && scores.length > 0
|
||||||
@@ -102,4 +106,12 @@ onUnmounted(() => {
|
|||||||
</Container>
|
</Container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.infos {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 0 15px;
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user