Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
et_21
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
et_21
Commits
25b731e0
Commit
25b731e0
authored
Feb 25, 2021
by
Li MingZhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 表单优化
parent
522aa0ae
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
10 deletions
+50
-10
.DS_Store
.DS_Store
+0
-0
lrc-editor.component.html
form/src/app/common/lrc-editor/lrc-editor.component.html
+2
-2
form.component.html
form/src/app/form/form.component.html
+22
-4
form.component.ts
form/src/app/form/form.component.ts
+2
-0
scene.js
play/assets/et_21/script/scene.js
+10
-2
util.js
play/assets/et_21/script/util.js
+12
-0
btn_musicoff.png.meta
play/assets/et_21/texture/btn_musicoff.png.meta
+2
-2
.DS_Store
publish/.DS_Store
+0
-0
No files found.
.DS_Store
View file @
25b731e0
No preview for this file type
form/src/app/common/lrc-editor/lrc-editor.component.html
View file @
25b731e0
...
...
@@ -38,8 +38,8 @@
(
ngModelChange
)="
changePlaybackRate
($
event
)"
[
nzMax
]="
2
"
[
nzMin
]="
0
.
25
"
[
nzStep
]="
0
.
25
"
></nz-slider>
</span>
<
label
style=
"margin-right: 20px;margin-left: 20px"
>
文字大小:
<nz-input-number
[(
ngModel
)]="
LRCData
.
fontSize
"
[
nzMin
]="
1
"
[
nzMax
]="
100
"
[
nzStep
]="
1
"
></nz-input-number></label
>
<
label
style=
""
>
行高:
<nz-input-number
[(
ngModel
)]="
LRCData
.
lineHeight
"
[
nzMin
]="
1
"
[
nzMax
]="
100
"
[
nzStep
]="
1
"
></nz-input-number></label
>
<
!-- <label style="margin-right: 20px;margin-left: 20px">文字大小: <nz-input-number [(ngModel)]="LRCData.fontSize" [nzMin]="1" [nzMax]="100" [nzStep]="1"></nz-input-number></label> --
>
<
!-- <label style="">行高: <nz-input-number [(ngModel)]="LRCData.lineHeight" [nzMin]="1" [nzMax]="100" [nzStep]="1"></nz-input-number></label> --
>
<input
type=
"file"
onclick=
"this.value=null;"
accept=
".lrc"
style=
"display: none"
#
uploadBtn
>
<button
[
disabled
]="!
LRCData
.
audio_url
"
nz-button
nzType=
"link"
(
click
)="
uploadLRC
()"
>
上传LRC文件
</button>
<nz-select
[(
ngModel
)]="
lrcFileEncoding
"
(
ngModelChange
)="
changeLrcFileEncoding
($
event
)"
>
...
...
form/src/app/form/form.component.html
View file @
25b731e0
...
...
@@ -3,15 +3,33 @@
<div
style=
"width: 100%; margin-top: 15px; margin-bottom: 50px;"
align=
"center"
>
<h2>
标题设置
</h2>
<div
style=
"width: 50%"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
title
"
(
blur
)="
save
()"
style=
"width: 80%;margin-top: 5px"
>
<div
style=
"width: 50%; display: flex; justify-content: center; align-items: center;"
>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
title
"
(
blur
)="
save
()"
style=
"width: 200px;margin-top: 5px"
>
<app-audio-recorder
style=
"margin-top: 5px; margin-left: 5px;"
[
audioUrl
]="
item
.
title_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
title_audio_url
',
item
)"
></app-audio-recorder>
</div>
</div>
<div
*
ngFor=
"let it of songArr; let i = index"
align=
"center"
>
<div
style=
"width: 100%;"
align=
center
style=
"margin: 30px"
>
<span>
歌曲选择:
</span>
<nz-radio-group
[(
ngModel
)]="
curIndex
"
>
<label
nz-radio
nzValue=
"0"
>
歌曲-1
</label>
<label
nz-radio
nzValue=
"1"
>
歌曲-2
</label>
<label
nz-radio
nzValue=
"2"
>
歌曲-3
</label>
<label
nz-radio
nzValue=
"3"
>
歌曲-4
</label>
</nz-radio-group>
</div>
<div
*
ngFor=
"let it of songArr; let i = index"
align=
"center"
style=
"padding-bottom: 1px;"
>
<div
class=
"song-box"
>
<div
*
ngIf=
"i == curIndex"
class=
"song-box"
>
<h2>
歌曲-{{i+1}}
</h2>
<nz-divider
nzText=
"配置歌词"
></nz-divider>
...
...
form/src/app/form/form.component.ts
View file @
25b731e0
...
...
@@ -68,6 +68,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
{
color
:
'
#00ff00
'
,
text
:
'
绿色
'
},
];
curIndex
=
"
0
"
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
,
private
message
:
NzMessageService
)
{
...
...
play/assets/et_21/script/scene.js
View file @
25b731e0
...
...
@@ -6,7 +6,7 @@
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
// cc.audioEngine = require('../components/karaoke/scripts/audioEngineEx.js')
import
{
getSprNode
,
getSprNodeByUrl
,
setSprNodeMaxLen
}
from
"
./util
"
;
import
{
getSprNode
,
getSprNodeByUrl
,
playAudioByUrl
,
setSprNodeMaxLen
}
from
"
./util
"
;
cc
.
Class
({
extends
:
cc
.
Component
,
...
...
@@ -121,7 +121,7 @@ cc.Class({
getDefaultData
()
{
const
data
=
{
"
songArr
"
:[{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/
9259e1b99cc17f61210e7edc17f1d697.mp3
"
,
"
fontSize
"
:
24
,
"
lineHeight
"
:
32
,
"
lyrics
"
:[{
"
time
"
:
0.063225
,
"
data
"
:
"
AA
"
,
"
newLine
"
:
true
},{
"
time
"
:
0.371827
,
"
data
"
:
"
bbb ccc aaa
"
,
"
newLine
"
:
false
}]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3
"
},{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/2a25aaff4b6c84b859b4d77f944de57a.mp3
"
,
"
fontSize
"
:
24
,
"
lineHeight
"
:
32
,
"
lyrics
"
:[{
"
time
"
:
19.06
,
"
data
"
:
"
安静地离去
"
,
"
newLine
"
:
true
},{
"
time
"
:
21.7
,
"
data
"
:
"
和孤单一起
"
,
"
newLine
"
:
true
},{
"
time
"
:
26.55
,
"
data
"
:
"
拥挤的回忆时间抹去
"
,
"
newLine
"
:
true
}]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/86614bd904f63ab02fc69304e99618c6.mp3
"
},{},{}],
"
title
"
:
"
"
}
const
data
=
{
"
songArr
"
:[{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/
3fa65d5f667a2ef9059d3dfc5df74a4d.mp3
"
,
"
fontSize
"
:
24
,
"
lineHeight
"
:
32
,
"
lyrics
"
:[{
"
time
"
:
4.81026
,
"
data
"
:
"
AAA
"
,
"
newLine
"
:
true
},{
"
time
"
:
8.63464
,
"
data
"
:
"
aaaaa vbbbb ccc ddd
"
,
"
newLine
"
:
true
},{
"
time
"
:
10.489051
,
"
data
"
:
"
eeee fffff gg hhh
"
,
"
newLine
"
:
false
}]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/c8abf7383d65bcbdba8f390785cece60.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/22e9facddfbf087ecdf2b60dba6019ef.mp3
"
},{
"
lrcData
"
:{
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/2a25aaff4b6c84b859b4d77f944de57a.mp3
"
,
"
fontSize
"
:
24
,
"
lineHeight
"
:
32
,
"
lyrics
"
:[{
"
time
"
:
19.06
,
"
data
"
:
"
安静地离去
"
,
"
newLine
"
:
true
},{
"
time
"
:
21.7
,
"
data
"
:
"
和孤单一起
"
,
"
newLine
"
:
true
},{
"
time
"
:
26.55
,
"
data
"
:
"
拥挤的回忆时间抹去
"
,
"
newLine
"
:
true
}]},
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f6f4bbef497409fef3c8f1d375893829.png
"
,
"
accompany_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/86614bd904f63ab02fc69304e99618c6.mp3
"
},{},{}],
"
title
"
:
"
Let's play
"
,
"
title_audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/cd8daa8b4d8ff707b3a3680e80bc4761.mp3
"
}
return
data
;
},
...
...
@@ -160,6 +160,7 @@ cc.Class({
}
}
this
.
_audioResList
.
push
({
url
:
this
.
data
.
title_audio_url
||
''
});
},
...
...
@@ -227,6 +228,13 @@ cc.Class({
title
.
x
=
-
this
.
canvas
.
width
/
2
+
title
.
width
/
2
*
title
.
scale
;
title
.
y
=
this
.
canvas
.
height
/
2
-
title
.
height
/
2
*
title
.
scale
;
title
.
addComponent
(
cc
.
Button
)
title
.
on
(
'
click
'
,
()
=>
{
if
(
this
.
data
.
title_audio_url
)
{
playAudioByUrl
(
this
.
data
.
title_audio_url
);
}
})
const
labelNode
=
new
cc
.
Node
();
labelNode
.
parent
=
title
;
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
...
...
play/assets/et_21/script/util.js
View file @
25b731e0
...
...
@@ -98,3 +98,15 @@ export function getSprNodeByUrl(url, cb) {
})
}
export
function
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
();
});
}
});
}
}
play/assets/et_21/texture/btn_musicoff.png.meta
View file @
25b731e0
...
...
@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width":
79
,
"height":
96
,
"width":
88
,
"height":
88
,
"platformSettings": {},
"subMetas": {
"btn_musicoff": {
...
...
publish/.DS_Store
View file @
25b731e0
No preview for this file type
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