Commit 5a3a9ffe authored by Tt's avatar Tt

基础拷贝

parent 4b676644
No preview for this file type
......@@ -9,7 +9,7 @@ export class ComponentBase {
ngOnChanges() { }
ngOnDestroy() { }
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) { }
constructor(public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) { }
ngOnInit() {
// 获取存储的数据
(<any>window).courseware.getData((data) => {
......
......@@ -76,9 +76,11 @@
<div style="padding: 10px;background-color: #fff;">
<div class="border-dashed" style="margin: 20px;width: 1300px;">
<span style="font-size: 20px;">标题: </span>
<span style="font-size: 20px;">小迪标题: </span>
<input type="text" nz-input [(ngModel)]="item.npcTitle" (blur)="save()">
<span style="font-size: 20px;">npc音频: </span>
<span style="font-size: 20px;">小迪开始音频: </span>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.npcAudio"
......@@ -89,20 +91,22 @@
<span>{{ item.npcAudioName}}</span>
</div>
</div>
<span style="font-size: 20px;">小迪结束音频: </span>
<div style="display:flex ;">
<div>
<app-audio-recorder [audioUrl]="item.npcAudioEnd"
(audioUploaded)="onAudioUploadSuccess($event, 'npcAudioEnd',item,'npcAudioEndName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>{{ item.npcAudioEndName}}</span>
</div>
</div>
<span style="font-size: 20px;">掌握单词数: </span>
<input type="text" nz-input [(ngModel)]="item.word_count" (blur)="save()">
<span style="font-size: 20px;">掌握短语数: </span>
<input type="text" nz-input [(ngModel)]="item.sentence_count" (blur)="save()">
<span style="font-size: 20px;">掌握字数: </span>
<input type="text" nz-input [(ngModel)]="item.zi_count" (blur)="save()">
</div>
<div style="margin: 20px;width: 1300px;">
<div *ngFor="let question of item.questions; let i = index">
<div style="display: flex;margin-top: 20px;">
......@@ -111,29 +115,12 @@
题目{{i+1}}
</div>
<div class="option-audio">
<div class="word-input-title">
结束音频:
</div>
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="question.audioUrl"
(audioUploaded)="onAudioUploadSuccess($event, 'audioUrl', question,'audioName')">
</app-audio-recorder>
</div>
<div style="margin: 5px">
<span>
{{ question.audioName}}
</span>
</div>
</div>
<div class="border-dashed" style="margin: 20px;width: 1200px;">
<h2>热区配置:</h2>
<app-custom-hot-zone [bgItem]="question.bgItem" [hotZoneItemArr]="question.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(question, $event)">
</app-custom-hot-zone>
</div>
<div class="border-dashed" style="margin: 20px;width: 1200px;">
<h2>热区配置:</h2>
<app-custom-hot-zone [bgItem]="question.bgItem" [hotZoneItemArr]="question.hotZoneItemArr"
(save)="saveHotZone(question, $event)">
</app-custom-hot-zone>
</div>
</div>
......@@ -142,26 +129,27 @@
</div>
</div>
<div style="margin-top: 20px;">
<button class="btn-blue" style="width: 1300px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button>
</div>
</div>
<div style="margin-top: 20px;">
<button class="btn-blue" style="width: 1300px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button>
</div>
</div>
</div>
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="null" [nzContent]="modalContent" [nzFooter]="modalFooter"
(nzOnCancel)="handleCancel()">
<ng-template #modalContent>
<p>{{deleteTitle}}</p>
</ng-template>
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button nz-button nzType="primary" (click)="handleOk()">确定</button>
</ng-template>
</nz-modal>
<nz-modal [(nzVisible)]="isVisible" [nzTitle]="null" [nzContent]="modalContent" [nzFooter]="modalFooter"
(nzOnCancel)="handleCancel()">
<ng-template #modalContent>
<p>{{deleteTitle}}</p>
</ng-template>
<ng-template #modalFooter>
<button nz-button nzType="default" (click)="handleCancel()">取消</button>
<button nz-button nzType="primary" (click)="handleOk()">确定</button>
</ng-template>
</nz-modal>
</div>
\ No newline at end of file
......@@ -10,7 +10,7 @@ import { NzMessageService } from 'ng-zorro-antd';
})
export class FormComponent extends ComponentBase implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "hy05_pintu";
saveKey = "dg18_tianci";
// 1.猫动画可替换。
// 2.文本内容可替换。//字体随内容缩小。
......@@ -96,44 +96,16 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
item = {
npcTitle: "",
npcAudio: "",
npcAudioName: '',
tipSwitch: 1,//提示功能开关
tipType: "page",
tipBg: '',
tipPage: [{ title: '', audio: '' }],
title: "",
audio: "",
audioName: "",
image: '',
jumpIdx: '',
// endImgAni: {
// ske: {},
// tex: {},
// png: {}
// },
// endImgTitle: "",
points: "",
questionScore: 0,//分数
npcAudioName: "",
npcAudioEnd: "",
npcAudioEndName: "",
questions: [],
bgItem: '',
hotZoneItemArr: [],
word_count: '0',
sentence_count: '0',
zi_count: '0',
questionText: "",
};
constructor(public nzMessageService: NzMessageService, public appRef: ApplicationRef, public changeDetectorRef: ChangeDetectorRef) {
......@@ -157,10 +129,6 @@ 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) {
......@@ -191,11 +159,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
removePage(idx) {
this.item.tipPage.splice(idx, 1);
this.save();
}
addPage() {
this.item.tipPage.push({ title: "", audio: "" })
this.save();
}
customRadioChange(e, item, key) {
......
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