Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
ww_spelling
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
ww_spelling
Commits
36781dfe
Commit
36781dfe
authored
Jan 19, 2021
by
Li MingZhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加下一题按钮
parent
01f5a1a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
19 deletions
+41
-19
play.component.html
src/app/play/play.component.html
+7
-0
play.component.ts
src/app/play/play.component.ts
+34
-19
btn_next.png
src/assets/spelling/btn_next.png
+0
-0
No files found.
src/app/play/play.component.html
View file @
36781dfe
...
...
@@ -48,7 +48,14 @@
<div
*
ngFor=
"let item of letter;"
(
click
)="
add
(
item
)"
>
<p>
{{item}}
</p>
</div>
</div>
<div
*
ngIf=
"isShowNextBtn"
style=
"position: absolute; bottom: 5%; right: 5%"
(
click
)="
enterNext
()"
>
<img
src=
"assets/spelling/btn_next.png"
style=
"cursor: pointer; height: 12vh; width: auto"
>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/app/play/play.component.ts
View file @
36781dfe
...
...
@@ -12,7 +12,7 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
// 数据
data
;
saveKey
=
'
spelling
'
;
isShowNextBtn
=
false
;
letter
:
any
[];
blankindex
=
[];
...
...
@@ -154,28 +154,16 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
truenum
++
;
}
});
if
(
truenum
===
this
.
blankindex
.
length
)
{
const
step
=
this
.
leaf
[
this
.
num
].
offsetLeft
+
this
.
leaf
[
this
.
num
].
clientWidth
/
2
-
this
.
monkey
.
clientWidth
/
2
+
this
.
left
;
this
.
monkey
.
style
.
left
=
step
.
toString
()
+
'
px
'
;
this
.
rightAudio
.
play
();
if
(
this
.
num
+
1
>=
this
.
wordnum
.
length
)
{
setTimeout
(()
=>
{
this
.
blankindex
.
forEach
((
value
)
=>
{
this
.
words
[
value
].
istrue
=
false
;
for
(
let
s
=
0
;
s
<
this
.
wordnum
.
length
;
s
++
)
{
this
.
otherwordnum
[
s
].
rigof
=
false
;
}
});
},
1500
);
this
.
indexnum
=
0
;
}
else
{
setTimeout
(()
=>
{
this
.
num
++
;
this
.
indexnum
=
0
;
this
.
blankindex
.
length
=
0
;
this
.
load
();
this
.
otherwordnum
[
this
.
num
-
1
].
rigof
=
false
;
},
1500
);
if
(
this
.
num
+
1
<
this
.
wordnum
.
length
)
{
this
.
isShowNextBtn
=
true
;
}
}
this
.
index
=
this
.
blankindex
[
this
.
indexnum
];
...
...
@@ -184,6 +172,33 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this
.
refresh
();
}
enterNext
()
{
this
.
isShowNextBtn
=
false
;
console
.
log
(
'
in enterNext
'
);
if
(
this
.
num
+
1
>=
this
.
wordnum
.
length
)
{
setTimeout
(()
=>
{
this
.
blankindex
.
forEach
((
value
)
=>
{
this
.
words
[
value
].
istrue
=
false
;
for
(
let
s
=
0
;
s
<
this
.
wordnum
.
length
;
s
++
)
{
this
.
otherwordnum
[
s
].
rigof
=
false
;
}
});
},
0
);
this
.
indexnum
=
0
;
}
else
{
setTimeout
(()
=>
{
this
.
num
++
;
this
.
indexnum
=
0
;
this
.
blankindex
.
length
=
0
;
this
.
load
();
this
.
otherwordnum
[
this
.
num
-
1
].
rigof
=
false
;
},
0
);
}
}
playSpellingAudio
()
{
if
(
this
.
data
.
contentObj
&&
this
.
data
.
contentObj
.
wordnum
[
this
.
num
].
spelling_audio
)
{
this
.
Spelling_audio
.
src
=
this
.
data
.
contentObj
.
wordnum
[
this
.
num
].
spelling_audio
;
...
...
src/assets/spelling/btn_next.png
0 → 100644
View file @
36781dfe
5.8 KB
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