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
29a3ae94
Commit
29a3ae94
authored
Jul 25, 2021
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
00a8b820
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
36 deletions
+45
-36
play.component.ts
src/app/play/play.component.ts
+44
-35
resources.js
src/app/play/resources.js
+1
-1
No files found.
src/app/play/play.component.ts
View file @
29a3ae94
...
@@ -140,6 +140,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -140,6 +140,7 @@ export class PlayComponent implements OnInit, OnDestroy {
m_submitedTimes
=
0
;
m_submitedTimes
=
0
;
m_wordLetterInputCatch
=
[];
m_wordLetterInputCatch
=
[];
m_canInput
=
true
;
m_canInput
=
true
;
m_totalScrollHeight
=
0
;
// ------------------------------------
// ------------------------------------
...
@@ -666,14 +667,14 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -666,14 +667,14 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
container
.
checkStatus
=
(
withRed
=
false
,
groupIndex
)
=>
{
container
.
checkStatus
=
(
withRed
=
false
,
groupIndex
)
=>
{
container
.
active
(
false
);
//
container.active(false);
if
(
letter
!=
container
.
getContentText
())
{
if
(
letter
!=
container
.
getContentText
())
{
this
.
m_hasErrorLetter
=
true
;
this
.
m_hasErrorLetter
=
true
;
if
(
this
.
m_currentQuestionIndex
==
groupIndex
)
{
if
(
this
.
m_currentQuestionIndex
==
groupIndex
)
{
if
(
!
this
.
m_hasActiveBlock
)
{
if
(
!
this
.
m_hasActiveBlock
)
{
container
.
switchStatus
(
"
focus
"
);
container
.
switchStatus
(
"
focus
"
);
this
.
m_hasActiveBlock
=
true
;
this
.
m_hasActiveBlock
=
true
;
this
.
m_current
Input
Index
=
groupIndex
;
this
.
m_current
Question
Index
=
groupIndex
;
container
.
active
(
true
)
container
.
active
(
true
)
}
else
{
}
else
{
container
.
switchStatus
(
"
wrong
"
);
container
.
switchStatus
(
"
wrong
"
);
...
@@ -683,7 +684,8 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -683,7 +684,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
}
else
{
}
else
{
container
.
isCorrect
=
true
;
container
.
isCorrect
=
true
;
if
(
this
.
m_currentInputIndex
==
groupIndex
)
{
console
.
log
(
this
.
m_currentQuestionIndex
+
"
-
"
+
groupIndex
)
if
(
this
.
m_currentQuestionIndex
==
groupIndex
)
{
container
.
switchStatus
(
"
right
"
)
container
.
switchStatus
(
"
right
"
)
}
else
{
}
else
{
container
.
switchStatus
(
"
disable
"
)
container
.
switchStatus
(
"
disable
"
)
...
@@ -870,7 +872,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -870,7 +872,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
checkMiddle
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_middle`
,
"
check_middle
"
,
(
w
,
h
)
=>
{
let
checkMiddle
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_middle`
,
"
check_middle
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
1
*
bgMiddle
.
ref
.
scaleX
,
sx
:
1
,
sy
:
1
,
sy
:
1
,
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
...
@@ -883,7 +885,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -883,7 +885,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
checkTop
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_top`
,
"
check_top
"
,
(
w
,
h
)
=>
{
let
checkTop
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_top`
,
"
check_top
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
1
*
bgMiddleMask
.
ref
.
scaleX
,
sx
:
1
,
sy
:
186
/
h
,
sy
:
186
/
h
,
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
...
@@ -896,7 +898,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -896,7 +898,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
checkBottom
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_bottom`
,
"
check_bottom
"
,
(
w
,
h
)
=>
{
let
checkBottom
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
`checkpannel_checnk_bottom`
,
"
check_bottom
"
,
(
w
,
h
)
=>
{
return
{
return
{
sx
:
1
*
bgMiddleMask
.
ref
.
scaleX
,
sx
:
1
,
sy
:
79
/
h
,
sy
:
79
/
h
,
}
}
},
(
w
,
h
)
=>
{
},
(
w
,
h
)
=>
{
...
@@ -958,7 +960,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -958,7 +960,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if
(
progress
>
1
)
{
if
(
progress
>
1
)
{
progress
=
1
progress
=
1
}
}
this
.
g_cartoon
.
getCartoonElement
(
"
slider-background
"
).
initSlider
(
scrollContent
.
windowHeight
,
985
*
5
,
progress
)
this
.
g_cartoon
.
getCartoonElement
(
"
slider-background
"
).
initSlider
(
scrollContent
.
windowHeight
,
this
.
m_totalScrollHeight
,
progress
)
},
()
=>
{
},
()
=>
{
this
.
g_enableMapUp
=
true
;
this
.
g_enableMapUp
=
true
;
this
.
g_enableMapDown
=
true
;
this
.
g_enableMapDown
=
true
;
...
@@ -1164,7 +1166,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1164,7 +1166,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
showCheckPannel
(
checkResult
)
{
showCheckPannel
(
checkResult
)
{
let
lastY
=
0
const
creatItem
=
(
height
,
withSplit
,
data
)
=>
{
const
creatItem
=
(
height
,
withSplit
,
data
)
=>
{
let
padding
=
30
;
let
scrollContent
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
let
scrollContent
=
this
.
g_cartoon
.
getCartoonElement
(
"
check_scroll_pannel
"
)
let
totalHeight
=
height
let
totalHeight
=
height
let
text
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text
"
,
data
.
text
,
"
DroidSansFallback
"
,
"
#FFFFFF
"
,
48
)
let
text
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text
"
,
data
.
text
,
"
DroidSansFallback
"
,
"
#FFFFFF
"
,
48
)
...
@@ -1174,13 +1178,17 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1174,13 +1178,17 @@ export class PlayComponent implements OnInit, OnDestroy {
text
.
ref
.
refreshSize
();
text
.
ref
.
refreshSize
();
text
.
ref
.
x
=
0
text
.
ref
.
x
=
0
text
.
ref
.
baseY
=
totalHeight
text
.
ref
.
baseY
=
totalHeight
console
.
log
(
"
=====================
"
)
console
.
log
(
"
文字高度
"
,
(
text
.
ref
.
lineNum
+
1
)
*
64
)
totalHeight
+=
(
text
.
ref
.
lineNum
+
1
)
*
64
;
totalHeight
+=
(
text
.
ref
.
lineNum
+
1
)
*
64
;
scrollContent
.
ref
.
addChild
(
text
.
ref
)
scrollContent
.
ref
.
addChild
(
text
.
ref
)
let
wordColorBG
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
"
eeeeee
"
,
360
,
64
,
data
.
right
?
"
#007b3e
"
:
"
#d71818
"
);
let
wordColorBG
=
this
.
g_cartoon
.
createCartoonElementShapeRect
(
"
eeeeee
"
,
360
,
64
,
data
.
right
?
"
#007b3e
"
:
"
#d71818
"
);
wordColorBG
.
ref
.
radius
=
10
wordColorBG
.
ref
.
radius
=
10
wordColorBG
.
ref
.
y
=
totalHeight
+
64
wordColorBG
.
ref
.
y
=
totalHeight
+
padding
+
64
/
2
totalHeight
+=
64
*
2
;
totalHeight
+=
padding
+
64
;
console
.
log
(
"
单词高度
"
,
64
)
lastY
=
totalHeight
+
padding
+
64
/
2
;
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
word
,
"
DroidSansFallback
"
,
"
#FFFFFF
"
,
44
)
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
word
,
"
DroidSansFallback
"
,
"
#FFFFFF
"
,
44
)
word
.
ref
.
x
=
360
/
2
word
.
ref
.
x
=
360
/
2
...
@@ -1200,7 +1208,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1200,7 +1208,9 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
totalHeight
+
50
+
60
y
:
totalHeight
+
50
+
60
}
}
})
})
totalHeight
+=
150
;
console
.
log
(
"
正确提示
"
,
120
)
lastY
=
totalHeight
+
50
+
60
totalHeight
+=
120
+
padding
;
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
rightWord
,
"
DroidSansFallback
"
,
"
#ffe9b1
"
,
44
)
let
word
=
this
.
g_cartoon
.
createCartoonElementLabel
(
"
text-label
"
,
data
.
rightWord
,
"
DroidSansFallback
"
,
"
#ffe9b1
"
,
44
)
word
.
ref
.
x
=
0
word
.
ref
.
x
=
0
...
@@ -1222,10 +1232,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1222,10 +1232,9 @@ export class PlayComponent implements OnInit, OnDestroy {
y
:
totalHeight
+
50
y
:
totalHeight
+
50
}
}
})
})
totalHeight
+=
6
0
;
totalHeight
+=
padding
+
1
0
;
scrollContent
.
ref
.
addChild
(
splitLine
.
ref
);
scrollContent
.
ref
.
addChild
(
splitLine
.
ref
);
}
}
totalHeight
+=
20
;
return
totalHeight
return
totalHeight
}
}
...
@@ -1235,12 +1244,15 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1235,12 +1244,15 @@ export class PlayComponent implements OnInit, OnDestroy {
let
totalHeight
=
0
;
let
totalHeight
=
0
;
let
totalNum
=
checkResult
.
length
;
let
totalNum
=
checkResult
.
length
;
lastY
=
0
checkResult
.
forEach
((
element
,
index
)
=>
{
checkResult
.
forEach
((
element
,
index
)
=>
{
totalHeight
=
creatItem
(
totalHeight
,
!
(
index
==
(
totalNum
-
1
)),
element
)
totalHeight
=
creatItem
(
totalHeight
,
!
(
index
==
(
totalNum
-
1
)),
element
)
});
});
sliderBG
.
initSlider
(
scrollContent
.
windowHeight
,
985
*
5
,
0
)
let
checkPannel
=
this
.
g_cartoon
.
getCartoonElement
(
"
checkpannel_container
"
);
let
checkPannel
=
this
.
g_cartoon
.
getCartoonElement
(
"
checkpannel_container
"
);
this
.
m_totalScrollHeight
=
lastY
;
console
.
log
(
totalHeight
)
sliderBG
.
initSlider
(
scrollContent
.
windowHeight
,
lastY
*
checkPannel
.
ref
.
scaleY
,
0
)
checkPannel
.
in
()
checkPannel
.
in
()
}
}
...
@@ -1270,32 +1282,18 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1270,32 +1282,18 @@ export class PlayComponent implements OnInit, OnDestroy {
const
handleSubmit
=
async
()
=>
{
const
handleSubmit
=
async
()
=>
{
this
.
m_submitedTimes
++
;
this
.
m_submitedTimes
++
;
if
(
this
.
m_submitedTimes
>=
2
)
{
let
qp
=
this
.
g_cartoon
.
getCartoonElement
(
"
question_container
"
)
let
keyboard
=
this
.
g_cartoon
.
getCartoonElement
(
"
keyboard_container
"
)
await
qp
.
out
()
await
keyboard
.
out
()
await
this
.
showCheckPannel
([
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
true
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
},
{
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
}
])
this
.
g_cartoon
.
getCartoonElement
(
"
background_mask
"
).
ref
.
alpha
=
0
this
.
g_enableMapDown
=
true
;
}
this
.
m_currentInputIndex
=
0
;
this
.
m_currentInputIndex
=
0
;
let
hasIncorrect
=
false
;
let
result
=
[]
;
let
status
=
false
;
let
status
=
false
;
let
hasIncorrect
=
false
;
this
.
m_hasActiveBlock
=
false
;
this
.
m_hasActiveBlock
=
false
;
this
.
m_blockGroup
.
forEach
((
group
,
index
)
=>
{
this
.
m_blockGroup
.
forEach
((
group
,
index
)
=>
{
status
=
this
.
updateStatusByGroupIndex
(
index
)
status
=
this
.
updateStatusByGroupIndex
(
index
)
if
(
status
)
{
result
.
push
({
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
true
,
rightWord
:
""
})
}
else
{
result
.
push
({
text
:
"
Across 1. running water flowing on the Earth
"
,
word
:
"
storfish
"
,
right
:
false
,
rightWord
:
"
Sea house
"
})
}
if
(
!
hasIncorrect
&&
!
status
)
{
if
(
!
hasIncorrect
&&
!
status
)
{
hasIncorrect
=
true
;
hasIncorrect
=
true
;
}
}
...
@@ -1305,6 +1303,17 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -1305,6 +1303,17 @@ export class PlayComponent implements OnInit, OnDestroy {
}
else
{
}
else
{
console
.
log
(
"
全部正确
"
)
console
.
log
(
"
全部正确
"
)
}
}
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
"
)
await
qp
.
out
()
await
keyboard
.
out
()
await
this
.
showCheckPannel
(
result
)
this
.
g_cartoon
.
getCartoonElement
(
"
background_mask
"
).
ref
.
alpha
=
0
this
.
g_enableMapDown
=
true
;
}
// console.log(status)
// console.log(status)
// this.switchQuestion(this.m_currentQuestionIndex, this.m_currentQuestionIndex+1)
// this.switchQuestion(this.m_currentQuestionIndex, this.m_currentQuestionIndex+1)
submit
.
switchActive
(
false
)
submit
.
switchActive
(
false
)
...
...
src/app/play/resources.js
View file @
29a3ae94
...
@@ -46,7 +46,7 @@ const localImages = {
...
@@ -46,7 +46,7 @@ const localImages = {
'
btn_shift_shadow
'
:
'
assets/play/btn_shift_shadow.png
'
,
'
btn_shift_shadow
'
:
'
assets/play/btn_shift_shadow.png
'
,
'
bg_block_right
'
:
'
assets/play/bg_block_right.png
'
,
'
bg_block_right
'
:
'
assets/play/bg_block_right.png
'
,
'
bg_
check_midd
le
'
:
'
assets/play/bg_block_right_disable.png
'
,
'
bg_
block_disab
le
'
:
'
assets/play/bg_block_right_disable.png
'
,
'
bg_block_init
'
:
'
assets/play/bg_block_init.png
'
,
'
bg_block_init
'
:
'
assets/play/bg_block_init.png
'
,
'
bg_block_focus
'
:
'
assets/play/bg_block_focus.png
'
,
'
bg_block_focus
'
:
'
assets/play/bg_block_focus.png
'
,
'
bg_block_wrong
'
:
'
assets/play/bg_block_wrong.png
'
,
'
bg_block_wrong
'
:
'
assets/play/bg_block_wrong.png
'
,
...
...
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