Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy07_tiankong
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
hy07_tiankong
Commits
301ecf41
Commit
301ecf41
authored
Sep 08, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加plus
parent
004c7d01
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
0 deletions
+45
-0
LayerRecord_hy07_tiankong.ts
.../hy07_tiankong/common/script/LayerRecord_hy07_tiankong.ts
+1
-0
hy07_tiankong.ts
assets/hy07_tiankong/scene/hy07_tiankong.ts
+22
-0
pg_hy07_tiankong.ts
assets/hy07_tiankong/scene/tool/pg_hy07_tiankong.ts
+7
-0
form.component.html
form/src/app/form/form.component.html
+8
-0
form.component.ts
form/src/app/form/form.component.ts
+7
-0
No files found.
assets/hy07_tiankong/common/script/LayerRecord_hy07_tiankong.ts
View file @
301ecf41
...
@@ -193,6 +193,7 @@ export default class LayerRecord extends cc.Component {
...
@@ -193,6 +193,7 @@ export default class LayerRecord extends cc.Component {
});
//结束录音
});
//结束录音
}
}
async
recrodEnd
(
data
)
{
async
recrodEnd
(
data
)
{
pg
.
hw
.
addRecord
(
data
)
this
.
recordAudio
=
data
.
audioUrl
;
this
.
recordAudio
=
data
.
audioUrl
;
this
.
showPlay
();
this
.
showPlay
();
let
score
=
data
.
result
.
overall
;
let
score
=
data
.
result
.
overall
;
...
...
assets/hy07_tiankong/scene/hy07_tiankong.ts
View file @
301ecf41
...
@@ -135,6 +135,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -135,6 +135,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
midd
=
cc
.
find
(
'
middleLayer
'
);
const
midd
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
midd
)
return
this
.
log
(
"
no middleLayer
"
);
if
(
!
midd
)
return
this
.
log
(
"
no middleLayer
"
);
let
middleLayer
=
midd
.
getComponent
(
'
middleLayer
'
);
let
middleLayer
=
midd
.
getComponent
(
'
middleLayer
'
);
this
.
sendData
(
this
.
coin
)
middleLayer
.
saveGolds
(
this
.
coin
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
saveGolds
(
this
.
coin
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
middleLayer
.
goNextPage
();
// 跳转到下一页
}
else
{
}
else
{
...
@@ -148,6 +149,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -148,6 +149,27 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
pic_light
)
pic_light
.
active
=
false
;
if
(
pic_light
)
pic_light
.
active
=
false
;
});
});
}
}
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
(
''
);
})
})
}
replay
()
{
replay
()
{
this
.
initData
();
this
.
initData
();
this
.
initView
();
this
.
initView
();
...
...
assets/hy07_tiankong/scene/tool/pg_hy07_tiankong.ts
View file @
301ecf41
...
@@ -613,6 +613,13 @@ let pg = {
...
@@ -613,6 +613,13 @@ 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 @
301ecf41
...
@@ -89,6 +89,14 @@
...
@@ -89,6 +89,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>
</div>
<!-- 题目区 -->
<!-- 题目区 -->
...
...
form/src/app/form/form.component.ts
View file @
301ecf41
...
@@ -19,6 +19,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -19,6 +19,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
npcAudioName
:
''
,
npcAudioName
:
''
,
// score: 0,
// score: 0,
title
:
'
07填空
'
,
title
:
'
07填空
'
,
word_count
:
'
0
'
,
sentence_count
:
'
0
'
,
zi_count
:
'
0
'
,
// questionText: "彩蛋里藏了哪些魔法卡牌呢?亲爱的小玩家,快用锤子砸开彩蛋,魔法卡牌就会露出来,只要正确地说出魔法咒语,你就能获得这张魔法卡牌。 游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
// questionText: "彩蛋里藏了哪些魔法卡牌呢?亲爱的小玩家,快用锤子砸开彩蛋,魔法卡牌就会露出来,只要正确地说出魔法咒语,你就能获得这张魔法卡牌。 游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
// questionTextAudio: "http://staging-teach.cdn.ireadabc.com/61b41f87fffc8390a519668fece764d3_l.mp3",
// questionTextAudio: "http://staging-teach.cdn.ireadabc.com/61b41f87fffc8390a519668fece764d3_l.mp3",
questions
:
[],
questions
:
[],
...
@@ -28,6 +31,10 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -28,6 +31,10 @@ 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
'
;
}
}
isVisible
=
false
;
isVisible
=
false
;
deleteTitle
=
"
是否删除题目
"
;
deleteTitle
=
"
是否删除题目
"
;
...
...
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