Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
comparetree
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
comparetree
Commits
ffd47509
Commit
ffd47509
authored
Jun 16, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加音效
parent
b3a11f82
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
561 additions
and
228 deletions
+561
-228
form.component.html
form/src/app/form/form.component.html
+26
-4
form.component.ts
form/src/app/form/form.component.ts
+6
-5
MMTextBookBold.ttf
play/assets/scene/fonts/MMTextBookBold.ttf
+0
-0
data.js
play/assets/scene/scene/data.js
+3
-0
gameManager.js
play/assets/scene/scene/gameManager.js
+5
-4
scene.fire
play/assets/scene/scene/scene.fire
+509
-215
scene.js
play/assets/scene/scene/scene.js
+12
-0
No files found.
form/src/app/form/form.component.html
View file @
ffd47509
...
...
@@ -5,7 +5,14 @@
<div
style=
"width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;"
>
<span
style=
"font-weight: 700; font-size: 30px; vertical-align:middle;"
>
标题:
</span>
<input
(
blur
)="
saveItem
()"
[(
ngModel
)]="
biaoti
.
title
"
type=
"text"
style=
"width: 1000px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
style=
"width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<app-audio-recorder
[
audioUrl
]="
biaoti
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
biaoti
)"
>
</app-audio-recorder>
</div>
</div>
</div>
...
...
@@ -17,7 +24,12 @@
<div
style=
"width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;"
>
<span
style=
"font-weight: 700; font-size: 30px; vertical-align:middle;"
>
主类:
</span>
<input
(
blur
)="
saveItem
()"
[(
ngModel
)]="
zhulei
.
title
"
type=
"text"
style=
"width: 1000px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
style=
"width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<app-audio-recorder
[
audioUrl
]="
zhulei
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
zhulei
)"
>
</app-audio-recorder>
</div>
</div>
</div>
...
...
@@ -29,7 +41,12 @@
<div
style=
"width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;"
>
<span
style=
"font-weight: 700; font-size: 30px; vertical-align:middle;"
>
分类{{c+1}}:
</span>
<input
(
blur
)="
saveItem
()"
[(
ngModel
)]="
fenlei
.
title
"
type=
"text"
style=
"width: 1000px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
style=
"width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<app-audio-recorder
[
audioUrl
]="
fenlei
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
fenlei
)"
>
</app-audio-recorder>
</div>
</div>
</div>
...
...
@@ -45,7 +62,12 @@
<span>
删除
</span>
</button>
<input
(
blur
)="
saveItem
()"
[(
ngModel
)]="
sonlei
.
title
"
type=
"text"
style=
"width: 1000px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
style=
"width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;"
/>
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<app-audio-recorder
[
audioUrl
]="
sonlei
.
audio_url
"
(
audioUploaded
)="
onAudioUploadSuccessByItem
($
event
,
sonlei
)"
>
</app-audio-recorder>
</div>
</div>
</div>
...
...
form/src/app/form/form.component.ts
View file @
ffd47509
...
...
@@ -90,11 +90,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
getDefaultPicArr
()
{
let
arr
=
[];
let
biaoti
=
{
title
:
""
,
child
:
[]
};
let
zhulei
=
{
title
:
""
,
child
:
[]
};
let
biaoti
=
{
title
:
""
,
child
:
[]
,
audio_url
:
""
};
let
zhulei
=
{
title
:
""
,
child
:
[]
,
audio_url
:
""
};
for
(
let
m
=
0
;
m
<
2
;
m
++
)
{
let
fenlei
=
{
title
:
""
,
child
:
[]
};
let
sonlei
=
{
title
:
""
,
child
:
[]
};
let
fenlei
=
{
title
:
""
,
child
:
[]
,
audio_url
:
""
};
let
sonlei
=
{
title
:
""
,
child
:
[]
,
audio_url
:
""
};
let
item
=
this
.
cardItemData
();
sonlei
.
child
.
push
(
item
);
fenlei
.
child
.
push
(
sonlei
);
...
...
@@ -145,7 +145,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if
(
length
<
6
)
{
let
cla
=
{
title
:
""
,
child
:
[]
child
:
[],
audio_url
:
""
};
for
(
let
i
=
0
;
i
<
1
;
i
++
)
{
let
item
=
this
.
cardItemData
();
...
...
play/assets/scene/fonts/MMTextBookBold.ttf
View file @
ffd47509
No preview for this file type
play/assets/scene/scene/data.js
View file @
ffd47509
...
...
@@ -47,6 +47,9 @@ function retData() {
}
}
// let item = { "contentObj": { "picArr": [{ "title": "fff", "child": [{ "title": "ddd", "child": [{ "title": "aaa", "child": [{ "title": "fff", "child": [{ "cardId": "", "title": "1", "pic_url": "http://staging-teach.cdn.ireadabc.com/88b1cd55a3e2ff70447331078c0e2941.png", "audio_url": "" }] }] }, { "title": "bbb", "child": [{ "title": "ee", "child": [{ "cardId": "", "title": "2", "pic_url": "http://staging-teach.cdn.ireadabc.com/fde35aaec618529b0b2b6cb3a18d1f85.png", "audio_url": "" }] }] }] }] }] } }
item
=
{
"
contentObj
"
:
{
"
picArr
"
:
[{
"
title
"
:
"
title
"
,
"
child
"
:
[{
"
title
"
:
"
main
"
,
"
child
"
:
[{
"
title
"
:
"
sub1
"
,
"
child
"
:
[{
"
title
"
:
"
son1
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
a
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/a6f90512ef5ce6fed55599cc367ba8aa.png
"
,
"
audio_url
"
:
""
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/784cd4188bf126d6c3c9395d9a807619.mp3
"
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
},
{
"
title
"
:
"
sub2
"
,
"
child
"
:
[{
"
title
"
:
"
son21
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q1
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/fde35aaec618529b0b2b6cb3a18d1f85.png
"
,
"
audio_url
"
:
""
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/784cd4188bf126d6c3c9395d9a807619.mp3
"
},
{
"
title
"
:
"
son22
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q2
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/756083716a8ab9f2b6b66331e659845d.png
"
,
"
audio_url
"
:
""
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
},
{
"
title
"
:
"
son23
"
,
"
child
"
:
[{
"
cardId
"
:
""
,
"
title
"
:
"
q4
"
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/b0f3c1a415015b254692a5d536b5b3fa.png
"
,
"
audio_url
"
:
""
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/0b42398a12e1b2f075e9965e4d608765.mp3
"
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/784cd4188bf126d6c3c9395d9a807619.mp3
"
}],
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3
"
}]
}
};
return
item
;
}
export
const
itemData
=
retData
();
\ No newline at end of file
play/assets/scene/scene/gameManager.js
View file @
ffd47509
...
...
@@ -8,8 +8,9 @@ class Card {
}
}
class
defClass
{
constructor
(
id
,
title
,
type
)
{
constructor
(
id
,
title
,
audio_url
,
type
)
{
this
.
id
=
id
;
this
.
audio_url
=
audio_url
;
this
.
type
=
type
;
this
.
title
=
title
;
this
.
child
=
[];
...
...
@@ -67,15 +68,15 @@ class GameManager {
this
.
_title
=
obj
[
0
];
for
(
let
i
=
0
;
i
<
obj
[
0
].
child
.
length
;
i
++
)
{
let
zhulei
=
obj
[
0
].
child
[
i
];
let
zhuleiClass
=
new
defClass
(
zhulei
.
id
,
zhulei
.
title
,
0
);
let
zhuleiClass
=
new
defClass
(
zhulei
.
id
,
zhulei
.
title
,
zhulei
.
audio_url
,
0
);
for
(
let
a
=
0
;
a
<
zhulei
.
child
.
length
;
a
++
)
{
let
fenlei
=
zhulei
.
child
[
a
];
let
fenleiClass
=
new
defClass
(
fenId
,
fenlei
.
title
,
0
);
let
fenleiClass
=
new
defClass
(
fenId
,
fenlei
.
title
,
fenlei
.
audio_url
,
0
);
fenId
++
;
//只有1和2
for
(
let
b
=
0
;
b
<
fenlei
.
child
.
length
;
b
++
)
{
sonId
++
;
let
sonlei
=
fenlei
.
child
[
b
];
let
sonleiClass
=
new
defClass
(
sonId
,
sonlei
.
title
,
a
);
let
sonleiClass
=
new
defClass
(
sonId
,
sonlei
.
title
,
sonlei
.
audio_url
,
a
);
for
(
let
c
=
0
;
c
<
sonlei
.
child
.
length
;
c
++
)
{
let
card
=
sonlei
.
child
[
c
];
cardId
++
;
...
...
play/assets/scene/scene/scene.fire
View file @
ffd47509
This diff is collapsed.
Click to expand it.
play/assets/scene/scene/scene.js
View file @
ffd47509
...
...
@@ -187,9 +187,15 @@ cc.Class({
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
"
title/txt
"
),
this
.
_title
);
//刷新主类
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
"
main/main/txt
"
),
this
.
_zhuClass
.
title
);
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
"
main/main
"
),
this
.
onTouchVoice
,
this
);
pg
.
view
.
find
(
this
,
"
main/main
"
).
data
=
this
.
_zhuClass
;
//刷新分类
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
"
main/sub_0/txt
"
),
this
.
_zhuClass
.
child
[
0
].
title
);
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
"
main/sub_1/txt
"
),
this
.
_zhuClass
.
child
[
1
].
title
);
pg
.
view
.
find
(
this
,
"
main/sub_0
"
).
data
=
this
.
_zhuClass
.
child
[
0
];
pg
.
view
.
find
(
this
,
"
main/sub_1
"
).
data
=
this
.
_zhuClass
.
child
[
1
];
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
"
main/sub_0
"
),
this
.
onTouchVoice
,
this
);
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
"
main/sub_1
"
),
this
.
onTouchVoice
,
this
);
setTimeout
(()
=>
{
this
.
fixTxtSize
([
pg
.
view
.
find
(
this
,
"
main/sub_0/txt
"
),
pg
.
view
.
find
(
this
,
"
main/sub_1/txt
"
)])
},
30
);
...
...
@@ -256,6 +262,7 @@ cc.Class({
txtArr
.
push
(
pg
.
view
.
find
(
itemClone
,
'
txt
'
));
pg
.
view
.
visible
(
pg
.
view
.
find
(
itemClone
,
"
bg_blue
"
),
data
.
type
==
0
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
itemClone
,
"
bg_green
"
),
data
.
type
==
1
);
pg
.
view
.
touchOn
(
itemClone
,
this
.
onTouchVoice
,
this
);
parent
.
addChild
(
itemClone
);
}
setTimeout
(()
=>
{
...
...
@@ -662,6 +669,11 @@ cc.Class({
};
}
},
//
onTouchVoice
(
touch
)
{
let
item
=
touch
.
target
;
pg
.
audio
.
playAudioByUrl
(
item
.
data
.
audio_url
);
},
//回合结束
groupEnd
()
{
for
(
let
i
=
0
;
i
<
this
.
_boxItems
.
length
;
i
++
)
{
...
...
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