Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM04-3
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
JM04-3
Commits
085f72db
Commit
085f72db
authored
Aug 09, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix for 7 8 and result event
parent
2d849519
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
19 deletions
+31
-19
play.component.ts
src/app/play/play.component.ts
+31
-19
No files found.
src/app/play/play.component.ts
View file @
085f72db
...
...
@@ -1015,20 +1015,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
subscribeMapDownEvent
(
btnMore
.
id
,
async
()
=>
{
this
.
g_cartoon
.
playAudio
(
"
sm_moreinfo
"
)
await
this
.
buttonPressAnimation
(
btnMore
.
id
,
btnMoreShadow
.
id
)
let
resultDataStr
=
[]
this
.
m_blockGroup
.
forEach
(
group
=>
{
let
rightLetters
=
""
;
let
currentLetters
=
""
;
group
.
forEach
(
block
=>
{
rightLetters
+=
block
.
getRightLetter
();
currentLetters
+=
block
.
getContentText
();
});
resultDataStr
.
push
({
rightLetters
,
currentLetters
})
});
// console.log(JSON.stringify(resultDataStr))
window
.
parent
.
postMessage
(
{
action
:
'
temp_send_result
'
,
data
:
JSON
.
stringify
(
resultDataStr
)},
"
*
"
)
window
.
parent
.
postMessage
(
{
action
:
'
temp_show_more
'
,
data
:
""
},
"
*
"
)
this
.
g_enableMapDown
=
true
;
})
...
...
@@ -1101,6 +1088,23 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
sendResult
()
{
let
resultDataStr
=
[]
this
.
m_blockGroup
.
forEach
(
group
=>
{
let
rightLetters
=
""
;
let
currentLetters
=
""
;
group
.
forEach
(
block
=>
{
rightLetters
+=
block
.
getRightLetter
();
currentLetters
+=
block
.
getContentText
();
});
resultDataStr
.
push
({
rightLetters
,
currentLetters
})
});
// console.log(JSON.stringify(resultDataStr))
window
.
parent
.
postMessage
(
{
action
:
'
temp_send_result
'
,
data
:
JSON
.
stringify
(
resultDataStr
)},
"
*
"
)
}
initSlider
()
{
const
updateSlider
=
(
len
)
=>
{
let
top
=
this
.
g_cartoon
.
getCartoonElement
(
"
slider-top
"
);
...
...
@@ -1349,14 +1353,14 @@ export class PlayComponent implements OnInit, OnDestroy {
}
},
(
w
,
h
)
=>
{
return
{
x
:
scrollContent
.
ref
.
width
/
2
,
x
:
scrollContent
.
ref
.
width
/
2
-
28
,
y
:
0
}
})
heightData
.
rightRef
=
ele
.
ref
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
rightWord
,
"
Aileron-Bold
"
,
"
#ffe9b1
"
,
52
)
word
.
ref
.
x
=
-
797
/
2
+
1
50
word
.
ref
.
x
=
-
797
/
2
+
1
20
+
word
.
ref
.
width
/
2
word
.
ref
.
y
=
0
ele
.
ref
.
addChild
(
word
.
ref
)
...
...
@@ -1416,8 +1420,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
if
(
item
.
rightRef
)
{
item
.
rightRef
.
y
=
countY
+
item
.
right
/
2
;
countY
+=
item
.
right
+
padding
item
.
rightRef
.
y
=
countY
+
item
.
right
/
2
+
10
;
countY
+=
item
.
right
+
padding
+
10
}
if
(
item
.
lineRef
)
{
...
...
@@ -1510,6 +1514,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
status
=
false
;
let
hasIncorrect
=
false
;
this
.
m_hasActiveBlock
=
false
;
let
errorIndex
=
-
1
;
this
.
m_blockGroup
.
forEach
((
group
,
index
)
=>
{
status
=
this
.
updateStatusByGroupIndex
(
index
)
let
word
=
""
...
...
@@ -1526,6 +1531,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
if
(
!
hasIncorrect
&&
!
status
)
{
hasIncorrect
=
true
;
errorIndex
=
index
;
}
})
if
(
hasIncorrect
)
{
...
...
@@ -1540,10 +1546,15 @@ export class PlayComponent implements OnInit, OnDestroy {
});
});
if
(
errorIndex
>=
0
)
{
this
.
switchQuestion
(
this
.
m_currentQuestionIndex
,
errorIndex
)
}
if
(
this
.
m_submitedTimes
>=
2
||
(
this
.
m_submitedTimes
<
2
&&
!
hasIncorrect
))
{
let
qp
=
this
.
g_cartoon
.
getCartoonElement
(
"
question_container
"
)
let
keyboard
=
this
.
g_cartoon
.
getCartoonElement
(
"
keyboard_container
"
)
let
submitButton
=
this
.
g_cartoon
.
getCartoonElement
(
"
button_submit
"
)
let
submitButton
=
this
.
g_cartoon
.
getCartoonElement
(
"
button_submit
"
);
await
qp
.
out
()
await
keyboard
.
out
()
await
submitButton
.
out
()
...
...
@@ -1710,6 +1721,7 @@ export class PlayComponent implements OnInit, OnDestroy {
endGame
()
{
console
.
log
(
"
游戏结束
"
)
this
.
sendResult
();
this
.
m_endGame
=
true
;
this
.
m_blockGroup
.
forEach
(
group
=>
{
group
.
forEach
(
block
=>
{
...
...
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