Commit b57939a8 authored by Tt's avatar Tt

form修改

parent e678008c
export const defaultData = {
"audioName": "",
"imgAni": {
"ske": {
"url": "http://staging-teach.cdn.ireadabc.com/4ec3da85d888ad3c5c57e10fca728499.json",
"name": "鱼1_ske.json"
},
"tex": {
"url": "http://staging-teach.cdn.ireadabc.com/2c52380a3f3cdd3f5d38870bee2c9ffd.json",
"name": "鱼1_tex.json"
},
"png": {
"url": "http://staging-teach.cdn.ireadabc.com/3ca112e3bb312d5e9b7182bbb97c616d.png",
"name": "鱼1_tex.png"
}
},
"startAudio": "http://staging-teach.cdn.ireadabc.com/67421bf397cf214254db34427b4f53da_l.mp3",
"title": "分类钓鱼",
"questions":
[
{
......
......@@ -67,12 +67,16 @@ export class ComponentBase {
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, key, it = this.item) {
onAudioUploadSuccess(e, key, it = this.item, audioName = null) {
let url = e.url;
let sp = url.split(".mp3");
let u = sp[0] + "_l.mp3";
it[key] = u;
it[key + "Name"] = e.name || "";
if (audioName) {
it[audioName] = e.audioName || "";
} else {
it[key + "Name"] = e.name || "";
}
this.save();
}
......
......@@ -74,6 +74,29 @@
</style>
<div class="model-content">
<div style="padding: 10px;background-color: #fff;">
<!-- 标题区 -->
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<span style="font-size: 20px;">标题文字: </span>
<input type="text" nz-input [(ngModel)]="item.title" (blur)="save()">
<span style="font-size: 20px;">提示动画: </span>
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)" [skeJsonData]="item.imgAni.ske"
[texJsonData]="item.imgAni.tex" [texPngData]="item.imgAni.png">
</app-upload-dragon-bone>
<span style="font-size: 20px;">开始音频: </span>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.startAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'startAudio',item,'audioName')"></app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.audioName}}</span>
</div>
</div>
</div>
</div>
<div style="padding: 10px;background-color: #fff;">
<div style="margin: 20px;width: 1000px;">
......@@ -190,7 +213,7 @@
</div>
</div>
<!--
<!--
<button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button> -->
</div>
......
......@@ -12,6 +12,14 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
saveKey = "ngt07_fish";
item = {
title: '分类钓鱼',
imgAni: {
ske: {},
tex: {},
png: {}
},
startAudio: "",
audioName:'',
questions: [
{
title: '左侧船',
......@@ -76,6 +84,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
onDragonBoneSave(e, item) {
console.log(e);
this.save();
}
ngChange(i, j) {
this.save();
}
......
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