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
1a6d4ca7
Commit
1a6d4ca7
authored
May 21, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ab2c1ec2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
5 deletions
+108
-5
src/pages/main.vue
src/pages/main.vue
+2
-0
src/pages/pics.vue
src/pages/pics.vue
+75
-0
src/pages/tournament.vue
src/pages/tournament.vue
+10
-2
src/script/const.ts
src/script/const.ts
+1
-0
src/script/participant.ts
src/script/participant.ts
+3
-3
src/style/page.scss
src/style/page.scss
+17
-0
No files found.
src/pages/main.vue
View file @
1a6d4ca7
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
</uni-list-chat>
</uni-list-chat>
</uni-list>
</uni-list>
</view>
</view>
<Pics></Pics>
<transition
name =
'move_right'
>
<transition
name =
'move_right'
>
<uni-card
<uni-card
class =
'click'
class =
'click'
...
@@ -264,6 +265,7 @@
...
@@ -264,6 +265,7 @@
import
Const
from
'
../script/const.ts
'
import
Const
from
'
../script/const.ts
'
import
PageTournament
from
'
./tournament.vue
'
;
import
PageTournament
from
'
./tournament.vue
'
;
import
Create
from
'
./drawer.vue
'
;
import
Create
from
'
./drawer.vue
'
;
import
Pics
from
'
./pics.vue
'
;
let
page
=
reactive
({
let
page
=
reactive
({
user
:
false
,
user
:
false
,
...
...
src/pages/pics.vue
0 → 100644
View file @
1a6d4ca7
<
template
>
<view
class =
'Pics'
>
<transition
name =
'move_right'
>
<view
v-show =
'deck.participant >= 0'
>
<uni-card
:title =
"deck.main.length > 0 ? '主卡组' : '暂无主卡组'"
>
<image
class =
'deck_cards'
v-for =
'(i, v) in deck.main'
:src =
'`https://cdn.233.momobako.com/ygopro/pics/$
{i}.jpg!half`' mode = 'aspectFit' @error = 'changeImg.main(v)'>
</image>
</uni-card>
<uni-card
:title =
"deck.side.length > 0 ? '副卡组' : '暂无副卡组'"
>
<image
class =
'deck_cards'
v-for =
'(i, v) in deck.side'
:src =
'`https://cdn.233.momobako.com/ygopro/pics/$
{i}.jpg!half`' mode = 'aspectFit' @error = 'changeImg.main(v)'>
</image>
</uni-card>
</view>
</transition>
</view>
</
template
>
<
script
setup
lang =
'ts'
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
emitter
from
'
../script/emitter.ts
'
import
Const
from
'
../script/const.ts
'
import
Participant
from
'
../script/participant.ts
'
;
const
changeImg
=
{
main
:
(
v
:
number
)
:
void
=>
{
deck
.
main
[
v
]
=
0
;
},
side
:
(
v
:
number
)
:
void
=>
{
deck
.
side
[
v
]
=
0
;
}
};
let
deck
=
reactive
({
participant
:
-
1
as
number
,
main
:
[]
as
Array
<
number
>
,
side
:
[]
as
Array
<
number
>
,
init
:
(
i
:
Map
<
string
,
Array
<
number
>>
)
:
void
=>
{
const
participant
=
i
.
get
(
'
Participant
'
)?.[
0
]
??
-
1
;
if
(
participant
&&
deck
.
participant
==
participant
)
{
deck
.
off
();
return
}
deck
.
main
=
i
.
get
(
'
main
'
)
??
[];
deck
.
side
=
i
.
get
(
'
side
'
)
??
[];
deck
.
participant
=
participant
;
},
off
:
async
()
:
Promise
<
void
>
=>
{
deck
.
participant
=
-
1
;
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
deck
.
main
=
[];
deck
.
side
=
[];
},
clickClear
:
(
e
)
:
void
=>
{
let
element
=
e
.
target
;
while
(
element
)
{
if
([
'
body
'
].
includes
(
element
.
id
)
||
element
.
classList
.
contains
(
'
Pics
'
))
return
undefined
;
element
=
element
.
parentElement
;
}
deck
.
off
();
}
});
onBeforeMount
(()
:
void
=>
{
// @ts-ignore
emitter
.
on
(
Const
.
picsOpen
,
deck
.
init
);
document
.
addEventListener
(
"
click
"
,
deck
.
clickClear
);
});
onUnmounted
(()
=>
{
// @ts-ignore
emitter
.
off
(
Const
.
picsOpen
,
deck
.
init
);
document
.
removeEventListener
(
"
click
"
,
deck
.
clickClear
);
});
</
script
>
<
style
scoped
lang =
'scss'
>
@import
'../style/transition.scss'
;
</
style
>
\ No newline at end of file
src/pages/tournament.vue
View file @
1a6d4ca7
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
:title =
"i.score ? `胜平负:$
{i.score.win + i.score.bye}-${i.score.draw}-${i.score.lose}` : ''"
:title =
"i.score ? `胜平负:$
{i.score.win + i.score.bye}-${i.score.draw}-${i.score.lose}` : ''"
:note = "i.score ? `小分:${i.score.score}` : ''"
:note = "i.score ? `小分:${i.score.score}` : ''"
:clickable = true
:clickable = true
@click = 'participant.pics.on(i)'
>
>
<template
v-slot:header
>
<template
v-slot:header
>
<view
id =
'header'
>
<view
id =
'header'
>
...
@@ -348,10 +349,10 @@
...
@@ -348,10 +349,10 @@
showCancel
:
false
showCancel
:
false
}
);
}
);
}
,
}
,
upload
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
upload
:
async
()
:
Promise
<
void
>
=>
{
const
f
=
async
(
res
:
UniApp
.
ChooseFileSuccessCallbackResult
)
:
Promise
<
void
>
=>
{
const
f
=
async
(
res
:
UniApp
.
ChooseFileSuccessCallbackResult
)
:
Promise
<
void
>
=>
{
// @ts-ignore
// @ts-ignore
if
(
await
Tabulator
.
Participant
.
UpdateYdk
(
Mycard
.
token
,
tournament
.
this
.
id
,
res
.
tempFiles
[
0
],
i
.
name
))
if
(
await
Tabulator
.
Tournament
.
UpdateYdk
(
Mycard
.
token
,
tournament
.
this
.
id
,
res
))
await
participant
.
search
();
await
participant
.
search
();
}
;
}
;
await
UniApp
.
selectFile
([
'
.ydk
'
,
'
.txt
'
],
f
);
await
UniApp
.
selectFile
([
'
.ydk
'
,
'
.txt
'
],
f
);
...
@@ -474,6 +475,13 @@
...
@@ -474,6 +475,13 @@
}
}
}
;
}
;
await
UniApp
.
selectFile
([
'
.ydk
'
,
'
.txt
'
],
f
,
1
);
await
UniApp
.
selectFile
([
'
.ydk
'
,
'
.txt
'
],
f
,
1
);
}
,
pics
:
{
on
:
(
i
:
Participant
)
=>
{
emitter
.
emit
(
Const
.
picsOpen
,
new
Map
([
[
'
main
'
,
i
.
getDeck
().
main
],
[
'
side
'
,
i
.
getDeck
().
side
],
[
'
Participant
'
,
[
i
.
id
]]
]))
}
}
}
}
);
}
);
...
...
src/script/const.ts
View file @
1a6d4ca7
...
@@ -4,6 +4,7 @@ class ConstData {
...
@@ -4,6 +4,7 @@ class ConstData {
tournamentInfo
=
'
tournamentInfo
'
;
tournamentInfo
=
'
tournamentInfo
'
;
tournamentReload
=
'
tournamentReload
'
;
tournamentReload
=
'
tournamentReload
'
;
createOff
=
'
createOff
'
;
createOff
=
'
createOff
'
;
picsOpen
=
'
picsOpen
'
;
}
}
const
Const
=
new
ConstData
();
const
Const
=
new
ConstData
();
...
...
src/script/participant.ts
View file @
1a6d4ca7
...
@@ -30,9 +30,9 @@ class Participant {
...
@@ -30,9 +30,9 @@ class Participant {
getDeck
=
()
:
Deck
=>
{
getDeck
=
()
:
Deck
=>
{
return
{
return
{
main
:
this
.
deck
?.
main
??
[],
main
:
this
.
deck
?.
main
.
slice
()
??
[],
extra
:
this
.
deck
?.
extra
??
[],
extra
:
this
.
deck
?.
extra
.
slice
()
??
[],
side
:
this
.
deck
?.
side
??
[],
side
:
this
.
deck
?.
side
.
slice
()
??
[],
};
};
}
}
}
}
...
...
src/style/page.scss
View file @
1a6d4ca7
...
@@ -81,4 +81,21 @@
...
@@ -81,4 +81,21 @@
border
:
0
.02px
solid
#409eff
;
border
:
0
.02px
solid
#409eff
;
}
}
}
}
.Pics
{
position
:
absolute
;
z-index
:
1
;
right
:
2%
;
width
:
50%
;
:deep
(
.uni-card
)
{
// display: flex;
.deck_cards
{
width
:
10%
;
height
:
11
.52vh
;
aspect-ratio
:
1
/
1
.43
;
display
:
inline-block
;
vertical-align
:
top
;
}
}
}
}
}
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