Commit ca76b9d7 authored by Tt's avatar Tt

表单完成

parent 9233bd21
No preview for this file type
export const defaultData = export const defaultData =
{ {
"npcTitle": "exit", "npcAudio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3",
"npcAudioName": "boom_dg28_drag.mp3",
"npcAudioEnd": "http://staging-teach.cdn.ireadabc.com/289fe0a6d9893519c3fb5993b86b6fe9_l.mp3",
"npcAudioEndName": "dragdown_dg28_drag.mp3",
"questions": [{
"options": [{ "audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false },
{ "audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false },
{ "audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false }],
"type": "img",
"bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/f627ed930909e43e823cd79ed90aaea3.png", "rect": { "x": 90.8694029850746, "y": 0, "width": 910.2611940298508, "height": 595 }
}, "hotZoneItemArr": [
{
"index": 0, "text": "part1", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 261.13, "y": 44.5, "width": 200, "height": 200 }
}, {
"index": 1, "text": "part2", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 512.13, "y": 45.5, "width": 200, "height": 200 }
}, {
"index": 2, "text": "part3", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 355.13, "y": 151.5, "width": 200, "height": 200 }
}, {
"index": 3, "pic_url": "http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 0.44287909836065575, "mapScale": 0.853125, "rect": { "x": 23.13, "y": 44.5, "width": 200, "height": 200 }
}], "hotZoneFontObj": { "size": 50, "name": "BRLNSR_1", "color": "#8f3758" }
}, {
"options": [], "type": "img", "bgItem": { "url": "http://staging-teach.cdn.ireadabc.com/8b565a3db344386ab9cde226cc1411f2.jpg", "rect": { "x": 72.15060240963851, "y": 0, "width": 947.698795180723, "height": 595 } }, "hotZoneItemArr": [{ "index": 0, "text": "download", "itemType": "text", "fontSize": "40", "fontName": "BRLNSR_1", "fontColor": "#FF0000", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 122.84, "y": 71.5, "width": 200, "height": 200 } }, { "index": 1, "text": "app", "itemType": "text", "fontSize": "40", "fontName": "BRLNSR_1", "fontColor": "#FF0000", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 176.84, "y": 270.5, "width": 200, "height": 200 } }], "hotZoneFontObj": { "size": "40", "name": "BRLNSR_1", "color": "#FF0000" }
}], "bgItem": "", "hotZoneItemArr": []
}
const b = {
"npcTitle": "exit", "npcTitle": "exit",
"npcAudio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3", "npcAudio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3",
"npcAudioName": "boom_dg28_drag.mp3", "npcAudioName": "",
"npcAudioEnd": "http://staging-teach.cdn.ireadabc.com/289fe0a6d9893519c3fb5993b86b6fe9_l.mp3", "npcAudioEnd": "http://staging-teach.cdn.ireadabc.com/85e58ae784dfc381170ddabead16cac6_l.mp3",
"npcAudioEndName": "dragdown_dg28_drag.mp3", "npcAudioEndName": "",
"video": "http://staging-teach.cdn.ireadabc.com/aca65e37c239f95496a8c39fe1374fc4.mp4",
"questions": [ "questions": [
{ {
"options": [ "img": "http://staging-teach.cdn.ireadabc.com/b4494456199505bdf990fff96a0c9fb8.jpg",
{ "title": "this is first question on this world?",
"audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false "keyword": "hello,world,good,info",
}, { "startAudio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3",
"audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false "startAudioName": "",
}, { "rightAudio": "http://staging-teach.cdn.ireadabc.com/289fe0a6d9893519c3fb5993b86b6fe9_l.mp3",
"audio": "", "hotZoneItemArr": [], "bgItem": "", "right": false "rightAudioName": "",
} "errorAudio": "http://staging-teach.cdn.ireadabc.com/f96310cbadf910738385ceadbfb088a4_l.mp3",
], "errorAudioName": "",
"type": "img", "audioName": ""
"bgItem": { }, {
"url": "http://staging-teach.cdn.ireadabc.com/b4494456199505bdf990fff96a0c9fb8.jpg", "img": "http://staging-teach.cdn.ireadabc.com/f70b6fd256f91a8bc0c4db6a88ad270f.png",
"rect": { "title": "i need something",
"x": 17.111111111111086, "keyword": "Is ok,do,some",
"y": 0, "startAudio": "http://staging-teach.cdn.ireadabc.com/85e58ae784dfc381170ddabead16cac6_l.mp3",
"width": 1057.7777777777778, "startAudioName": "",
"height": 595 "rightAudio": "http://staging-teach.cdn.ireadabc.com/f96310cbadf910738385ceadbfb088a4_l.mp3",
} "rightAudioName": "",
}, "errorAudio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3",
"hotZoneItemArr": [ "errorAudioName": "",
{ "audioName": ""
"index": 0, "text": "part1", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 435.89, "y": 190.5, "width": 200, "height": 200 }
}, {
"index": 1, "text": "part2", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": -19.11, "y": -59.5, "width": 200, "height": 200 }
}, {
"index": 2, "text": "part4", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": -27.11, "y": 452.5, "width": 200, "height": 200 }
}, {
"index": 3, "text": "part5", "itemType": "text", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 883.89, "y": 460.5, "width": 200, "height": 200 }
}, {
"index": 4, "pic_url": "http://staging-teach.cdn.ireadabc.com/be8ec5cee7a3074440478b00a4a84f5e.png", "itemType": "pic", "fontSize": 50, "fontName": "BRLNSR_1", "fontColor": "#8f3758", "fontScale": 0.853125, "imgScale": 0.44287909836065575, "mapScale": 0.853125, "rect": { "x": 6.89, "y": 79.5, "width": 200, "height": 200 }
}], }],
"hotZoneFontObj": { "questionText": "", "audioName": ""
"size": 50,
"name": "BRLNSR_1",
"color": "#8f3758"
}
}, {
"options": [],
"type": "img",
"bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/9ecda2ef223dfc255a17522110fc7ee2.png",
"rect": {
"x": 152.03542234332423,
"y": 0,
"width": 787.9291553133515,
"height": 595
}
},
"hotZoneItemArr": [
{
"index": 0, "text": "test1", "itemType": "text", "fontSize": "40", "fontName": "BRLNSR_1", "fontColor": "#FF0000", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 166.96, "y": 0.5, "width": 200, "height": 200 }
}, {
"index": 1, "text": "test2", "itemType": "text", "fontSize": "40", "fontName": "BRLNSR_1", "fontColor": "#FF0000", "fontScale": 0.853125, "imgScale": 1, "mapScale": 0.853125, "rect": { "x": 343.96, "y": 335.5, "width": 200, "height": 200 }
}],
"hotZoneFontObj": {
"size": "40", "name": "BRLNSR_1", "color": "#FF0000"
}
}],
"bgItem": "",
"hotZoneItemArr": []
} }
This diff is collapsed.
...@@ -13,7 +13,7 @@ let replaceAll = function (str, s1, s2) { ...@@ -13,7 +13,7 @@ let replaceAll = function (str, s1, s2) {
}) })
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy { export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用 // 储存数据用
saveKey = "dg28_drag"; saveKey = "dg29_museum_1";
item = { item = {
npcTitle: "", npcTitle: "",
npcAudio: "", npcAudio: "",
...@@ -21,32 +21,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -21,32 +21,19 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
npcAudioEnd: "", npcAudioEnd: "",
npcAudioEndName: "", npcAudioEndName: "",
// 开始音频 video: '',//展示用视频部分
auidoStart: "",
auidoStartName: "",
// 结束音频
auidoEnd: "",
auidoEndName: "",
// 肉饼引导音频
auidoMeet: "",
auidoMeetName: "",
// 蔬菜引导音频
auidoVegetable: "",
auidoVegetableName: "",
// 第一次完成音频
auidoFinish: "",
auidoFinishName: "",
questions: [], questions: [],
questionText: "", questionText: "",
contentMain: "",
contentArr: [],
}; };
constructor(public nzMessageService: NzMessageService, public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) { constructor(public nzMessageService: NzMessageService, public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) {
super(appRef, changeDetectorRef); super(appRef, changeDetectorRef);
} }
onVideoUploaded(e) {
this.item.video = e.url
this.save();
}
isVisible = false; isVisible = false;
deleteTitle = "是否删除题目"; deleteTitle = "是否删除题目";
deleteCallback = function () { }; deleteCallback = function () { };
...@@ -70,29 +57,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -70,29 +57,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
} }
} }
removeoption(i, j) { // removeoption(i, j) {
this.openDelete("确定删除选项?", () => { // this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1); // this.item.questions[i].options.splice(j, 1);
this.save(); // this.save();
}) // })
} // }
copyoption(i, j) { // copyoption(i, j) {
let data = this.item.questions[i].options[j]; // let data = this.item.questions[i].options[j];
this.item.questions[i].options.push(JSON.parse(JSON.stringify(data))); // this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
this.save(); // this.save();
} // }
addoption(i) { // addoption(i) {
this.item.questions[i].options.push({ // this.item.questions[i].options.push({
type: "img", // type: "img",
image: "", // image: "",//展示一个图片
audio: "", // text: "",// 一个标题文字
text: "", // audio: "",
time: "", // time: "",
right: false // right: false
}); // });
this.save(); // this.save();
} // }
...@@ -106,27 +93,15 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -106,27 +93,15 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addQuestion() { addQuestion() {
// 题目自带一堆东西不用添加选项部分 // 题目自带一堆东西不用添加选项部分
this.item.questions.push({ this.item.questions.push({
title: "",//大标题 img: '',//展示用图片
mainType: "",//题干类型 title: '',//大标题
mainText: "",//题干文字 keyword: '',// 关键字,逗号隔开
mainTextArr: [],//题干文字高亮 startAudio: '',// 开始音频
mainImage: "",//题干图片 startAudioName: '',
rightAudio: '',// 正确音频
meetType: "",//肉类型 rightAudioName: '',
meetText: "",//肉文字 errorAudio: '',// 错误音频
meetTextArr: [],//肉文字高亮 errorAudioName: '',
meetImage: "",//肉图片
vegetableType: "",//菜类型
vegetableText: "",//菜文字
vegetableTextArr: [],//菜文字高亮
vegetableImage: "",//菜图片
pieType: "",//菜类型
pieText: "",//菜文字
pieTextArr: [],//菜文字高亮
pieImage: "",//菜图片
}); });
this.save(); 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