Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kww_dayDayGetCredits_250512
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
kww_dayDayGetCredits_250512
Commits
ce85402c
Commit
ce85402c
authored
May 19, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
f9fc3e7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
7 deletions
+21
-7
ModalCtrl.module.less
src/core/ctrls/ModalCtrl.module.less
+2
-2
ModalCtrl.tsx
src/core/ctrls/ModalCtrl.tsx
+12
-4
HomePage.tsx
src/pages/HomePage/HomePage.tsx
+1
-1
store.ts
src/store/store.ts
+6
-0
No files found.
src/core/ctrls/ModalCtrl.module.less
View file @
ce85402c
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
bottom: 0;
bottom: 0;
right: 0;
right: 0;
left: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.
9
);
background-color: rgba(0, 0, 0, 0.
8
);
z-index: 2000;
z-index: 2000;
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
}
}
\ No newline at end of file
src/core/ctrls/ModalCtrl.tsx
View file @
ce85402c
...
@@ -5,6 +5,8 @@ import NewcomerPanel from "@/panels/NewcomerPanel/NewcomerPanel.tsx";
...
@@ -5,6 +5,8 @@ import NewcomerPanel from "@/panels/NewcomerPanel/NewcomerPanel.tsx";
import
WedExpPanel
from
"@/panels/WedExpPanel/WedExpPanel.tsx"
;
import
WedExpPanel
from
"@/panels/WedExpPanel/WedExpPanel.tsx"
;
import
SignSucPanel
from
"@/panels/SignSucPanel/SignSucPanel.tsx"
;
import
SignSucPanel
from
"@/panels/SignSucPanel/SignSucPanel.tsx"
;
import
VideoPanel
from
"@/panels/VideoPanel/VideoPanel.tsx"
;
import
VideoPanel
from
"@/panels/VideoPanel/VideoPanel.tsx"
;
import
GuidePanel
from
"@/panels/GuidePanel/GuidePanel.tsx"
;
import
top
from
"@/pages/HomePage/Top/Top.tsx"
;
// 弹窗优先级配置Map,key为弹窗组件名(建议用组件.displayName或组件名字符串),value为优先级数值
// 弹窗优先级配置Map,key为弹窗组件名(建议用组件.displayName或组件名字符串),value为优先级数值
// 数值越大优先级越高,未配置的默认0
// 数值越大优先级越高,未配置的默认0
...
@@ -13,6 +15,7 @@ const modalPriorityMap = new Map<ComponentType<any>, number>([
...
@@ -13,6 +15,7 @@ const modalPriorityMap = new Map<ComponentType<any>, number>([
[
WedExpPanel
,
15
],
[
WedExpPanel
,
15
],
[
SignSucPanel
,
15
],
[
SignSucPanel
,
15
],
[
VideoPanel
,
10
],
[
VideoPanel
,
10
],
[
GuidePanel
,
100
],
]);
]);
interface
ModalItem
{
interface
ModalItem
{
...
@@ -29,9 +32,10 @@ interface ModalCtrlState {
...
@@ -29,9 +32,10 @@ interface ModalCtrlState {
export
class
ModalCtrl
extends
Component
<
{},
ModalCtrlState
>
{
export
class
ModalCtrl
extends
Component
<
{},
ModalCtrlState
>
{
state
=
{
state
=
{
modals
:
[],
modals
:
[],
showMask
:
true
,
};
};
static
showModal
:
(
Component
:
ComponentType
<
any
>
,
props
?:
any
)
=>
void
=
null
;
static
showModal
:
(
Component
:
ComponentType
<
any
>
,
props
?:
any
,
showMask
?:
boolean
)
=>
void
=
null
;
static
closeModal
:
(
Component
?:
ComponentType
<
any
>
)
=>
void
=
null
;
static
closeModal
:
(
Component
?:
ComponentType
<
any
>
)
=>
void
=
null
;
static
closeAllModal
:
()
=>
void
=
null
;
static
closeAllModal
:
()
=>
void
=
null
;
...
@@ -47,12 +51,12 @@ export class ModalCtrl extends Component<{}, ModalCtrlState> {
...
@@ -47,12 +51,12 @@ export class ModalCtrl extends Component<{}, ModalCtrlState> {
ModalCtrl
.
closeAllModal
=
null
;
ModalCtrl
.
closeAllModal
=
null
;
}
}
showModal
=
(
Component
:
ComponentType
<
any
>
,
props
:
any
=
{})
=>
{
showModal
=
(
Component
:
ComponentType
<
any
>
,
props
:
any
=
{}
,
showMask
=
true
)
=>
{
const
key
=
`modal_
${
Date
.
now
()}
_
${
Math
.
random
()}
`
;
const
key
=
`modal_
${
Date
.
now
()}
_
${
Math
.
random
()}
`
;
const
priority
=
modalPriorityMap
.
get
(
Component
)
||
0
;
const
priority
=
modalPriorityMap
.
get
(
Component
)
||
0
;
const
modals
=
this
.
state
.
modals
;
const
modals
=
this
.
state
.
modals
;
modals
.
push
({
key
,
Component
,
props
,
priority
})
modals
.
push
({
key
,
Component
,
props
,
priority
,
showMask
});
modals
.
sort
((
a
,
b
)
=>
{
modals
.
sort
((
a
,
b
)
=>
{
return
(
a
.
priority
||
0
)
-
(
b
.
priority
||
0
);
return
(
a
.
priority
||
0
)
-
(
b
.
priority
||
0
);
});
});
...
@@ -85,7 +89,11 @@ export class ModalCtrl extends Component<{}, ModalCtrlState> {
...
@@ -85,7 +89,11 @@ export class ModalCtrl extends Component<{}, ModalCtrlState> {
const
topModal
=
modals
[
modals
.
length
-
1
];
const
topModal
=
modals
[
modals
.
length
-
1
];
return
(
return
(
<>
<>
<
div
className=
{
styles
.
modalManagerBg
}
key=
{
topModal
.
key
}
style=
{
{
zIndex
:
2000
}
}
>
<
div
className=
{
styles
.
modalManagerBg
}
key=
{
topModal
.
key
}
style=
{
{
zIndex
:
2000
,
backgroundColor
:
`rgba(0,0,0, ${topModal.showMask ? 0.7 : 0})`
}
}
>
<
topModal
.
Component
{
...
topModal
.
props
}
/>
<
topModal
.
Component
{
...
topModal
.
props
}
/>
</
div
>
</
div
>
</>
</>
...
...
src/pages/HomePage/HomePage.tsx
View file @
ce85402c
...
@@ -77,7 +77,7 @@ class HomePage extends React.Component<any, any> {
...
@@ -77,7 +77,7 @@ class HomePage extends React.Component<any, any> {
</
div
>
</
div
>
</
div
>
</
div
>
{
!
guideFlag
&&
<
GuidePanel
/>
}
{
/*{!guideFlag && <GuidePanel />}*/
}
</>;
</>;
}
}
}
}
...
...
src/store/store.ts
View file @
ce85402c
...
@@ -21,6 +21,7 @@ import { showShareGuide } from '@spark/share';
...
@@ -21,6 +21,7 @@ import { showShareGuide } from '@spark/share';
import
Assist_succeed
from
"../../src/components/assist_succeed/assist_succeed"
import
Assist_succeed
from
"../../src/components/assist_succeed/assist_succeed"
import
Assist_fail
from
"../../src/components/assist_fail/assist_fail"
import
Assist_fail
from
"../../src/components/assist_fail/assist_fail"
import
Fail_challenge
from
"../../src/components/fail_challenge/fail_challenge"
import
Fail_challenge
from
"../../src/components/fail_challenge/fail_challenge"
import
GuidePanel
from
"@/panels/GuidePanel/GuidePanel.tsx"
;
class
Store
{
class
Store
{
...
@@ -113,6 +114,11 @@ class Store {
...
@@ -113,6 +114,11 @@ class Store {
});
});
}
}
if
(
!
data
.
guideFlag
)
{
ModalCtrl
.
closeModal
(
GuidePanel
);
ModalCtrl
.
showModal
(
GuidePanel
,
{},
false
);
}
}
}
/**
/**
...
...
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