Commit 6e65fe8f authored by liujiangnan's avatar liujiangnan

feat

parent 749b445b
...@@ -13379,6 +13379,11 @@ ...@@ -13379,6 +13379,11 @@
"decamelize": "^1.2.0" "decamelize": "^1.2.0"
} }
}, },
"yarn": {
"version": "1.22.19",
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.22.19.tgz",
"integrity": "sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ=="
},
"yauzl": { "yauzl": {
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
......
...@@ -28,10 +28,11 @@ ...@@ -28,10 +28,11 @@
"ali-oss": "^6.5.1", "ali-oss": "^6.5.1",
"compressing": "^1.5.0", "compressing": "^1.5.0",
"ng-zorro-antd": "^8.5.2", "ng-zorro-antd": "^8.5.2",
"rxjs": "~6.5.4",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
"rxjs": "~6.5.4",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"yarn": "^1.22.19",
"zone.js": "~0.10.2" "zone.js": "~0.10.2"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -73,64 +73,29 @@ ...@@ -73,64 +73,29 @@
} }
</style> </style>
<div class="model-content"> <div class="model-content">
<div style="margin: 20px;width: 1000px;" class="border-solid">
<span style="font-size: 20px;">标题: </span>
<input type="text" nz-input [(ngModel)]="item.title" (blur)="save()">
<span style="font-size: 20px;">npc音频: </span>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.npcAudio"
(audioUploaded)="onAudioUploadSuccess($event, 'npcAudio', item)">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.npcAudioName }}</span>
</div>
</div>
</div>
<!-- 题目区 --> <!-- 题目区 -->
<div style="margin: 20px;width: 1000px;"> <div style="margin: 20px;width: 1000px;">
<div *ngFor="let question of item.questions; let i = index"> <div *ngFor="let question of item.pages; let i = index">
<div style="display: flex;margin-top: 20px;"> <div style="display: flex;margin-top: 20px;">
<div class="border-solid" style="min-width: 1000px;"> <div class="border-solid" style="min-width: 1000px;">
<div class="word-type-title"> <div class="word-type-title">
题目{{i+1}} 题目{{i+1}}
</div> </div>
<div style="margin-top: 20px;">
<div class="word-type-option-title">
是否录音:
</div>
<div style="margin-top: 5px;">
<nz-radio-group [(ngModel)]="question.isrecord" (ngModelChange)="ngChange()">
<label nz-radio [nzValue]="0">
<span>无录音</span>
</label>
<label nz-radio [nzValue]="1">
<span>需录音</span>
</label>
</nz-radio-group>
</div>
</div>
<div class="option-text"> <div class="option-text">
<div class="word-input-title"> <div class="word-input-title">
<span>题目文字1: </span> <span>文字: </span>
</div> </div>
<textarea style="font-size: 16px;" rows="2" nz-input [(ngModel)]="question.text" (blur)="save()"></textarea> <textarea style="font-size: 16px;" rows="2" nz-input [(ngModel)]="question.text" (blur)="save()"></textarea>
<div class="word-input-title">
<span>题目文字2: </span>
</div>
<textarea style="font-size: 16px;" rows="2" nz-input [(ngModel)]="question.text2" (blur)="save()"></textarea>
</div> </div>
<div class="option-audio"> <div class="option-audio">
<div class="word-input-title"> <div class="word-input-title">
题目音频1: 音频:
</div> </div>
<div style="display: flex"> <div style="display: flex">
<div> <div>
<app-audio-recorder [audioUrl]="question.audio" <app-audio-recorder [audioUrl]="question.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio',question)"></app-audio-recorder> (audioUploaded)="onAudioUploadSuccess($event, 'audio_url',question)"></app-audio-recorder>
</div> </div>
<div style="margin: 5px"> <div style="margin: 5px">
<span> <span>
...@@ -139,37 +104,13 @@ ...@@ -139,37 +104,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="option-audio">
<div class="word-input-title">
题目音频2:
</div>
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="question.audio2"
(audioUploaded)="onAudioUploadSuccess($event, 'audio2',question)"></app-audio-recorder>
</div>
<div style="margin: 5px">
<span>
{{ question.audio2Name}}
</span>
</div>
</div>
</div>
<div> <div>
<span style="font-size: 20px;">图片1: </span> <span style="font-size: 20px;">图片: </span>
<div style="width:300px"> <div style="width:300px">
<app-upload-image-with-preview [picUrl]="question.image" <app-upload-image-with-preview [picUrl]="question.pic_url"
(imageUploaded)="onImageUploadSuccess($event,'image',question)"></app-upload-image-with-preview> (imageUploaded)="onImageUploadSuccess($event,'pic_url',question)"></app-upload-image-with-preview>
</div> </div>
</div> </div>
<div>
<span style="font-size: 20px;">图片2: </span>
<div style="width:300px">
<app-upload-image-with-preview [picUrl]="question.image2"
(imageUploaded)="onImageUploadSuccess($event,'image2',question)"></app-upload-image-with-preview>
</div>
</div>
</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>
......
...@@ -14,24 +14,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -14,24 +14,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
saveKey = "read"; saveKey = "read";
// 储存对象 // 储存对象
item: any = { item: any = {
score: 0, pages: []
title: '',
npcAudio: '',
npcAudioName: '',
returnType: '0',
questionText: "",
questionType: "read",
questionTextAudio: "",
questions: [],
}; };
// item: any = {
// title: '幸运大转盘',
// questionText: "亲爱的小玩家,游戏马上就要开始啦!请动动手指转动转盘,当转盘停止,注意观察指针指向的魔法图片,并大声说出魔法咒语,魔法咒语正确,你就可以获得一张魔法卡牌。 游戏结束后,根据获得的魔法卡牌数量,你将获得相应的能量石奖励!开始挑战吧!",
// questionTextAudio: "http://staging-teach.cdn.ireadabc.com/18ebee93b3eabcd55649a01366431af7.mp3",
// questions: [],
// };
isVisible = false; isVisible = false;
deleteTitle = "是否删除题目"; deleteTitle = "是否删除题目";
deleteCallback = function () { }; deleteCallback = function () { };
...@@ -49,32 +34,23 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O ...@@ -49,32 +34,23 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
} }
addQuestion() { addQuestion() {
this.item.questions.push({ this.item.pages.push({
type: 'img', pic_url: '',
isrecord: 0, audio_url: '',
audio: '',
audio2: '',
text: '', text: '',
text2: '',
image: '',
image2: '',
time: null,
// word: '',
audioName: "",
audio2Name: "",
}); });
this.save(); this.save();
} }
removeQuestion(idx) { removeQuestion(idx) {
this.openDelete("确定删除题目?", () => { this.openDelete("确定删除题目?", () => {
this.item.questions.splice(idx, 1); this.item.pages.splice(idx, 1);
this.save(); this.save();
}) })
} }
copyQuestion(idx) { copyQuestion(idx) {
let data = this.item.questions[idx] let data = this.item.pages[idx]
this.item.questions.push(JSON.parse(JSON.stringify(data))); this.item.pages.push(JSON.parse(JSON.stringify(data)));
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