Commit 1edc9e3b authored by 范雪寒's avatar 范雪寒

feat: form

parent 84e30557
...@@ -3,17 +3,22 @@ ...@@ -3,17 +3,22 @@
<div style="padding: 10px;"> <div style="padding: 10px;">
<div style="width: 100%; margin-top: 15px; margin-bottom: 50px;" align="center"> <div class="border" style="width: 800px;">
<h2>标题设置</h2> <span style="height: 30px; font-size: 18px;">开场语音:</span>
<div style="width: 50%; display: flex; justify-content: center; align-items: center;"> <div style="width: 200px;">
<input type="text" nz-input [(ngModel)]="item.title" (blur)="save()" style="width: 200px;margin-top: 5px">
<app-audio-recorder <app-audio-recorder
style="margin-top: 5px; margin-left: 5px;" [audioUrl]="item.startAudio"
[audioUrl]="item.title_audio_url" (audioUploaded)="onAudioUploadSuccess($event, 'startAudio')">
(audioUploaded)="onAudioUploadSuccess($event, 'title_audio_url')" </app-audio-recorder>
></app-audio-recorder>
</div> </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> </div>
<app-custom-hot-zone <app-custom-hot-zone
......
...@@ -70,24 +70,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -70,24 +70,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
createShell() {
this.item.wordList.push({
word: '',
audio: '',
backWord: '',
backWordAudio: '',
});
this.save();
}
removeShell(idx) {
this.item.wordList.splice(idx, 1);
this.save();
}
ngOnInit() { ngOnInit() {
this.item = {}; this.item = {
startAudio: '',
endAudio: ''
};
// 获取存储的数据 // 获取存储的数据
(<any>window).courseware.getData((data) => { (<any>window).courseware.getData((data) => {
...@@ -114,7 +102,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -114,7 +102,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
onSaveCustomAction(e) { onSaveCustomAction(e) {
console.log('e:', e); console.log('e:', e);
this.item.customAction = e; this.item.customAction = e;
...@@ -124,7 +111,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -124,7 +111,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
saveHotZone(group, e) { saveHotZone(group, e) {
console.log('e: ', e); console.log('e: ', e);
const {bgItem, hotZoneItemArr} = e; const { bgItem, hotZoneItemArr } = e;
group.bgItem = bgItem; group.bgItem = bgItem;
group.hotZoneItemArr = hotZoneItemArr; group.hotZoneItemArr = hotZoneItemArr;
...@@ -152,16 +139,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -152,16 +139,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); 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();
}
/** /**
* 储存数据 * 储存数据
*/ */
......
export const defaultData = { export const defaultData = {
"pic_url": "http://staging-teach.cdn.ireadabc.com/ed94332a503c31e0908bd4c6923a2665.png", "bgItem": {
"pic_url_2": "http://staging-teach.cdn.ireadabc.com/5fb60317ade0195d35ad8034d5370a7f.png", "url": "http://staging-teach.cdn.ireadabc.com/c465e1fc66313a170827d4f18d2c6e55.jpeg",
"text": "This is a test label.", "rect": {
"audio_url": "http://staging-teach.cdn.ireadabc.com/f47f1d7b5c160fe1c59500d180346240.mp3" "x": 396.35,
} "y": 0,
\ No newline at end of file "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"
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment