Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP_03_2
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
OP_03_2
Commits
0ad8a900
Commit
0ad8a900
authored
Dec 17, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整业务逻辑
parent
e6f0384c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
232 additions
and
19 deletions
+232
-19
form.component.html
form/src/app/form/form.component.html
+11
-5
OP_03_2.fire
play/assets/OP_03_2/scene/OP_03_2.fire
+69
-7
OP_03_2.js
play/assets/OP_03_2/scene/OP_03_2.js
+151
-7
defaultData.js
play/assets/OP_03_2/script/defaultData.js
+1
-0
No files found.
form/src/app/form/form.component.html
View file @
0ad8a900
...
...
@@ -16,7 +16,7 @@
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl1"
>
CC引导音频1
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl1"
>
开始音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
guideAudioUrl1
"
id=
"guideAudioUrl1"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl1
')"
>
...
...
@@ -24,23 +24,21 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl2"
>
CC引导音频2
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl2"
>
待机音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
guideAudioUrl2
"
id=
"guideAudioUrl2"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl2
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<!--
<nz-form-item>
<nz-form-label [nzSpan]="2" nzFor="guideAudioUrl3">
CC引导音频3
</nz-form-label>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"guideAudioUrl3"
>
结束音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
guideAudioUrl3
"
id=
"guideAudioUrl3"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
guideAudioUrl3
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
-->
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
>
图片
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
...
...
@@ -49,6 +47,14 @@
</app-upload-image-with-preview>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
>
图片音频
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
<app-audio-recorder
[
audioUrl
]="
item
.
audioUrl
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
item
,
'
audioUrl
')"
>
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
2
"
nzFor=
"add-btn"
>
字母添加
</nz-form-label>
<nz-form-control
[
nzSpan
]="
4
"
>
...
...
play/assets/OP_03_2/scene/OP_03_2.fire
View file @
0ad8a900
...
...
@@ -86,14 +86,14 @@
],
"_active": true,
"_components": [
{
"__id__": 67
},
{
"__id__": 68
},
{
"__id__": 69
},
{
"__id__": 70
}
],
"_prefab": null,
...
...
@@ -2825,7 +2825,7 @@
"_active": true,
"_components": [
{
"__id__": 6
6
"__id__": 6
7
}
],
"_prefab": null,
...
...
@@ -2891,7 +2891,7 @@
"_active": true,
"_components": [
{
"__id__": 6
5
"__id__": 6
6
}
],
"_prefab": null,
...
...
@@ -2949,11 +2949,15 @@
"_parent": {
"__id__": 62
},
"_children": [],
"_children": [
{
"__id__": 64
}
],
"_active": true,
"_components": [
{
"__id__": 6
4
"__id__": 6
5
}
],
"_prefab": null,
...
...
@@ -3004,6 +3008,64 @@
"groupIndex": 0,
"_id": "39olKLQahPUIkTaY3Gn6UZ"
},
{
"__type__": "cc.Node",
"_name": "ClickBtn",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 350,
"height": 480
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
900.811,
-518.548,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "85fMvCft1LxJiRiRsEWxOy"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
...
...
play/assets/OP_03_2/scene/OP_03_2.js
View file @
0ad8a900
...
...
@@ -123,6 +123,7 @@ cc.Class({
this
.
_audioResList
.
push
({
url
:
this
.
data
.
guideAudioUrl1
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
guideAudioUrl2
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
guideAudioUrl3
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
audioUrl
});
}
...
...
@@ -213,11 +214,13 @@ cc.Class({
handNode
.
initY
=
handNode
.
y
;
this
.
_cantouch
=
false
;
//播放动车
this
.
playAni
(
'
begin
'
,
0
);
const
begin
=
()
=>
{
this
.
playAni
(
'
normal
'
,
0
);
this
.
playAni
(
'
begin
'
,
0
);
this
.
_cantouch
=
true
;
...
...
@@ -306,6 +309,7 @@ cc.Class({
},
_curIndex
:
null
,
_canClickWord
:
null
,
initPic
()
{
let
exercises
=
this
.
data
.
exercises
;
...
...
@@ -339,6 +343,34 @@ cc.Class({
let
label
=
this
.
getWord
(
initial
,
700
,
true
);
label
.
isInitial
=
true
;
wordNodeArr
.
push
(
label
);
label
.
addComponent
(
cc
.
Button
);
label
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_canClickWord
){
return
;
}
if
(
!
this
.
_cantouch
)
{
return
;
}
//设置不可点击
this
.
_cantouch
=
false
;
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
//播放音频
this
.
playAudioByUrl
(
wordArr
[
i
].
audioUrl
,
()
=>
{
this
.
_cantouch
=
true
;
state
.
stop
();
this
.
playAni
(
'
normal
'
,
0
);
})
//显示文本动画
this
.
textTwinkle
(
label
);
})
//其余字母
let
last
=
wordArr
[
i
].
val
.
substr
(
1
);
...
...
@@ -391,10 +423,100 @@ cc.Class({
this
.
_curIndex
=
0
;
},
_canClickCat
:
null
,
_showStandby
:
null
,
initBtn
()
{
const
catBtn
=
cc
.
find
(
'
Canvas/Main Camera/catFrame/cat/ClickBtn
'
);
catBtn
.
addComponent
(
cc
.
Button
);
catBtn
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
){
return
;
}
if
(
!
this
.
_canClickCat
){
return
;
}
if
(
this
.
_showStandby
){
return
;
}
this
.
_showStandby
=
true
;
//播放待机音频
if
(
this
.
data
.
guideAudioUrl2
){
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
//播放完成,停止动画
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl2
,
()
=>
{
state
.
stop
();
this
.
_showStandby
=
false
;
this
.
playAni
(
'
normal
'
,
0
);
});
}
else
{
this
.
playAni
(
'
begin
'
,
1
,
()
=>
{
this
.
_showStandby
=
false
;
});
}
});
const
picNode
=
cc
.
find
(
"
Canvas/content/bg_green/pic
"
);
picNode
.
addComponent
(
cc
.
Button
);
picNode
.
on
(
'
click
'
,
()
=>
{
if
(
!
this
.
_cantouch
){
return
;
}
this
.
_cantouch
=
false
;
let
rotation
=
picNode
.
angle
;
let
times
=
1
;
const
rota
=
()
=>
{
cc
.
tween
(
picNode
)
.
to
(
0.3
,
{
angle
:
rotation
-
15
})
.
to
(
0.3
,
{
angle
:
rotation
})
.
to
(
0.3
,
{
angle
:
rotation
+
15
})
.
to
(
0.3
,
{
angle
:
rotation
})
.
call
(()
=>
{
if
(
times
>
2
){
this
.
_cantouch
=
true
;
return
;
}
times
+=
1
;
rota
();
})
.
start
();
}
console
.
log
(
"
click pic...
"
);
if
(
this
.
data
.
audioUrl
){
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
this
.
playAudioByUrl
(
this
.
data
.
audioUrl
,
()
=>
{
state
.
stop
();
//播放待机
this
.
playAni
(
"
normal
"
,
0
);
});
}
rota
();
});
},
getWord
(
wordVal
,
size
,
isInitial
)
{
...
...
@@ -443,13 +565,29 @@ cc.Class({
},
playAni
(
name
,
times
=
1
)
{
catAniState
:
null
,
playAni
(
name
,
times
=
1
,
cb
=
null
)
{
if
(
this
.
catAniState
&&
this
.
catAniState
.
name
!=
name
)
{
this
.
catAniState
.
stop
();
}
const
cat
=
cc
.
find
(
'
Canvas/Main Camera/catFrame/cat
'
);
var
dragonDisplay
=
cat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
name
,
times
);
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
tip
.
active
=
false
;
if
(
cb
)
{
cb
();
}
})
this
.
catAniState
=
state
;
return
state
;
},
...
...
@@ -572,6 +710,7 @@ cc.Class({
console
.
log
(
'
in showEnd
'
);
if
(
this
.
_shown
)
{
this
.
_cantouch
=
true
;
return
;
}
...
...
@@ -582,15 +721,20 @@ cc.Class({
this
.
_stop
=
true
;
//播放动画
const
state
=
this
.
playAni
(
'
begin
'
,
0
);
const
state
=
this
.
playAni
(
'
finish
'
,
0
);
//播放
引导音频2
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl
2
,
()
=>
{
//播放
结束音频
this
.
playAudioByUrl
(
this
.
data
.
guideAudioUrl
3
,
()
=>
{
state
.
stop
();
this
.
playAni
(
'
normal
'
,
0
);
//设置可以点击字母
this
.
_canClickWord
=
true
;
this
.
_cantouch
=
true
;
this
.
showPhotoBtn
();
});
...
...
@@ -734,7 +878,7 @@ cc.Class({
.
to
(
0.5
,
{
scale
:
node
.
initScale
*
1.1
})
.
to
(
0.5
,
{
scale
:
node
.
initScale
})
.
call
(()
=>
{
this
.
_cantouch
=
true
;
this
.
_curIndex
++
;
...
...
play/assets/OP_03_2/script/defaultData.js
View file @
0ad8a900
...
...
@@ -44,6 +44,7 @@ export const defaultData = {
}
}
,
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/bbab99eb9f5fe3cbe2d24cf80594d8c9.mp3
"
,
"
guideAudioUrl1
"
:
"
http://staging-teach.cdn.ireadabc.com/c3b83a24fd8f9b37ee72409cdb45e3f7.mp3
"
,
"
guideAudioUrl2
"
:
"
http://staging-teach.cdn.ireadabc.com/9f6ff5d0617bf274ee2d9af4cfc93c62.mp3
"
,
"
guideAudioUrl3
"
:
"
http://staging-teach.cdn.ireadabc.com/c3b83a24fd8f9b37ee72409cdb45e3f7.mp3
"
...
...
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