UI优化
This commit is contained in:
@@ -4,21 +4,23 @@ import { onLoad } from "@dcloudio/uni-app";
|
||||
import Container from "@/components/Container.vue";
|
||||
import BattleHeader from "@/components/BattleHeader.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import TeamResult from "@/components/TeamResult.vue";
|
||||
import MeleeResult from "@/components/MeleeResult.vue";
|
||||
// import TeamResult from "@/components/TeamResult.vue";
|
||||
// import MeleeResult from "@/components/MeleeResult.vue";
|
||||
import PlayerScore from "@/components/PlayerScore.vue";
|
||||
import { getGameAPI } from "@/apis";
|
||||
|
||||
const blueTeam = ref([]);
|
||||
const redTeam = ref([]);
|
||||
const roundsData = ref([]);
|
||||
const battleId = ref("");
|
||||
const data = ref({
|
||||
players: [],
|
||||
});
|
||||
const show = ref(false);
|
||||
// const show = ref(false);
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.id) {
|
||||
battleId.value = options.id;
|
||||
const result = await getGameAPI(options.id);
|
||||
data.value = result;
|
||||
if (result.mode === 1) {
|
||||
@@ -51,6 +53,18 @@ onLoad(async (options) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const checkBowData = () => {
|
||||
if (data.value.mode === 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/team-bow-data?battleId=${battleId.value}`,
|
||||
});
|
||||
} else if (data.value.mode === 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/melee-bow-data?battleId=${battleId.value}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -93,7 +107,7 @@ onLoad(async (options) => {
|
||||
:style="{ border: 'none', padding: '5px 15px' }"
|
||||
>
|
||||
<text>大乱斗</text>
|
||||
<view @click="() => (show = true)">
|
||||
<view @click="checkBowData">
|
||||
<text>查看靶纸</text>
|
||||
<image src="../static/back.png" mode="widthFix" />
|
||||
</view>
|
||||
@@ -114,7 +128,7 @@ onLoad(async (options) => {
|
||||
>
|
||||
<view class="score-header">
|
||||
<text>第{{ index + 1 }}轮</text>
|
||||
<view @click="() => (show = true)">
|
||||
<view @click="checkBowData">
|
||||
<text>查看靶纸</text>
|
||||
<image src="../static/back.png" mode="widthFix" />
|
||||
</view>
|
||||
@@ -150,7 +164,7 @@ onLoad(async (options) => {
|
||||
</view>
|
||||
<view :style="{ height: '20px' }"></view>
|
||||
</view>
|
||||
<TeamResult
|
||||
<!-- <TeamResult
|
||||
v-if="data.mode === 1"
|
||||
:show="show"
|
||||
:onClose="() => (show = false)"
|
||||
@@ -161,7 +175,7 @@ onLoad(async (options) => {
|
||||
:show="show"
|
||||
:onClose="() => (show = false)"
|
||||
:data="data"
|
||||
/>
|
||||
/> -->
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user