Commit eaeb36f1 authored by Tt's avatar Tt

表单完成

parent ac5fa9c1
This diff is collapsed.
......@@ -93,6 +93,34 @@
</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 style="font-size: 20px;">游戏模式: </div>
<nz-radio-group [(ngModel)]="item.onlineFlg" (ngModelChange)="save()">
......@@ -115,6 +143,14 @@
题目{{i+1}}
</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 class="word-type-option-title" style="margin-top:10px;">题目音频:</div>
......@@ -130,13 +166,6 @@
</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>
......@@ -220,6 +249,8 @@
</div>
<div style="margin:0 20px">
<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>
......
......@@ -9,17 +9,24 @@ import { MetaFormCreator } from './mataFormCreator';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "fishing";
saveKey = "beatmole";
item = {
onlineFlg: false,
title: "钓鱼大作战",
questionText: "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3",
title: "疯狂打地鼠",
questionText: "调皮的地鼠偷走了魔法卡牌,亲爱的小玩家,请仔细听游戏指令,快速找到藏着正确魔法卡牌的地鼠,用锤子敲打它,就能夺回魔法卡牌。在本次的游戏中,你将和其他玩家进行PK,游戏结束,获得魔法卡牌数量最多的玩家,将获得胜利。最后根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/d08192ced3bd81941d38941bb36e5042_l.mp3",
questions: [],
bgAudio: "",
audioBgName: "",
audioName: ""
};
deleteBgAudio() {
this.item.bgAudio = "";
this.item.audioBgName = "";
this.save();
}
isVisible = false;
deleteTitle = "是否删除题目";
deleteCallback = function () { };
......@@ -73,6 +80,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() {
this.item.questions.push({
questionImg: "",
questionAudio: "",
duration: 120,
options: []
......@@ -80,6 +88,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this.save();
}
copyquestion(i) {
let data = this.item.questions[i];
this.item.questions.push(JSON.parse(JSON.stringify(data)));
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