Commit 53c429f2 authored by xiaoye's avatar xiaoye

增加:比赛举办者

parent 5a245665
Pipeline #37707 passed with stages
in 2 minutes and 20 seconds
...@@ -10,6 +10,16 @@ ...@@ -10,6 +10,16 @@
:sub-title = 'tournament.this.description' :sub-title = 'tournament.this.description'
:extra = 'tournament.this.createdAt.toLocaleDateString()' :extra = 'tournament.this.createdAt.toLocaleDateString()'
> >
<uni-list>
<uni-list-chat
:avatar-circle = true
:title = 'creator.name'
time = '举办者'
:avatar = 'creator.avatar'
>
</uni-list-chat>
</uni-list>
<br>
<uni-forms> <uni-forms>
<view class = 'button_list' > <view class = 'button_list' >
<view class = 'button click' @click = '() => { emitter.emit(Const.tournamentInfo); }'> <view class = 'button click' @click = '() => { emitter.emit(Const.tournamentInfo); }'>
...@@ -627,6 +637,11 @@ ...@@ -627,6 +637,11 @@
} }
}); });
let creator = reactive({
name : '',
avatar : ''
});
const loading = () : void => { const loading = () : void => {
const url = window.location.hash.match(/#\/(.*?)(?:\?|$)/); const url = window.location.hash.match(/#\/(.*?)(?:\?|$)/);
url && !isNaN(parseInt(url[1])) ? page.get() : page.clear(); url && !isNaN(parseInt(url[1])) ? page.get() : page.clear();
...@@ -655,6 +670,18 @@ ...@@ -655,6 +670,18 @@
match.submit.chk = match.array.map(i => [i.player1Score ?? 0, i.player2Score ?? 0]); match.submit.chk = match.array.map(i => [i.player1Score ?? 0, i.player2Score ?? 0]);
match.maxRound = match.array.find(i => i.isThirdPlaceMatch)?.round ?? match.round + 1; match.maxRound = match.array.find(i => i.isThirdPlaceMatch)?.round ?? match.round + 1;
}, {deep : true}); }, {deep : true});
watch(() => { return tournament.this?.creator; }, async (n = -1) => {
if (n >= 0) {
const response = await User.Find.Id(n);
if (response) {
creator.name = response.username;
creator.avatar = response.avatar;
}
}
}, {immediate : true});
</script> </script>
<style scoped lang = 'scss'> <style scoped lang = 'scss'>
......
...@@ -160,7 +160,7 @@ interface TournamentGet { ...@@ -160,7 +160,7 @@ interface TournamentGet {
interface UserObject { interface UserObject {
avatar : string avatar : string
id : 777668 id : number
username : string username : string
} }
......
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