Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
tabulator-another-web
Commits
02e6308a
Commit
02e6308a
authored
May 19, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 通过url储存id
parent
0407444e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
221 additions
and
220 deletions
+221
-220
src/pages/main.vue
src/pages/main.vue
+12
-9
src/pages/tournament.vue
src/pages/tournament.vue
+209
-209
src/script/const.ts
src/script/const.ts
+0
-2
No files found.
src/pages/main.vue
View file @
02e6308a
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
</uni-pagination>
</uni-pagination>
</transition>
</transition>
<transition
name =
'switch'
>
<transition
name =
'switch'
>
<PageTournament
v-
show
=
'page.tournament'
/>
<PageTournament
v-
if
=
'page.tournament'
/>
</transition>
</transition>
</view>
</view>
</transition>
</transition>
...
@@ -247,10 +247,8 @@
...
@@ -247,10 +247,8 @@
import
Mycard
from
'
../script/mycard.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
import
emitter
from
'
../script/emitter.ts
'
import
emitter
from
'
../script/emitter.ts
'
import
{
import
{
selectTournament
,
updateTournament
,
updateTournament
,
tournamentInfo
,
tournamentInfo
,
tournamentExit
,
tournamentReload
tournamentReload
}
from
'
../script/const.ts
'
}
from
'
../script/const.ts
'
import
PageTournament
from
'
./tournament.vue
'
;
import
PageTournament
from
'
./tournament.vue
'
;
...
@@ -276,8 +274,8 @@
...
@@ -276,8 +274,8 @@
page
.
menu
=
false
;
page
.
menu
=
false
;
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
page
.
tournament
=
true
;
page
.
tournament
=
true
;
emitter
.
emit
(
selectTournament
,
search
.
result
.
tournaments
[
v
]
);
const
url
=
window
.
location
.
href
.
split
(
'
/?
'
);
tournament
.
init
(
search
.
result
.
tournaments
[
v
]);
window
.
location
.
replace
(
`
${
url
[
0
]}
/tournament/
${
search
.
result
.
tournaments
[
v
].
id
}
/?
${
url
[
1
]
??
''
}
`)
},
},
menu : async(): Promise<void> => {
menu : async(): Promise<void> => {
page.tournament = false;
page.tournament = false;
...
@@ -530,20 +528,25 @@
...
@@ -530,20 +528,25 @@
}
}
});
});
onBeforeMount
(()
=>
{
onBeforeMount(()
: void
=> {
Uniapp.chkScreen(size.get);
Uniapp.chkScreen(size.get);
search
.
on
();
document.addEventListener("click", page.show.clear);
document.addEventListener("click", page.show.clear);
emitter.on(tournamentInfo, page.show.drawer);
emitter.on(tournamentInfo, page.show.drawer);
emitter
.
on
(
tournamentExit
,
page
.
show
.
menu
);
// @ts-ignore
// @ts-ignore
emitter.on(tournamentReload, tournament.init);
emitter.on(tournamentReload, tournament.init);
const url = window.location.href.match(/tournament\/(\d+)[^\/]*\/\?/);
if (url && !isNaN(parseInt(url[1]))) {
page.menu = false;
page.tournament = true;
} else {
search.on();
}
});
});
onUnmounted(() => {
onUnmounted(() => {
document.removeEventListener("click", page.show.clear);
document.removeEventListener("click", page.show.clear);
emitter.off(tournamentInfo, page.show.drawer);
emitter.off(tournamentInfo, page.show.drawer);
emitter
.
off
(
tournamentExit
,
page
.
show
.
menu
);
// @ts-ignore
// @ts-ignore
emitter.off(tournamentReload, tournament.init);
emitter.off(tournamentReload, tournament.init);
});
});
...
...
src/pages/tournament.vue
View file @
02e6308a
<
template
>
<
template
>
<view
class =
'PageTournament'
>
<view
class =
'PageTournament'
>
<transition
name =
'switch'
>
<uni-card
<uni-card
id =
'PageTournament'
id =
'PageTournament'
:style =
"page.height > 0 ?
{ height: `${page.height}px` } : { height: '100%' }"
:style =
"page.height > 0 ?
{ height: `${page.height}px` } : { height: '100%' }"
...
@@ -192,6 +193,7 @@
...
@@ -192,6 +193,7 @@
<
/uni-card
>
<
/uni-card
>
<
/transition
>
<
/transition
>
<
/uni-card
>
<
/uni-card
>
<
/transition
>
<
/view
>
<
/view
>
<
/template
>
<
/template
>
<
script
setup
lang
=
'
ts
'
>
<
script
setup
lang
=
'
ts
'
>
...
@@ -202,10 +204,8 @@
...
@@ -202,10 +204,8 @@
import
Participant
from
'
../script/participant.ts
'
;
import
Participant
from
'
../script/participant.ts
'
;
import
Match
from
'
../script/match.ts
'
;
import
Match
from
'
../script/match.ts
'
;
import
{
import
{
selectTournament
,
updateTournament
,
updateTournament
,
tournamentInfo
,
tournamentInfo
,
tournamentExit
,
tournamentReload
tournamentReload
}
from
'
../script/const.ts
'
}
from
'
../script/const.ts
'
import
Mycard
from
'
../script/mycard.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
...
@@ -328,26 +328,28 @@
...
@@ -328,26 +328,28 @@
let
page
=
reactive
({
let
page
=
reactive
({
height
:
0
,
height
:
0
,
loading
:
false
,
loading
:
false
,
clear
:
async
()
:
Promise
<
void
>
=>
{
clear
:
async
()
:
Promise
<
void
>=>
{
emitter
.
emit
(
tournamentExit
);
const
url
=
window
.
location
.
href
.
match
(
/
(\/
tournament
\/[^\/]
+
)(?=\/\?)
/
);
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
if
(
url
)
{
participant
.
array
=
[];
participant
.
total
=
0
;
participant
.
page
=
1
;
match
.
array
=
[];
match
.
total
=
0
;
match
.
page
=
1
;
tournament
.
this
=
undefined
;
tournament
.
this
=
undefined
;
participant
.
name
=
''
;
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
450
)));
window
.
location
.
replace
(
window
.
location
.
href
.
replace
(
url
[
1
],
''
));
}
}
,
}
,
get
:
async
(
t
:
Tournament
)
:
Promise
<
void
>
=>
{
get
:
async
(
id
:
number
)
:
Promise
<
void
>
=>
{
const
t
=
await
Tabulator
.
Tournament
.
Find
(
Mycard
.
token
,
id
);
if
(
t
)
{
tournament
.
this
=
t
;
tournament
.
this
=
t
;
emitter
.
emit
(
tournamentReload
,
t
)
const
participants
:
AllParticipant
=
await
Tabulator
.
Participant
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
}
);
const
participants
:
AllParticipant
=
await
Tabulator
.
Participant
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
}
);
participant
.
array
=
participants
.
participants
;
participant
.
array
=
participants
.
participants
;
participant
.
total
=
participants
.
total
;
participant
.
total
=
participants
.
total
;
const
matchs
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
,
statusIn
:
'
Running,Finished
'
}
);
const
matchs
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
,
statusIn
:
'
Running,Finished
'
}
);
match
.
array
=
matchs
.
matchs
;
match
.
array
=
matchs
.
matchs
;
match
.
total
=
matchs
.
total
;
match
.
total
=
matchs
.
total
;
}
else
{
page
.
clear
();
}
}
,
}
,
reload
:
async
()
:
Promise
<
void
>
=>
{
reload
:
async
()
:
Promise
<
void
>
=>
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
...
@@ -375,17 +377,15 @@
...
@@ -375,17 +377,15 @@
}
);
}
);
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
// @ts-ignore
const
url
=
window
.
location
.
href
.
match
(
/tournament
\/(\d
+
)[^\/]
*
\/\?
/
);
emitter
.
on
(
selectTournament
,
page
.
get
);
url
&&
!
isNaN
(
parseInt
(
url
[
1
]))
?
page
.
get
(
parseInt
(
url
[
1
]))
:
page
.
clear
(
);
// @ts-ignore
// @ts-ignore
emitter
.
on
(
updateTournament
,
participant
.
update
);
emitter
.
on
(
updateTournament
,
participant
.
update
);
}
);
}
);
onUnmounted
(()
=>
{
onUnmounted
(()
=>
{
// @ts-ignore
// @ts-ignore
emitter
.
off
(
selectTournament
,
page
.
get
);
emitter
.
off
(
updateTournament
,
participant
.
update
);
// @ts-ignore
emitter
.
off
(
selectTournament
,
participant
.
update
);
}
);
}
);
<
/script
>
<
/script
>
...
...
src/script/const.ts
View file @
02e6308a
...
@@ -6,9 +6,7 @@ const tournamentExit = 'tournamentExit';
...
@@ -6,9 +6,7 @@ const tournamentExit = 'tournamentExit';
const
tournamentReload
=
'
tournamentReload
'
const
tournamentReload
=
'
tournamentReload
'
export
{
export
{
selectTournament
,
updateTournament
,
updateTournament
,
tournamentInfo
,
tournamentInfo
,
tournamentExit
,
tournamentReload
tournamentReload
};
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment