Commit ca76b9d7 authored by Tt's avatar Tt

表单完成

parent 9233bd21
No preview for this file type
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",
"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",
"npcAudioName": "",
"npcAudioEnd": "http://staging-teach.cdn.ireadabc.com/85e58ae784dfc381170ddabead16cac6_l.mp3",
"npcAudioEndName": "",
"video": "http://staging-teach.cdn.ireadabc.com/aca65e37c239f95496a8c39fe1374fc4.mp4",
"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/b4494456199505bdf990fff96a0c9fb8.jpg",
"rect": {
"x": 17.111111111111086,
"y": 0,
"width": 1057.7777777777778,
"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": 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": {
"size": 50,
"name": "BRLNSR_1",
"color": "#8f3758"
}
"img": "http://staging-teach.cdn.ireadabc.com/b4494456199505bdf990fff96a0c9fb8.jpg",
"title": "this is first question on this world?",
"keyword": "hello,world,good,info",
"startAudio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3",
"startAudioName": "",
"rightAudio": "http://staging-teach.cdn.ireadabc.com/289fe0a6d9893519c3fb5993b86b6fe9_l.mp3",
"rightAudioName": "",
"errorAudio": "http://staging-teach.cdn.ireadabc.com/f96310cbadf910738385ceadbfb088a4_l.mp3",
"errorAudioName": "",
"audioName": ""
}, {
"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"
}
"img": "http://staging-teach.cdn.ireadabc.com/f70b6fd256f91a8bc0c4db6a88ad270f.png",
"title": "i need something",
"keyword": "Is ok,do,some",
"startAudio": "http://staging-teach.cdn.ireadabc.com/85e58ae784dfc381170ddabead16cac6_l.mp3",
"startAudioName": "",
"rightAudio": "http://staging-teach.cdn.ireadabc.com/f96310cbadf910738385ceadbfb088a4_l.mp3",
"rightAudioName": "",
"errorAudio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3",
"errorAudioName": "",
"audioName": ""
}],
"bgItem": "",
"hotZoneItemArr": []
"questionText": "", "audioName": ""
}
This diff is collapsed.
......@@ -13,40 +13,27 @@ let replaceAll = function (str, s1, s2) {
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "dg28_drag";
saveKey = "dg29_museum_1";
item = {
npcTitle: "",
npcAudio: "",
npcAudioName: "",
npcAudioEnd: "",
npcAudioEndName: "",
// 开始音频
auidoStart: "",
auidoStartName: "",
// 结束音频
auidoEnd: "",
auidoEndName: "",
// 肉饼引导音频
auidoMeet: "",
auidoMeetName: "",
// 蔬菜引导音频
auidoVegetable: "",
auidoVegetableName: "",
// 第一次完成音频
auidoFinish: "",
auidoFinishName: "",
video: '',//展示用视频部分
questions: [],
questionText: "",
contentMain: "",
contentArr: [],
};
constructor(public nzMessageService: NzMessageService, public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) {
super(appRef, changeDetectorRef);
}
onVideoUploaded(e) {
this.item.video = e.url
this.save();
}
isVisible = false;
deleteTitle = "是否删除题目";
deleteCallback = function () { };
......@@ -70,29 +57,29 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
}
removeoption(i, j) {
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
copyoption(i, j) {
let data = this.item.questions[i].options[j];
this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
this.save();
}
addoption(i) {
this.item.questions[i].options.push({
type: "img",
image: "",
audio: "",
text: "",
time: "",
right: false
});
this.save();
}
// removeoption(i, j) {
// this.openDelete("确定删除选项?", () => {
// this.item.questions[i].options.splice(j, 1);
// this.save();
// })
// }
// copyoption(i, j) {
// let data = this.item.questions[i].options[j];
// this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
// this.save();
// }
// addoption(i) {
// this.item.questions[i].options.push({
// type: "img",
// image: "",//展示一个图片
// text: "",// 一个标题文字
// audio: "",
// time: "",
// right: false
// });
// this.save();
// }
......@@ -106,27 +93,15 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addQuestion() {
// 题目自带一堆东西不用添加选项部分
this.item.questions.push({
title: "",//大标题
mainType: "",//题干类型
mainText: "",//题干文字
mainTextArr: [],//题干文字高亮
mainImage: "",//题干图片
meetType: "",//肉类型
meetText: "",//肉文字
meetTextArr: [],//肉文字高亮
meetImage: "",//肉图片
vegetableType: "",//菜类型
vegetableText: "",//菜文字
vegetableTextArr: [],//菜文字高亮
vegetableImage: "",//菜图片
pieType: "",//菜类型
pieText: "",//菜文字
pieTextArr: [],//菜文字高亮
pieImage: "",//菜图片
img: '',//展示用图片
title: '',//大标题
keyword: '',// 关键字,逗号隔开
startAudio: '',// 开始音频
startAudioName: '',
rightAudio: '',// 正确音频
rightAudioName: '',
errorAudio: '',// 错误音频
errorAudioName: '',
});
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