Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
op_01
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_01
Commits
1edc9e3b
Commit
1edc9e3b
authored
Sep 22, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: form
parent
84e30557
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
45 deletions
+50
-45
form.component.html
form/src/app/form/form.component.html
+15
-10
form.component.ts
form/src/app/form/form.component.ts
+7
-30
defaultData.js
play/assets/scene/script/defaultData.js
+28
-5
No files found.
form/src/app/form/form.component.html
View file @
1edc9e3b
...
...
@@ -3,19 +3,24 @@
<div
style=
"padding: 10px;"
>
<div
style=
"width: 100%; margin-top: 15px; margin-bottom: 50px;"
align=
"center"
>
<h2>
标题设置
</h2>
<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"
>
<div
class=
"border"
style=
"width: 800px;"
>
<span
style=
"height: 30px; font-size: 18px;"
>
开场语音:
</span>
<div
style=
"width: 200px;"
>
<app-audio-recorder
style=
"margin-top: 5px; margin-left: 5px;"
[
audioUrl
]="
item
.
title_audio_url
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
title_audio_url
')"
></app-audio-recorder>
[
audioUrl
]="
item
.
startAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
startAudio
')"
>
</app-audio-recorder>
</div>
<span
style=
"height: 30px; font-size: 18px;"
>
结束语音:
</span>
<div
style=
"width: 200px;"
>
<app-audio-recorder
[
audioUrl
]="
item
.
endAudio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
endAudio
')"
>
</app-audio-recorder>
</div>
</div>
<app-custom-hot-zone
[
bgItem
]="
item
.
bgItem
"
[
hotZoneItemArr
]="
item
.
hotZoneItemArr
"
...
...
form/src/app/form/form.component.ts
View file @
1edc9e3b
...
...
@@ -63,31 +63,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
]
},
},
]
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
}
createShell
()
{
this
.
item
.
wordList
.
push
({
word
:
''
,
audio
:
''
,
backWord
:
''
,
backWordAudio
:
''
,
});
this
.
save
();
}
removeShell
(
idx
)
{
this
.
item
.
wordList
.
splice
(
idx
,
1
);
this
.
save
();
}
ngOnInit
()
{
this
.
item
=
{};
this
.
item
=
{
startAudio
:
''
,
endAudio
:
''
};
// 获取存储的数据
(
<
any
>
window
).
courseware
.
getData
((
data
)
=>
{
...
...
@@ -114,7 +102,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
onSaveCustomAction
(
e
)
{
console
.
log
(
'
e:
'
,
e
);
this
.
item
.
customAction
=
e
;
...
...
@@ -124,8 +111,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
saveHotZone
(
group
,
e
)
{
console
.
log
(
'
e:
'
,
e
);
const
{
bgItem
,
hotZoneItemArr
}
=
e
;
const
{
bgItem
,
hotZoneItemArr
}
=
e
;
group
.
bgItem
=
bgItem
;
group
.
hotZoneItemArr
=
hotZoneItemArr
;
...
...
@@ -152,16 +139,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
onWordAudioUploadSuccess
(
e
,
idx
)
{
this
.
item
.
wordList
[
idx
].
audio
=
e
.
url
;
this
.
save
();
}
onBackWordAudioUploadSuccess
(
e
,
idx
)
{
this
.
item
.
wordList
[
idx
].
backWordAudio
=
e
.
url
;
this
.
save
();
}
/**
* 储存数据
*/
...
...
play/assets/scene/script/defaultData.js
View file @
1edc9e3b
export
const
defaultData
=
{
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png
"
,
"
pic_url_2
"
:
"
http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png
"
,
"
text
"
:
"
This is a test label.
"
,
"
audio_url
"
:
"
http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3
"
}
\ No newline at end of file
"
bgItem
"
:
{
"
url
"
:
"
http://staging-teach.cdn.ireadabc.com/c465e1fc66313a170827d4f18d2c6e55.jpeg
"
,
"
rect
"
:
{
"
x
"
:
396.35
,
"
y
"
:
0
,
"
width
"
:
1180.3
,
"
height
"
:
738
}
},
"
hotZoneItemArr
"
:
[{
"
id
"
:
"
1632280599616
"
,
"
index
"
:
0
,
"
pic_url
"
:
"
http://staging-teach.cdn.ireadabc.com/e04216e18a88cf20bb02a144d1ff541a.jpg
"
,
"
itemType
"
:
"
pic
"
,
"
fontScale
"
:
1.54140625
,
"
imgScale
"
:
0.12967798085291557
,
"
mapScale
"
:
1.54140625
,
"
gIdx
"
:
"
1
"
,
"
rect
"
:
{
"
x
"
:
159.65
,
"
y
"
:
482.97
,
"
width
"
:
149
,
"
height
"
:
140.05
}
}],
"
startAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/dfb27b510e121a1045a3b7613a530e43.mp3
"
,
"
endAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/d948ef84a50e6ac36bc31110f9062878.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