功能完善
This commit is contained in:
@@ -2,7 +2,12 @@
|
||||
import { onMounted } from "vue";
|
||||
import Container from "@/components/Container.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import { getBattleListAPI, getPractiseResultListAPI } from "@/apis";
|
||||
import BowData from "@/components/BowData.vue";
|
||||
import {
|
||||
getBattleListAPI,
|
||||
getPractiseResultListAPI,
|
||||
getPractiseAPI,
|
||||
} from "@/apis";
|
||||
|
||||
import { ref } from "vue";
|
||||
|
||||
@@ -12,6 +17,8 @@ const matchList = ref([]);
|
||||
const battlePage = ref(1);
|
||||
const battleList = ref([]);
|
||||
const practiseList = ref([]);
|
||||
const showBowData = ref(false);
|
||||
const arrows = ref([]);
|
||||
|
||||
const handleSelect = async (index) => {
|
||||
if (index === 0 && matchList.value.length === 0) {
|
||||
@@ -36,6 +43,11 @@ const toMatchDetail = (id) => {
|
||||
url: `/pages/match-detail?id=${id}`,
|
||||
});
|
||||
};
|
||||
const getPractiseDetail = async (id) => {
|
||||
const result = await getPractiseAPI(id);
|
||||
arrows.value = JSON.parse(result.UserPracticeRound.arrows);
|
||||
showBowData.value = true;
|
||||
};
|
||||
onMounted(async () => {
|
||||
const result = await getBattleListAPI(matchPage.value, 2);
|
||||
matchList.value = result;
|
||||
@@ -154,12 +166,18 @@ onMounted(async () => {
|
||||
v-for="(item, index) in practiseList"
|
||||
:key="index"
|
||||
class="practice-record"
|
||||
@click="() => getPractiseDetail(item.id)"
|
||||
>
|
||||
<text>单组练习 {{ item.createdAt }}</text>
|
||||
<image src="../static/back.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<BowData
|
||||
:arrows="arrows"
|
||||
:show="showBowData"
|
||||
:onClose="() => (showBowData = false)"
|
||||
/>
|
||||
</view>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user