Commit a064a309 authored by Tt's avatar Tt

数据处理完成

parent af2553f3
No preview for this file type
......@@ -93,3 +93,20 @@ npm start
* 开发者新建的脚本文件(.js/.ts)的文件名必须包含项目名称,例如在 test_01 项目中添加一个脚本文件(如想命名为 hello.ts );则需要命名为 hello_test_01.ts
* 项目里尽量不要使用setTimeout、setInterval等定时器,如果使用了记得在onDestroy中释放掉(onDestroy 是指CocosCreator的生命周期钩子)
* 理论上禁止使用全局变量,因为模板到线上会进行组装,常见问题是一个模板使用多次造成全局变量被读脏
let question = [
{
title: "",
options :
[
{
type: "",
image : "",
text:"",
}
]
}
]
\ No newline at end of file
......@@ -25,48 +25,32 @@ export const defaultData =
let m = {
"recordFlag": 2,
"title": "test",
"questionText": "",
"questionTextAudio": "",
"title": "",
"questions": [
{
"questionAudio": "",
"duration": 120,
"title": "Which animal have wings?",
"options": [
{
"type": "img_txt_audio",
"image": "http://staging-teach.cdn.ireadabc.com/cadf4f62024a1e932aa8c108de0d0a27.jpg",
"audio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3",
"text": "This is Annie's apple tree?",
"duration": 5,
"content": "yes,It is Annie's apple tree.",
"right": false,
"imageBig": 3,
"audioName": "btn_hy01_danci.mp3",
npcAudio: "http://staging-teach.cdn.ireadabc.com/7f617b30a5eb2a090234920500f9c7ce_l.mp3",
npcAudioName: "right_sn17_danci.mp3"
}, {
"type": "img_txt_audio",
"image": "http://staging-teach.cdn.ireadabc.com/befdc1801d93fd95b3a8ee7c7a2d2d05.png", "audio": "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3", "text": "clound in air", "duration": 10,
"content": "clound is cloud", "right": false, "audioName": "敲碎蛋的声音.mp3", "imageBig": 2,
npcAudio: "http://staging-teach.cdn.ireadabc.com/7f617b30a5eb2a090234920500f9c7ce_l.mp3",
npcAudioName: "right_sn17_danci.mp3"
}, {
"type": "img_txt_audio", "imageBig": 1,
"image": "http://staging-teach.cdn.ireadabc.com/ef1e6f871b37ad482e268809e91d20b7.png",
"audio": "http://staging-teach.cdn.ireadabc.com/5f4e4c72671607bb35d1ecd1d291f238_l.mp3",
"text": "", "duration": 10, "content": "", "right": false,
"audioName": "excellent_dg10_ty.mp3"
}]
}],
"bgAudio": "", "bgAudioName": "", "audioName": "", "npcTitle": "test",
"npcAudio": "http://staging-teach.cdn.ireadabc.com/fd75d456ec85f8c90ffd03f1d9d8d10f_l.mp3", "npcAudioName": "tryagain_dg10_ty.mp3", "word_count": "20", "sentence_count": "11", "zi_count": "33"
}
// let m =
"type": "txt",
"image": "",
"text": "bird"
},
{
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/c62b5960641fd7cf29613cc45fb00cd6.png",
"text": ""
},
{
"type": "img_txt",
"image": "http://staging-teach.cdn.ireadabc.com/a71f2b71e45ff2525714494f6edd624b.jpg",
"text": "wind"
},
{
"type": "txt",
"image": "",
"text": "dog"
}
]
}
]
}
\ No newline at end of file
This diff is collapsed.
......@@ -9,24 +9,11 @@ import { MetaFormCreator } from './mataFormCreator';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "jj_16";
saveKey = "jj_15";
item = {
onlineFlg: false,
npcTitle: "",
npcAudio: "",
npcAudioName: '',
title: "",
questionText: "",
questionTextAudio: "",
questions: [],
bgAudio: "",
bgAudioName: "",
word_count: '0',
sentence_count: '0',
zi_count: '0',
showKuang: '1',
audioName: ""
};
isVisible = false;
deleteTitle = "是否删除题目";
......@@ -46,29 +33,28 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
init(): void {
if (!this.item.npcTitle) this.item.npcTitle = '';
if (!this.item.npcAudio) this.item.npcAudio = '';
if (!this.item.npcAudioName) this.item.npcAudioName = '';
if (!this.item.word_count) this.item.word_count = '0';
if (!this.item.sentence_count) this.item.sentence_count = '0';
if (!this.item.zi_count) this.item.zi_count = '0';
// console.log(new MetaFormCreator().create());
if (this.item.questions.length == 0) {
this.addquestion();
}
}
removeoption(i, j) {
this.openDelete("确定减少选项?", () => {
this.item.questions[i].letterList.splice(j, 1);
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
copyOption(i, j) {
let data = this.item.questions[i].letterList[j];
this.item.questions[i].letterList.push(JSON.parse(JSON.stringify(data)));
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].letterList.push({
this.item.questions[i].options.push({
type: 'img',
image: '',
text: ''
})
this.save();
......@@ -83,24 +69,17 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() {
this.item.questions.push({
questionAudio: "",
duration: 120,
type: "img",
image: "",
audio: "",
text: "",
right: false,
letterList: [],
title: "",
options: [],
});
this.addoption(this.item.questions.length - 1);
this.save();
}
deleteBgAudio() {
this.item.bgAudio = "";
this.item.bgAudioName = "";
this.save();
}
ngChange(i) {
ngChange() {
this.save();
}
}
\ No newline at end of file
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