Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy02_paopao
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
hy02_paopao
Commits
9b36cd63
Commit
9b36cd63
authored
Sep 19, 2023
by
WUYING\505623963_1041864935
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/hy02_paopao
parents
e5094dc0
68d17217
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
6 deletions
+49
-6
LayerRecord_hy02_paopao.ts
assets/hy02_paopao/common/script/LayerRecord_hy02_paopao.ts
+1
-0
hy02_paopao.ts
assets/hy02_paopao/scene/hy02_paopao.ts
+25
-4
pg_hy02_paopao.ts
assets/hy02_paopao/scene/tool/pg_hy02_paopao.ts
+7
-0
form.component.html
form/src/app/form/form.component.html
+10
-2
form.component.ts
form/src/app/form/form.component.ts
+6
-0
No files found.
assets/hy02_paopao/common/script/LayerRecord_hy02_paopao.ts
View file @
9b36cd63
...
...
@@ -193,6 +193,7 @@ export default class LayerRecord extends cc.Component {
});
//结束录音
}
async
recrodEnd
(
data
)
{
pg
.
hw
.
addRecord
(
data
)
this
.
recordAudio
=
data
.
audioUrl
;
this
.
showPlay
();
let
score
=
data
.
result
.
overall
;
...
...
assets/hy02_paopao/scene/hy02_paopao.ts
View file @
9b36cd63
...
...
@@ -105,15 +105,36 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
sendData
(
score
)
{
return
new
Promise
(
res
=>
{
let
upData
:
any
=
{
word_count
:
this
.
data
.
word_count
||
0
,
sentence_count
:
this
.
data
.
sentence_count
||
0
,
zi_count
:
this
.
data
.
zi_count
||
0
,
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
gameOver
()
{
// pg.event.emit("layer_ending_show", { coin: Game.getIns().len * 3 });
const
midd
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
midd
)
return
this
.
log
(
"
no middleLayer
"
);
this
.
sendData
(
Game
.
getIns
().
len
*
3
).
then
(()
=>
{
})
this
.
scheduleOnce
(()
=>
{
let
middleLayer
=
midd
.
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
Game
.
getIns
().
len
*
3
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
},
0.1
)
}
...
...
assets/hy02_paopao/scene/tool/pg_hy02_paopao.ts
View file @
9b36cd63
...
...
@@ -625,6 +625,13 @@ let pg = {
}
},
hw
:
{
records
:
[],
addRecord
(
data
)
{
pg
.
hw
.
records
.
push
(
data
)
},
getRecord
()
{
return
pg
.
hw
.
records
.
concat
();
},
playLocalAudio
(
audioName
,
loop
=
false
)
{
console
.
log
(
"
play audio->
"
+
audioName
);
const
audio
=
cc
.
find
(
`Canvas/res/audio/
${
audioName
}
`
).
getComponent
(
cc
.
AudioSource
);
...
...
form/src/app/form/form.component.html
View file @
9b36cd63
...
...
@@ -90,6 +90,14 @@
<span>
{{ item.npcAudioName}}
</span>
</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>
...
...
@@ -235,8 +243,8 @@
</div>
<div
class=
"option-btns"
>
<button
class=
"btn-red"
nz-button
nzType=
"default"
nzDanger
(
click
)="
removeoption
(
i
,
j
)"
>
删除选项
</button>
<button
*
ngIf=
"question.options.length < 3"
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
copyoption
(
i
,
j
)"
>
复制选项
</button>
<button
*
ngIf=
"question.options.length < 3"
class=
"btn-blue"
style=
"margin-top: 10px;"
nz-button
nzType=
"default"
nzDanger
(
click
)="
copyoption
(
i
,
j
)"
>
复制选项
</button>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
9b36cd63
...
...
@@ -26,6 +26,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
audioName
:
""
,
title
:
"
泡泡选择
"
,
word_count
:
'
0
'
,
sentence_count
:
'
0
'
,
zi_count
:
'
0
'
,
questions
:
[],
};
...
...
@@ -48,6 +51,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
if
(
!
this
.
item
.
npcTitle
)
this
.
item
.
npcTitle
=
''
;
if
(
!
this
.
item
.
npcAudio
)
this
.
item
.
npcAudio
=
''
;
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
'
;
console
.
log
(
new
MetaFormCreator
().
create
());
}
...
...
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