Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM-42
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
YM-42
Commits
87ade0fe
Commit
87ade0fe
authored
Nov 18, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: play页面的bug
parent
3c9bbfda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
+31
-28
play.component.ts
src/app/play/play.component.ts
+31
-28
No files found.
src/app/play/play.component.ts
View file @
87ade0fe
...
...
@@ -88,7 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy {
curAudio
;
mask
:
ShapeRect
;
mask
:
ShapeRect
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
onResize
(
event
)
{
...
...
@@ -106,6 +106,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
data
&&
typeof
data
==
'
object
'
)
{
this
.
data
=
data
;
if
(
data
.
contentObj
&&
data
.
contentObj
.
data
)
{
this
.
data
=
data
.
contentObj
.
data
;
}
}
console
.
log
(
'
data:
'
,
data
);
...
...
@@ -457,8 +460,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
rawImages
.
set
(
url
,
url
);
}
addUrlToImage
(
url
,
key
){
if
(
!
key
)
{
addUrlToImage
(
url
,
key
)
{
if
(
!
key
)
{
key
=
url
;
}
...
...
@@ -522,45 +525,45 @@ export class PlayComponent implements OnInit, OnDestroy {
}
const
loadBg
=
(
skin
,
skinType
)
=>
{
const
loadBg
=
(
skin
,
skinType
)
=>
{
if
(
skin
.
lt_pic_url
)
{
this
.
addUrlToImage
(
skin
.
lt_pic_url
,
skinType
+
"
_
"
+
skin
.
lt_pic_url
);
}
if
(
skin
.
lm_pic_url
)
{
this
.
addUrlToImage
(
skin
.
lm_pic_url
,
skinType
+
"
_
"
+
skin
.
lm_pic_url
);
}
if
(
skin
.
lb_pic_url
)
{
this
.
addUrlToImage
(
skin
.
lb_pic_url
,
skinType
+
"
_
"
+
skin
.
lb_pic_url
);
}
if
(
skin
.
mt_pic_url
)
{
this
.
addUrlToImage
(
skin
.
mt_pic_url
,
skinType
+
"
_
"
+
skin
.
mt_pic_url
);
}
if
(
skin
.
mb_pic_url
)
{
this
.
addUrlToImage
(
skin
.
mb_pic_url
,
skinType
+
"
_
"
+
skin
.
mb_pic_url
);
}
if
(
skin
.
rt_pic_url
)
{
this
.
addUrlToImage
(
skin
.
rt_pic_url
,
skinType
+
"
_
"
+
skin
.
rt_pic_url
);
}
if
(
skin
.
rm_pic_url
)
{
this
.
addUrlToImage
(
skin
.
rm_pic_url
,
skinType
+
"
_
"
+
skin
.
rm_pic_url
);
}
if
(
skin
.
rb_pic_url
)
{
this
.
addUrlToImage
(
skin
.
rb_pic_url
,
skinType
+
"
_
"
+
skin
.
rb_pic_url
);
}
}
if
(
this
.
data
.
skinA
)
{
if
(
this
.
data
.
skinA
)
{
loadBg
(
this
.
data
.
skinA
,
'
A
'
);
}
if
(
this
.
data
.
skinB
)
{
if
(
this
.
data
.
skinB
)
{
loadBg
(
this
.
data
.
skinB
,
'
B
'
);
}
}
...
...
@@ -644,7 +647,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
initBg
()
{
const
getPic
=
(
key
,
anchorX
:
number
=
0.5
,
anchorY
:
number
=
0.5
)
=>
{
const
pic
=
new
MySprite
();
pic
.
init
(
this
.
images
.
get
(
key
),
anchorX
,
anchorY
);
...
...
@@ -654,7 +657,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
const
initBg
=
(
skin
,
skinType
)
=>
{
//左上
if
(
skin
.
lt_pic_url
)
{
const
pic
=
getPic
(
skinType
+
'
_
'
+
skin
.
lt_pic_url
,
0
,
0
);
...
...
@@ -713,13 +716,13 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
if
(
this
.
data
.
skin
===
'
A
'
)
{
if
(
this
.
data
.
skinA
)
{
if
(
this
.
data
.
skin
===
'
A
'
)
{
if
(
this
.
data
.
skinA
)
{
initBg
(
this
.
data
.
skinA
,
'
A
'
);
}
}
else
{
if
(
this
.
data
.
skinB
)
{
else
{
if
(
this
.
data
.
skinB
)
{
initBg
(
this
.
data
.
skinB
,
'
B
'
);
}
}
...
...
@@ -755,7 +758,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
startX
=
81
*
this
.
mapScaleX
;
let
startY
=
157
*
this
.
mapScaleY
;
let
lBgArr
=
[];
...
...
@@ -764,7 +767,7 @@ export class PlayComponent implements OnInit, OnDestroy {
startX
=
(
this
.
canvasWidth
-
1100
*
this
.
mapScale
)
/
2
;
let
height
=
3
*
80
*
this
.
mapScale
+
(
3
-
1
)
*
61
*
this
.
mapScale
;
let
height
=
3
*
80
*
this
.
mapScale
+
(
3
-
1
)
*
61
*
this
.
mapScale
;
startY
=
(
this
.
canvasHeight
-
height
)
/
2
;
...
...
@@ -776,14 +779,14 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
skinRenderArr
.
push
(
lBg
);
lBgArr
.
push
(
lBg
);
}
}
}
else
{
else
{
let
width
=
2
*
560
*
this
.
mapScale
+
25
*
this
.
mapScaleX
;
startX
=
(
this
.
canvasWidth
-
width
)
/
2
;
let
height
=
3
*
96
*
this
.
mapScale
+
(
3
-
1
)
*
78
*
this
.
mapScale
;
let
height
=
3
*
96
*
this
.
mapScale
+
(
3
-
1
)
*
78
*
this
.
mapScale
;
startY
=
(
this
.
canvasHeight
-
height
)
/
2
;
}
...
...
@@ -828,7 +831,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//到下一行增加高度
startY
=
tempStartY
;
}
else
{
if
(
this
.
data
.
skin
===
'
A
'
)
{
...
...
@@ -846,9 +849,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
bigCardRenderArr
.
push
(
exercises
.
cardBg
);
}
for
(
let
i
=
0
;
i
<
lBgArr
.
length
;
++
i
)
{
for
(
let
i
=
0
;
i
<
lBgArr
.
length
;
++
i
)
{
lBgArr
[
i
].
y
=
startYArr
[
i
];
lBgArr
[
i
].
height
=
hight
;
lBgArr
[
i
].
height
=
hight
;
}
let
minFontSize
=
100
;
...
...
@@ -892,7 +895,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
this
.
checkClickTarget
(
this
.
listening
.
bg
))
{
this
.
curAudio
=
this
.
listening
.
play
(()
=>
{
this
.
curAudio
=
this
.
listening
.
play
(()
=>
{
this
.
listening
.
reset
();
});
...
...
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