Commit d3e9eefb authored by xiaoye's avatar xiaoye

fix

parent 9f836d6b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view id = 'page'> <view id = 'page'>
<view id = 'head'> <view id = 'head'>
<view> <view>
<button id = 'search_button' class = 'click' @click = 'page.show.search()'> <button class = 'button click' @click = 'page.show.search()'>
<uni-icons class = 'click' :type = "page.search ? 'left' : 'search'"></uni-icons> <uni-icons class = 'click' :type = "page.search ? 'left' : 'search'"></uni-icons>
</button> </button>
</view> </view>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
> >
</uni-data-select> </uni-data-select>
<br> <br>
<view id = 'search_button' class = 'click' @click = 'search.on()'> <view class = 'button click' @click = 'search.on()'>
<view class = 'click'> <view class = 'click'>
<span class = 'click'>搜索</span> <span class = 'click'>搜索</span>
<uni-icons class = 'click' type = 'search'></uni-icons> <uni-icons class = 'click' type = 'search'></uni-icons>
...@@ -153,13 +153,13 @@ ...@@ -153,13 +153,13 @@
import { selectTournament } from '../script/const.ts' import { selectTournament } from '../script/const.ts'
import PageTournament from './tournament.vue'; import PageTournament from './tournament.vue';
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Nzc3NjY4LCJpYXQiOjE3NDUzODcwNDksImV4cCI6MTc3NjkyMzA0OX0.pyyGtE_WjU8qtz1r2NKbe3jufsYW1PCk6wnczxuMHmM'
let page = reactive({ let page = reactive({
user : false, user : false,
search : false, search : false,
menu : true, // menu : true,
tournament : false, // tournament : false,
menu : false,
tournament : true,
show : { show : {
user : () : void => { user : () : void => {
page.user = !page.user; page.user = !page.user;
......
<template> <template>
<view class = 'PageTournament'> <view class = 'PageTournament'>
<uni-card <!-- <uni-card
v-if = 'tournament.tournament' v-if = 'tournament.tournament'
:is-full = 'true' :is-full = 'true'
:title = 'tournament.tournament.name' :title = 'tournament.tournament.name'
:sub-title = 'tournament.tournament.description' :sub-title = 'tournament.tournament.description'
:extra = 'tournament.tournament.createdAt.toLocaleDateString()' :extra = 'tournament.tournament.createdAt.toLocaleDateString()'
> > -->
<uni-card>
<uni-forms>
<uni-forms-item>
<uni-easyinput type = 'text' placeholder = '添加选手' v-model = 'participant.name'/>
</uni-forms-item>
<view class = 'button' @click = 'participant.add()'>
<uni-icons type = 'personadd'></uni-icons>
</view>
<!-- <view class = 'button' @click = 'participant.add()'>
<uni-icons type = 'personadd'></uni-icons>
</view> -->
</uni-forms>
<br>
<uni-card <uni-card
:is-full = 'true' :is-full = 'true'
title = '参与者' title = '参与者'
...@@ -32,12 +45,15 @@ ...@@ -32,12 +45,15 @@
> >
<template v-slot:header> <template v-slot:header>
{{ i.player1Id }} {{ i.player1Id }}
<br>
{{ i.player1Score }}
</template> </template>
<template v-slot:body> <template v-slot:body>
{{ i.player1Id }}
</template> </template>
<template v-slot:footer> <template v-slot:footer>
{{ i.player2Id }} {{ i.player2Id }}
<br>
{{ i.player2Score }}
</template> </template>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
...@@ -66,6 +82,18 @@ ...@@ -66,6 +82,18 @@
} }
}); });
let participant = reactive({
add : async() : Promise<void> => {
// @ts-ignore
if (await Tabulator.Participant.Create(Mycard.token, { name : participant.name, tournamentId : tournament.tournament.id})) {
await (new Promise(resolve => setTimeout(resolve, 500)));
// @ts-ignore
tournament.participants = await Tabulator.Participant.FindALL(Mycard.token, {tournamentId : tournament.tournament.id});
}
},
name : ''
});
onMounted(() => { onMounted(() => {
// @ts-ignore // @ts-ignore
emitter.on(selectTournament, tournament.get); emitter.on(selectTournament, tournament.get);
...@@ -75,4 +103,9 @@ ...@@ -75,4 +103,9 @@
// @ts-ignore // @ts-ignore
emitter.off(selectTournament, tournament.get); emitter.off(selectTournament, tournament.get);
}); });
</script> </script>
\ No newline at end of file
<style scoped lang = 'scss'>
@import '../style/style.scss';
@import '../style/tournament.scss';
</style>
\ No newline at end of file
...@@ -13,8 +13,6 @@ class Match { ...@@ -13,8 +13,6 @@ class Match {
player2Id : number; player2Id : number;
winnerId : number; winnerId : number;
childMatchId : number; childMatchId : number;
player1 : Participant;
player2 : Participant;
constructor(obj : MatchObject) { constructor(obj : MatchObject) {
this.id = obj.id; this.id = obj.id;
...@@ -29,11 +27,6 @@ class Match { ...@@ -29,11 +27,6 @@ class Match {
this.winnerId = obj.winnerId; this.winnerId = obj.winnerId;
this.childMatchId = obj.childMatchId; this.childMatchId = obj.childMatchId;
} }
pushPlayer = (t : Array<Participant>) : void => {
this.player1 = t.find(i => i.id == this.player1Id) as Participant;
this.player2 = t.find(i => i.id == this.player2Id) as Participant;
};
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
cursor: pointer; cursor: pointer;
} }
} }
#search_button { .button {
width: 30%; width: 30%;
} }
} }
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
width: var(--size); width: var(--size);
height: 80%; height: 80%;
overflow-y: auto; overflow-y: auto;
#search_button { .button {
border: 1px solid #409eff; border: 1px solid #409eff;
display: grid; display: grid;
justify-content: center; justify-content: center;
......
.PageTournament {
:deep(.uni-forms) {
.button {
border: 1px solid #409eff;
display: flex;
width: 10%;
justify-content: center;
&:hover {
cursor: pointer;
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment