Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_4-1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
JM_4-1
Commits
bf85b4b2
Commit
bf85b4b2
authored
Aug 05, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化显示隐藏
parent
14e1c5cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
play.component.html
src/app/play/play.component.html
+1
-1
play.component.ts
src/app/play/play.component.ts
+17
-3
No files found.
src/app/play/play.component.html
View file @
bf85b4b2
...
...
@@ -8,7 +8,7 @@
<div
#
iframeContent
style=
"position: absolute; top: 0; overflow: hidden; "
>
<div
*
ngFor=
"let t of templateArr; let i = index"
>
<iframe
[
style
.
left
]="
t
?.
leftOff
||
'
100vw
'"
[
src
]="
t
?.
playUrl
||
safeDefaultUrl
"
style=
"position: fixed; width: 100vw; height: 100vh; border: 0px solid #ccc; "
frameborder=
"0"
>
<iframe
*
ngIf=
"!t.isHide"
[
style
.
left
]="
t
?.
leftOff
||
'
100vw
'"
[
src
]="
t
?.
playUrl
||
safeDefaultUrl
"
style=
"position: fixed; width: 100vw; height: 100vh; border: 0px solid #ccc; "
frameborder=
"0"
>
</iframe>
</div>
</div>
...
...
src/app/play/play.component.ts
View file @
bf85b4b2
...
...
@@ -1386,6 +1386,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
setPageData
(
'
progress
'
,
'
2
'
,
false
);
this
.
setPageData
(
'
submitCount
'
,
this
.
submitCount
);
this
.
checkShowSubTemplateOne
();
this
.
isUpdateStop
=
true
;
}
checkShowSubTemplateOne
()
{
...
...
@@ -1414,8 +1415,11 @@ export class PlayComponent implements OnInit, OnDestroy {
let
index
;
if
(
this
.
submitCount
==
1
)
{
index
=
0
;
this
.
hideSubTemplate
(
1
);
}
else
{
index
=
1
;
this
.
hideSubTemplate
(
2
);
}
this
.
showSubTemplate
(
index
);
...
...
@@ -1428,7 +1432,7 @@ export class PlayComponent implements OnInit, OnDestroy {
sendSubTempIsShowMore
(
index
,
isShowMore
)
{
const
divArr
=
this
.
iframeContent
.
nativeElement
.
children
;
const
iframecont
=
divArr
[
index
].
children
[
0
];
const
data
=
{
msg
:
'
success
'
,
data
:
JSON
.
stringify
({
isShowMore
})
};
const
data
=
{
msg
:
'
success
'
,
isShowMore
};
iframecont
.
contentWindow
.
postMessage
({
action
:
'
is_show_more
'
,
data
:
JSON
.
stringify
(
data
)
},
'
*
'
);
console
.
log
(
'
post msg is_show_more
'
)
}
...
...
@@ -1756,6 +1760,14 @@ export class PlayComponent implements OnInit, OnDestroy {
}
hideSubTemplate
(
index
)
{
this
.
templateArr
[
index
].
isHide
=
true
;
this
.
appRef
.
tick
();
}
iframeArr
;
initWindowListener
()
{
...
...
@@ -1845,10 +1857,12 @@ export class PlayComponent implements OnInit, OnDestroy {
isUpdateStop
=
false
;
update
()
{
if
(
this
.
isUpdateStop
)
{
return
;
}
this
.
animationId
=
window
.
requestAnimationFrame
(
this
.
update
.
bind
(
this
));
// 清除画布内容
this
.
ctx
.
clearRect
(
0
,
0
,
this
.
canvasWidth
,
this
.
canvasHeight
);
...
...
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