Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_online_008
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
hw_online_008
Commits
2d4d3d00
Commit
2d4d3d00
authored
Feb 26, 2020
by
Dumplings X
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
d4dde87d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
play.component.ts
src/app/play/play.component.ts
+28
-0
No files found.
src/app/play/play.component.ts
View file @
2d4d3d00
...
...
@@ -104,6 +104,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 是否游戏进行中
isGaming
;
@
HostListener
(
'
window:resize
'
,
[
'
$event
'
])
onResize
(
event
)
{
this
.
winResizeEventStream
.
next
();
...
...
@@ -277,6 +278,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
gameEndFlag
=
true
;
}
serverPicArr
;
initData
()
{
this
.
canvasWidth
=
this
.
wrap
.
nativeElement
.
clientWidth
;
this
.
canvasHeight
=
this
.
wrap
.
nativeElement
.
clientHeight
;
...
...
@@ -302,10 +305,34 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
data
.
contentObj
.
picArr
=
[];
}
this
.
picArr
=
this
.
data
.
contentObj
.
picArr
;
this
.
serverPicArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
picArr
));
this
.
picIndex
=
0
;
}
setServerPicArr
(
data
)
{
const
tmpData
=
this
.
serverPicArr
[
this
.
curPageIndex
];
tmpData
.
finish
=
true
;
let
score
=
0
;
for
(
let
i
=
0
;
i
<
this
.
serverPicArr
.
length
;
i
++
)
{
if
(
this
.
serverPicArr
[
i
].
finish
)
{
score
++
;
}
}
let
finishFlag
=
true
;
for
(
let
i
=
0
;
i
<
this
.
serverPicArr
.
length
;
i
++
)
{
if
(
!
this
.
serverPicArr
[
i
].
finish
)
{
finishFlag
=
false
;
break
;
}
}
const
scoreData
=
{};
scoreData
[
'
user
'
]
=
window
[
'
air
'
].
airClassInfo
.
user
;
scoreData
[
'
serverPicArr
'
]
=
this
.
serverPicArr
;
scoreData
[
'
score
'
]
=
score
;
scoreData
[
'
finish
'
]
=
finishFlag
;
this
.
sendServerEvent
(
'
score_data
'
,
scoreData
);
}
...
...
@@ -953,6 +980,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const
options
=
data
.
options
;
if
(
options
[
index
]
&&
options
[
index
].
checked
)
{
console
.
log
(
'
right
'
);
this
.
setServerPicArr
(
data
);
this
.
showFrame
(
index
);
}
else
{
console
.
log
(
'
wrong
'
);
...
...
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