Commit 5a3a9ffe authored by Tt's avatar Tt

基础拷贝

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