细节完善
This commit is contained in:
@@ -20,8 +20,9 @@ onLoad(async (options) => {
|
||||
battleId.value = options.battleId;
|
||||
const result = await getGameAPI(
|
||||
// options.battleId || "BATTLE-1749386862250435325-854"
|
||||
options.battleId || "BATTLE-1749397329251504706-197"
|
||||
options.battleId || "BATTLE-1750142722977234017-746"
|
||||
);
|
||||
console.log(1212, result);
|
||||
data.value = result;
|
||||
if (result.mode === 1 && result.redPlayers[user.value.id]) {
|
||||
totalPoints.value = result.redTotal;
|
||||
|
||||
@@ -10,12 +10,13 @@ import ScorePanel from "@/components/ScorePanel.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, getHomeData } from "@/apis";
|
||||
import { MESSAGETYPES } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const { updateUser } = store;
|
||||
const scores = ref([]);
|
||||
const step = ref(0);
|
||||
const showScore = ref(false);
|
||||
@@ -89,6 +90,8 @@ const nextStep = async () => {
|
||||
start.value = true;
|
||||
}, 500);
|
||||
} else if (step.value === 5) {
|
||||
const result = await getHomeData();
|
||||
if (result.user) updateUser(result.user);
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
|
||||
@@ -34,14 +34,14 @@ onLoad(async (options) => {
|
||||
name: result.bluePlayers[blueId].name,
|
||||
avatar: result.bluePlayers[blueId].avatar,
|
||||
arrows: item[blueId],
|
||||
totalRing: item[blueId].reduce((a, b) => a + b.ringScore, 0),
|
||||
totalRing: item[blueId].reduce((a, b) => a + b.ring, 0),
|
||||
totalScore: item[blueId].reduce((a, b) => a + b.ringScore, 0),
|
||||
},
|
||||
red: {
|
||||
name: result.redPlayers[redId].name,
|
||||
avatar: result.redPlayers[redId].avatar,
|
||||
arrows: item[redId],
|
||||
totalRing: item[redId].reduce((a, b) => a + b.ringScore, 0),
|
||||
totalRing: item[redId].reduce((a, b) => a + b.ring, 0),
|
||||
totalScore: item[redId].reduce((a, b) => a + b.ringScore, 0),
|
||||
},
|
||||
});
|
||||
@@ -102,7 +102,7 @@ onLoad(async (options) => {
|
||||
<view>
|
||||
<Avatar :src="round.blue.avatar" :size="25" :borderColor="1" />
|
||||
<text v-for="(arrow, index2) in round.blue.arrows" :key="index2">
|
||||
{{ arrow.ringScore }}环
|
||||
{{ arrow.ring }}环
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
@@ -116,7 +116,7 @@ onLoad(async (options) => {
|
||||
<view>
|
||||
<Avatar :src="round.red.avatar" :size="25" :borderColor="2" />
|
||||
<text v-for="(arrow, index2) in round.red.arrows" :key="index2">
|
||||
{{ arrow.ringScore }}环
|
||||
{{ arrow.ring }}环
|
||||
</text>
|
||||
</view>
|
||||
<view>
|
||||
|
||||
@@ -93,6 +93,9 @@ async function onReceiveMessage(content) {
|
||||
}
|
||||
playersScores.value[msg.userId].push(msg.target);
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
|
||||
tips.value = "上半场结束,休息一下吧:) 20秒后进入下半场";
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
|
||||
@@ -8,12 +8,13 @@ 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 { createPractiseAPI } from "@/apis";
|
||||
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||
import { MESSAGETYPES, roundsName } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const { updateUser } = store;
|
||||
const start = ref(false);
|
||||
const showScore = ref(false);
|
||||
const scores = ref([]);
|
||||
@@ -52,9 +53,10 @@ async function onReceiveMessage(content) {
|
||||
});
|
||||
}
|
||||
|
||||
function onComplete() {
|
||||
async function onComplete() {
|
||||
const result = await getHomeData();
|
||||
if (result.user) updateUser(result.user);
|
||||
uni.navigateBack();
|
||||
showScore.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -8,12 +8,13 @@ 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 { createPractiseAPI } from "@/apis";
|
||||
import { createPractiseAPI, getHomeData } from "@/apis";
|
||||
import { MESSAGETYPES } from "@/constants";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const { updateUser } = store;
|
||||
const start = ref(false);
|
||||
const showScore = ref(false);
|
||||
const scores = ref([]);
|
||||
@@ -49,9 +50,10 @@ async function onReceiveMessage(content) {
|
||||
});
|
||||
}
|
||||
|
||||
function onComplete() {
|
||||
async function onComplete() {
|
||||
const result = await getHomeData();
|
||||
if (result.user) updateUser(result.user);
|
||||
uni.navigateBack();
|
||||
showScore.value = false;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -73,9 +73,9 @@ const logout = () => {
|
||||
/>
|
||||
<UserItem
|
||||
title="新手试炼场"
|
||||
:onClick="user.trio > 1 ? null : toFristTryPage"
|
||||
:onClick="user.trio > 0 ? null : toFristTryPage"
|
||||
>
|
||||
<text v-if="user.trio > 1" :style="{ color: '#259249' }">已完成</text>
|
||||
<text v-if="user.trio > 0" :style="{ color: '#259249' }">已完成</text>
|
||||
<text v-else :style="{ color: '#CC311F' }">未完成</text>
|
||||
</UserItem>
|
||||
<UserItem title="会员" :onClick="toBeVipPage"> 已赠送6个月会员 </UserItem>
|
||||
|
||||
Reference in New Issue
Block a user