Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy08_caici
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
hy08_caici
Commits
78ffe85c
Commit
78ffe85c
authored
Sep 07, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据上传
parent
7f1f8c8e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
0 deletions
+44
-0
hy08_caici.ts
assets/hy08_caici/scene/hy08_caici.ts
+21
-0
pg_hy08_caici.ts
assets/hy08_caici/scene/pg_hy08_caici.ts
+8
-0
form.component.html
form/src/app/form/form.component.html
+9
-0
form.component.ts
form/src/app/form/form.component.ts
+6
-0
No files found.
assets/hy08_caici/scene/hy08_caici.ts
View file @
78ffe85c
...
@@ -119,11 +119,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -119,11 +119,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
startQuestion
();
this
.
startQuestion
();
}
}
sendData
(
score
)
{
return
new
Promise
(
res
=>
{
let
upData
:
any
=
{
word_count
:
this
.
data
.
word_count
,
sentence_count
:
this
.
data
.
sentence_count
,
zi_count
:
this
.
data
.
zi_count
,
score
:
score
,
};
let
recordList
=
pg
.
hw
.
getRecord
();
if
(
recordList
&&
recordList
.
length
>
0
)
{
upData
.
recordList
=
recordList
}
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
console
.
log
(
'
upload->
'
+
JSON
.
stringify
(
upData
))
middleLayer
.
onHomeworkFinish
(
upData
,
()
=>
{
res
(
''
);
})
})
}
private
score
:
number
;
private
score
:
number
;
gameOver
()
{
gameOver
()
{
this
.
state
=
State
.
Over
;
this
.
state
=
State
.
Over
;
this
.
showAni
().
then
((
coin
:
number
)
=>
{
this
.
showAni
().
then
((
coin
:
number
)
=>
{
this
.
score
=
coin
;
this
.
score
=
coin
;
this
.
sendData
(
this
.
score
).
then
(()
=>
{
})
pg
.
event
.
once
(
'
layer_coin_show_coin_end
'
,
()
=>
{
pg
.
event
.
once
(
'
layer_coin_show_coin_end
'
,
()
=>
{
this
.
onClose
();
this
.
onClose
();
})
// 动画回调
})
// 动画回调
...
...
assets/hy08_caici/scene/pg_hy08_caici.ts
View file @
78ffe85c
...
@@ -668,6 +668,14 @@ let pg = {
...
@@ -668,6 +668,14 @@ let pg = {
}
}
},
},
hw
:
{
hw
:
{
records
:
[],
addRecord
(
data
)
{
pg
.
hw
.
records
.
push
(
data
)
},
getRecord
()
{
return
pg
.
hw
.
records
.
concat
();
},
playLocalAudio
(
audioName
,
loop
=
false
)
{
playLocalAudio
(
audioName
,
loop
=
false
)
{
console
.
log
(
"
play audio->
"
+
audioName
);
console
.
log
(
"
play audio->
"
+
audioName
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
...
...
form/src/app/form/form.component.html
View file @
78ffe85c
...
@@ -90,6 +90,14 @@
...
@@ -90,6 +90,14 @@
<span>
{{ item.npcAudioName}}
</span>
<span>
{{ item.npcAudioName}}
</span>
</div>
</div>
</div>
</div>
<span
style=
"font-size: 20px;"
>
掌握单词数:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
word_count
"
(
blur
)="
save
()"
>
<span
style=
"font-size: 20px;"
>
掌握短语数:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
sentence_count
"
(
blur
)="
save
()"
>
<span
style=
"font-size: 20px;"
>
掌握字数:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
zi_count
"
(
blur
)="
save
()"
>
</div>
</div>
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<!-- <div class="border-dashed" style="margin: 20px;width: 1000px;">
<span style="font-size: 20px;">标题: </span>
<span style="font-size: 20px;">标题: </span>
...
@@ -150,6 +158,7 @@
...
@@ -150,6 +158,7 @@
<div
*
ngFor=
"let question of item.questions; let i = index"
>
<div
*
ngFor=
"let question of item.questions; let i = index"
>
<div
style=
"display: flex;margin-top: 20px;"
>
<div
style=
"display: flex;margin-top: 20px;"
>
<div
class=
"border-solid"
style=
"min-width: 1000px;"
>
<div
class=
"border-solid"
style=
"min-width: 1000px;"
>
<div
class=
"word-type-title"
>
<div
class=
"word-type-title"
>
题目:
题目:
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
78ffe85c
...
@@ -26,6 +26,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -26,6 +26,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}],
}],
bgAudio
:
""
,
bgAudio
:
""
,
bgAudioName
:
""
,
bgAudioName
:
""
,
word_count
:
'
0
'
,
sentence_count
:
'
0
'
,
zi_count
:
'
0
'
,
audioName
:
""
audioName
:
""
};
};
...
@@ -50,6 +53,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -50,6 +53,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
if
(
!
this
.
item
.
npcTitle
)
this
.
item
.
npcTitle
=
''
;
if
(
!
this
.
item
.
npcTitle
)
this
.
item
.
npcTitle
=
''
;
if
(
!
this
.
item
.
npcAudio
)
this
.
item
.
npcAudio
=
''
;
if
(
!
this
.
item
.
npcAudio
)
this
.
item
.
npcAudio
=
''
;
if
(
!
this
.
item
.
npcAudioName
)
this
.
item
.
npcAudioName
=
''
;
if
(
!
this
.
item
.
npcAudioName
)
this
.
item
.
npcAudioName
=
''
;
if
(
!
this
.
item
.
word_count
)
this
.
item
.
word_count
=
'
0
'
;
if
(
!
this
.
item
.
sentence_count
)
this
.
item
.
sentence_count
=
'
0
'
;
if
(
!
this
.
item
.
zi_count
)
this
.
item
.
zi_count
=
'
0
'
;
}
}
removeoption
(
i
,
j
)
{
removeoption
(
i
,
j
)
{
...
...
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