Commit eaeb36f1 authored by Tt's avatar Tt

表单完成

parent ac5fa9c1
export const defaultData = { export const defaultData =
"onlineFlg": true, {
"title": "钓鱼大作战", "onlineFlg": false,
"questionText": "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼, 快速完成钓鱼。 在本次的游戏中, 你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", "title": "疯狂打地鼠",
"questionTextAudio": "https://teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", "questionText": "调皮的地鼠偷走了魔法卡牌,亲爱的小玩家,请仔细听游戏指令,快速找到藏着正确魔法卡牌的地鼠,用锤子敲打它,就能夺回魔法卡牌。在本次的游戏中,你将和其他玩家进行PK,游戏结束,获得魔法卡牌数量最多的玩家,将获得胜利。最后根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!", "questionTextAudio": "http://staging-teach.cdn.ireadabc.com/d08192ced3bd81941d38941bb36e5042_l.mp3", "questions": [{ "questionAudio": "http://staging-teach.cdn.ireadabc.com/130feba39f7665f46adfc6765f86c6cd_l.mp3", "duration": 120, "options": [{ "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/317ef6895381d2f926a0d444326a5995.png", "audio": "http://staging-teach.cdn.ireadabc.com/f03e207cb6808b17c1510b230a70bb1d_l.mp3", "text": "", "right": true, "audioName": "加分.mp3" }, { "type": "txt", "image": "", "audio": "http://staging-teach.cdn.ireadabc.com/7432c9bfa754a4c9db54132308e8ce1f_l.mp3", "text": "xfuw", "right": false, "audioName": "冒出.mp3" }, { "type": "txt", "image": "", "audio": "http://staging-teach.cdn.ireadabc.com/274d8965edafabf1e8d1a01400db82b7_l.mp3", "text": "head", "right": true, "audioName": "错误.mp3" }, { "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/fc1d670c1a3461136506195e3e9e3797.png", "audio": "http://staging-teach.cdn.ireadabc.com/7432c9bfa754a4c9db54132308e8ce1f_l.mp3", "text": "", "right": false, "audioName": "冒出.mp3" }], "questionImg": "http://staging-teach.cdn.ireadabc.com/317ef6895381d2f926a0d444326a5995.png", "audioName": "胜利.mp3" }, { "questionAudio": "http://staging-teach.cdn.ireadabc.com/26e6e997562503a98918fadab7e7b6c2_l.mp3", "duration": 120, "options": [{ "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/fea420e83bd2ba03d014c279de780599.png", "audio": "http://staging-teach.cdn.ireadabc.com/7432c9bfa754a4c9db54132308e8ce1f_l.mp3", "text": "", "right": true, "audioName": "冒出.mp3" }, { "type": "txt", "image": "", "audio": "http://staging-teach.cdn.ireadabc.com/274d8965edafabf1e8d1a01400db82b7_l.mp3", "text": "eye", "right": true, "audioName": "错误.mp3" }, { "type": "txt", "image": "", "audio": "http://staging-teach.cdn.ireadabc.com/f03e207cb6808b17c1510b230a70bb1d_l.mp3", "text": "fffsxz", "right": false, "audioName": "加分.mp3" }, { "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/01247e69d70b995da41e6b7e2000b540.png", "audio": "http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610_l.mp3", "text": "", "right": false, "audioName": "按钮.mp3" }], "questionImg": "http://staging-teach.cdn.ireadabc.com/fea420e83bd2ba03d014c279de780599.png", "audioName": "失败.mp3" }], "audioName": "头像移动.mp3", "bgAudio": "http://staging-teach.cdn.ireadabc.com/93bb9ed985cff104879f4b4fa6ace4ea_l.mp3"
"questions": [
{
"questionAudio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"duration": 60,
"options": [
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": true
},
{
"type": "txt",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "apples",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/646dfb31647d9c53d956d9cc9828c05f.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/646dfb31647d9c53d956d9cc9828c05f.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": false
}
]
},
{
"questionAudio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"duration": 40,
"options": [
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/9360892fec22f876185049c84c923c78.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/9360892fec22f876185049c84c923c78.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/646dfb31647d9c53d956d9cc9828c05f.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": false
},
{
"type": "txt",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/9360892fec22f876185049c84c923c78.mp3",
"text": "juice",
"right": false
}
]
},
{
"questionAudio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"duration": 40,
"options": [
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/07d9988cef32ec4e76a7edf349917096.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/9360892fec22f876185049c84c923c78.mp3",
"text": "",
"right": false
},
{
"type": "txt",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "apples",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": false
},
{
"type": "txt",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/9360892fec22f876185049c84c923c78.mp3",
"text": "juice",
"right": false
}
]
},
{
"questionAudio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"duration": 30,
"options": [
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/6a0f1b7ce6e3b9293afed4dab13e4d42.png",
"audio": "https://teach.cdn.ireadabc.com/8e9afa3313f61b777cdbee625016e049.mp3",
"text": "",
"right": true
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/7d557a63492e8f2a6b48cb02dc544848.png",
"audio": "https://teach.cdn.ireadabc.com/3c3c7b570d466100a644d8b2e3682253.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/d0ec6d873e6dc3bde1c3a3a8b07f176d.png",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "",
"right": false
},
{
"type": "img",
"image": "https://teach.cdn.ireadabc.com/dcf3d541cffbc4a7444068392002ed50.png",
"audio": "https://teach.cdn.ireadabc.com/646dfb31647d9c53d956d9cc9828c05f.mp3",
"text": "",
"right": false
},
{
"type": "txt",
"image": "",
"audio": "https://teach.cdn.ireadabc.com/73dae647c4099fe65bc28f568e351e96.mp3",
"text": "apples",
"right": false
},
{
"type": "txt",
"image": "",
"audio": "https://teach.cdn.ireadabc.com/646dfb31647d9c53d956d9cc9828c05f.mp3",
"text": "cookies",
"right": false
}
]
}
]
} }
\ No newline at end of file
...@@ -93,6 +93,34 @@ ...@@ -93,6 +93,34 @@
</div> </div>
</div> </div>
<div style="padding: 10px;background-color: #fff;">
<!-- 标题区 -->
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<div class="word-input-title">
<div>
<span>游戏背景音乐: </span>
</div>
<div>
<span style="color:rgb(201, 200, 200);margin-left:5px;font-size: 10px;"> *可不传,不传既无背景音乐</span>
</div>
</div>
<div style="display:flex ;margin-top: 10px;">
<div>
<app-audio-recorder [audioUrl]="item.bgAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'bgAudio',item,'audioBgName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.audioBgName}}</span>
</div>
<div style="margin: 5px">
<span style="color: #169BD5;text-decoration: underline;" type="button" nzDanger
(click)="deleteBgAudio()">删除背景音</span>
</div>
</div>
</div>
</div>
<div class="border-dashed" style="margin: 20px;width: 1000px;"> <div class="border-dashed" style="margin: 20px;width: 1000px;">
<div style="font-size: 20px;">游戏模式: </div> <div style="font-size: 20px;">游戏模式: </div>
<nz-radio-group [(ngModel)]="item.onlineFlg" (ngModelChange)="save()"> <nz-radio-group [(ngModel)]="item.onlineFlg" (ngModelChange)="save()">
...@@ -115,6 +143,14 @@ ...@@ -115,6 +143,14 @@
题目{{i+1}} 题目{{i+1}}
</div> </div>
<div>
<div class="word-type-option-title" style="margin-top:10px;">线索图片:</div>
<div style="width: 200px;">
<app-upload-image-with-preview [picUrl]="question.questionImg"
(imageUploaded)="onImageUploadSuccess($event, 'questionImg',question)">
</app-upload-image-with-preview>
</div>
</div>
<div> <div>
<div class="word-type-option-title" style="margin-top:10px;">题目音频:</div> <div class="word-type-option-title" style="margin-top:10px;">题目音频:</div>
...@@ -130,13 +166,6 @@ ...@@ -130,13 +166,6 @@
</div> </div>
</div> </div>
<div style="margin-top:20px">
<div class="word-type-option-title">倒计时: </div>
<input type="number" nz-input [(ngModel)]="question.duration" (blur)="save()">
</div>
<div class="word-type-option-title" style="margin-top:20px;"> <div class="word-type-option-title" style="margin-top:20px;">
选项内容: 选项内容:
</div> </div>
...@@ -220,6 +249,8 @@ ...@@ -220,6 +249,8 @@
</div> </div>
<div style="margin:0 20px"> <div style="margin:0 20px">
<button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button> <button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button>
<button class="btn-blue" style="margin-top: 10px;" nz-button nzType="default" nzDanger
(click)="copyquestion(i)">复制题目</button>
</div> </div>
</div> </div>
......
...@@ -9,17 +9,24 @@ import { MetaFormCreator } from './mataFormCreator'; ...@@ -9,17 +9,24 @@ import { MetaFormCreator } from './mataFormCreator';
}) })
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy { export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用 // 储存数据用
saveKey = "fishing"; saveKey = "beatmole";
item = { item = {
onlineFlg: false, onlineFlg: false,
title: "钓鱼大作战", title: "疯狂打地鼠",
questionText: "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", questionText: "调皮的地鼠偷走了魔法卡牌,亲爱的小玩家,请仔细听游戏指令,快速找到藏着正确魔法卡牌的地鼠,用锤子敲打它,就能夺回魔法卡牌。在本次的游戏中,你将和其他玩家进行PK,游戏结束,获得魔法卡牌数量最多的玩家,将获得胜利。最后根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", questionTextAudio: "http://staging-teach.cdn.ireadabc.com/d08192ced3bd81941d38941bb36e5042_l.mp3",
questions: [], questions: [],
bgAudio: "",
audioBgName: "",
audioName: "" audioName: ""
}; };
deleteBgAudio() {
this.item.bgAudio = "";
this.item.audioBgName = "";
this.save();
}
isVisible = false; isVisible = false;
deleteTitle = "是否删除题目"; deleteTitle = "是否删除题目";
deleteCallback = function () { }; deleteCallback = function () { };
...@@ -73,6 +80,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -73,6 +80,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() { addquestion() {
this.item.questions.push({ this.item.questions.push({
questionImg: "",
questionAudio: "", questionAudio: "",
duration: 120, duration: 120,
options: [] options: []
...@@ -80,6 +88,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -80,6 +88,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.save(); this.save();
} }
copyquestion(i) {
let data = this.item.questions[i];
this.item.questions.push(JSON.parse(JSON.stringify(data)));
this.save();
}
ngChange(i, j) { ngChange(i, j) {
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