Commit bd3618b5 authored by 李维's avatar 李维

dev done

parent 22ec6f5d
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
"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",
"node-sass": "4.0.0",
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"zone.js": "~0.10.2", "uuid": "^8.3.2",
"node-sass": "4.0.0" "zone.js": "~0.10.2"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.900.3", "@angular-devkit/build-angular": "~0.900.3",
......
...@@ -20,101 +20,38 @@ ...@@ -20,101 +20,38 @@
<app-audio-recorder id="index_audio_1" [audioUrl]="title.mainTextAudio_url" (audioUploaded)="onAudioUploadSuccess($event, 'mainTextAudio_url', title)" ></app-audio-recorder> <app-audio-recorder id="index_audio_1" [audioUrl]="title.mainTextAudio_url" (audioUploaded)="onAudioUploadSuccess($event, 'mainTextAudio_url', title)" ></app-audio-recorder>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="2">长音频</nz-form-label>
<nz-form-control [nzSpan]="4">
<app-audio-recorder id="index_audio_1" [audioUrl]="long_audio.audio_url" (audioUploaded)="onAudioUploadSuccess($event, 'audio_url', long_audio)" ></app-audio-recorder>
</nz-form-control>
</nz-form-item>
</div> </div>
<div class="section" style="padding: 1rem;"> <div class="section" style="padding: 1rem;">
<div *ngIf="dataArray.length==0" style="font-style: italic;"> <div *ngIf="dataArray.length==0" style="font-style: italic;">
请新建单词 请新建问答
</div> </div>
<div ngfor *ngFor="let item of dataArray; let i = index" class="section-content" style="border-bottom: 1px dashed #ccc; padding-bottom: 5px; display: flex;"> <div ngfor *ngFor="let item of dataArray; let i = index" class="section-content" style="border-bottom: 1px dashed #ccc; padding-bottom: 5px;">
<div style="flex:1"> <h3>-{{i+1}}-</h3>
<div class="form-item" style="margin-bottom: 10px;"> <nz-form-item>
<p> <nz-form-label [nzSpan]="2">问题</nz-form-label>
<span>序号</span> <nz-form-control [nzSpan]="12">
<strong>{{i+1}}</strong> <textarea rows="4" nz-input [(ngModel)]="item.questionText" (blur)="saveItem()"></textarea>
</p> </nz-form-control>
</div> <nz-form-label [nzSpan]="2">题号</nz-form-label>
<div class="form-item" style="margin-bottom: 10px;"> <nz-form-control [nzSpan]="8">
<p> <app-audio-recorder [audioUrl]="item.audio_url_question"
<span>音频-左</span> (audioUploaded)="onAudioUploadSuccess($event, 'audio_url_question',item)">
<app-audio-recorder [audioUrl]="item.audio_url_left" </app-audio-recorder>
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url_left',item)"> </nz-form-control>
</app-audio-recorder> </nz-form-item>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>单词-左</span>
<input type="text" nz-input placeholder="" maxlength="3" [(ngModel)]="item.text_left" (blur)="saveItem()" />
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>图片-左</span>
<app-upload-image-with-preview [picUrl]="item.image_url_left"
(imageUploaded)="onImageUploadSuccess($event, 'image_url_left', item)"></app-upload-image-with-preview>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>反转后图片</span>
<app-upload-image-with-preview [picUrl]="item.image_url_back" (imageUploaded)="onImageUploadSuccess($event, 'image_url_back', item)"></app-upload-image-with-preview>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<button style="margin-bottom: 10px;" nz-button nzType="danger" (click)="deleteItem(i)">
<span>删除</span>
</button>
</div>
</div>
<div style="flex:1"> <nz-form-item>
<div class="form-item" style="margin-bottom: 10px;"> <nz-form-label [nzSpan]="2">题号</nz-form-label>
<p> <nz-form-control [nzSpan]="12">
<span>卡片颜色</span> <textarea rows="4" nz-input [(ngModel)]="item.answerText" (blur)="saveItem()"></textarea>
<nz-select [(ngModel)]="item.bgColorType" style="width: 150px;" (ngModelChange)="saveItem()"> </nz-form-control>
<nz-option nzValue="g_g" nzLabel="左绿色-右绿色"></nz-option> <nz-form-label [nzSpan]="2">题号</nz-form-label>
<nz-option nzValue="g_p" nzLabel="左绿色-右粉色"></nz-option> <nz-form-control [nzSpan]="8">
<nz-option nzValue="p_p" nzLabel="左粉色-右粉色"></nz-option> <app-audio-recorder [audioUrl]="item.audio_url_answer"
<nz-option nzValue="p_g" nzLabel="左粉色-右绿色"></nz-option> (audioUploaded)="onAudioUploadSuccess($event, 'audio_url_answer',item)">
</nz-select> </app-audio-recorder>
</p> </nz-form-control>
</div> </nz-form-item>
<div class="form-item" style="margin-bottom: 10px;">
<p>
<span>音频-右</span>
<app-audio-recorder [audioUrl]="item.audio_url_right"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url_right',item)">
</app-audio-recorder>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>单词-右</span>
<input type="text" nz-input placeholder="" maxlength="3" [(ngModel)]="item.text_right" (blur)="saveItem()" />
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>图片-右</span>
<app-upload-image-with-preview [picUrl]="item.image_url_right"
(imageUploaded)="onImageUploadSuccess($event, 'image_url_right', item)"></app-upload-image-with-preview>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;">
<p>
<span>反转后音频</span>
<app-audio-recorder [audioUrl]="item.audio_url_back" (audioUploaded)="onAudioUploadSuccess($event, 'audio_url_back', item)" ></app-audio-recorder>
</p>
</div>
<div class="form-item" style="margin-bottom: 10px; max-width: 400px;"></div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -122,7 +59,7 @@ ...@@ -122,7 +59,7 @@
<div class="card-item" style="padding: 0.5vw; width: 500px;"> <div class="card-item" style="padding: 0.5vw; width: 500px;">
<button nz-button [disabled]="dataArray.length>=8" nzType="primary" class="add-btn" (click)="addItem()"> <button nz-button [disabled]="dataArray.length>=8" nzType="primary" class="add-btn" (click)="addItem()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
新建词组 新建问答
</button> </button>
</div> </div>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
width: 100%; width: 100%;
} }
.section-content{ .section-content{
display: flex;
margin: 5px 0 10px 0; margin: 5px 0 10px 0;
} }
} }
......
...@@ -28,9 +28,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -28,9 +28,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"mainText": "", "mainText": "",
"mainTextAudio_url": "" "mainTextAudio_url": ""
}; };
long_audio = {
audio_url: ""
};
@Output() @Output()
update = new EventEmitter(); update = new EventEmitter();
...@@ -68,7 +65,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -68,7 +65,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init() { init() {
const fields = ["dataArray", "title", "long_audio"] const fields = ["dataArray", "title"]
if(typeof(this.item.contentObj.dataArray) == undefined || typeof(this.item.contentObj.grid) == undefined || typeof(this.item.contentObj.title) == undefined || this.item.contentObj.version != defaultData.version) { if(typeof(this.item.contentObj.dataArray) == undefined || typeof(this.item.contentObj.grid) == undefined || typeof(this.item.contentObj.title) == undefined || this.item.contentObj.version != defaultData.version) {
console.log("Init defalue data") console.log("Init defalue data")
this.item.contentObj = defaultData this.item.contentObj = defaultData
...@@ -81,7 +78,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -81,7 +78,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
addItem() { addItem() {
this.dataArray.push({bgColorType: "", image_url_back: "", audio_url_back: "", image_url_left: "", image_url_right: "", audio_url_left: "", audio_url_right: "", text_left: "", text_right: "" }) this.dataArray.push({questionText: "", audio_url_question: "", answerText: "", audio_url_answer: ""})
this.saveItem(); this.saveItem();
} }
......
...@@ -31,66 +31,81 @@ ...@@ -31,66 +31,81 @@
} }
@font-face{ // @font-face{
font-family: 'BRLNSDB'; // font-family: 'BRLNSDB';
src: url("../../assets/default/font/BRLNSDB.TTF") ; // src: url("../../assets/default/font/BRLNSDB.TTF") ;
} // }
@font-face{ // @font-face{
font-family: 'RoundedBold'; // font-family: 'RoundedBold';
src: url("../../assets/default/font/ArialRoundedBold.otf") ; // src: url("../../assets/default/font/ArialRoundedBold.otf") ;
} // }
@font-face{ // @font-face{
font-family: 'BRLNSB_1'; // font-family: 'BRLNSB_1';
src: url("../../assets/default/font/BerlinSansFB/BRLNSB_1.TTF") ; // src: url("../../assets/default/font/BerlinSansFB/BRLNSB_1.TTF") ;
} // }
@font-face{ // @font-face{
font-family: 'BerlinSansFBDemi-Bold'; // font-family: 'BerlinSansFBDemi-Bold';
src: url("../../assets/default/font/BerlinSansFB/BRLNSDB_1.TTF") ; // src: url("../../assets/default/font/BerlinSansFB/BRLNSDB_1.TTF") ;
} // }
@font-face{ // @font-face{
font-family: 'BRLNSR_1'; // font-family: 'BRLNSR_1';
src: url("../../assets/default/font/BerlinSansFB/BRLNSR_1.TTF") ; // src: url("../../assets/default/font/BerlinSansFB/BRLNSR_1.TTF") ;
} // }
// @font-face{
// font-family: 'GOTHIC_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHIC_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICB_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICB_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICBI_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICBI_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICI_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICI_1.TTF") ;
// }
// @font-face{
// font-family: 'MMTextBook';
// src: url("../../assets/default/font/MMTextBook/MMTextBook.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-Bold';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-Bold.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-BoldItalic';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-BoldItalic.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-Italic';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-Italic.otf") ;
// }
@font-face{
font-family: 'GOTHIC_1';
src: url("../../assets/default/font/CenturyGothic/GOTHIC_1.TTF") ;
}
@font-face{
font-family: 'GOTHICB_1';
src: url("../../assets/default/font/CenturyGothic/GOTHICB_1.TTF") ;
}
@font-face{
font-family: 'GOTHICBI_1';
src: url("../../assets/default/font/CenturyGothic/GOTHICBI_1.TTF") ;
}
@font-face{
font-family: 'GOTHICI_1';
src: url("../../assets/default/font/CenturyGothic/GOTHICI_1.TTF") ;
}
@font-face{ @font-face{
font-family: 'MMTextBook'; font-family: 'BRLNSDB_1';
src: url("../../assets/default/font/MMTextBook/MMTextBook.otf") ; src: url("../../assets/play/font/BRLNSDB_1.ttf") ;
}
@font-face{
font-family: 'MMTextBook-Bold';
src: url("../../assets/default/font/MMTextBook/MMTextBook-Bold.otf") ;
} }
@font-face{ @font-face{
font-family: 'MMTextBook-BoldItalic'; font-family: 'DFChu-W4-WIN-BF';
src: url("../../assets/default/font/MMTextBook/MMTextBook-BoldItalic.otf") ; src: url("../../assets/play/font/DFChu-W4-WIN-BF.ttf") ;
} }
@font-face{ @font-face{
font-family: 'MMTextBook-Italic'; font-family: 'FuturaStd-Medium';
src: url("../../assets/default/font/MMTextBook/MMTextBook-Italic.otf") ; src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
} }
@font-face{ @font-face{
font-family: 'DFChu-W4-WIN-BF'; font-family: 'GOTHICB_1';
src: url("../../assets/play/font/DFChu-W4-WIN-BF.ttf") ; src: url("../../assets/play/font/GOTHICB_1.ttf") ;
} }
This diff is collapsed.
...@@ -41,6 +41,7 @@ const localImages = { ...@@ -41,6 +41,7 @@ const localImages = {
'slider_body': 'assets/play/slider_body.png', 'slider_body': 'assets/play/slider_body.png',
'slider_bottom': 'assets/play/slider_bottom.png', 'slider_bottom': 'assets/play/slider_bottom.png',
'part_number_bg': 'assets/play/part_number_bg.png', 'part_number_bg': 'assets/play/part_number_bg.png',
'bg_title_part': 'assets/play/bg_title_part.png',
}; };
......
export const defaultData = { export const defaultData = {
version: "1.0",
dataKey: "DataKey_YM5-9",
title: {
NO: "C",
mainText: "Listen, circle and write.",
mainTextAudio_url: "",
},
dataArray: [],
long_audio: {
audio_url: "",
}
};
export const demoData = {
version: "1.0", version: "1.0",
dataKey: "DataKey_YM5-9", dataKey: "DataKey_YM5-9",
title: { title: {
NO: "C", NO: "",
mainText: "Listen, circle and write.", mainText: "",
mainTextAudio_url: "", mainTextAudio_url: "",
}, },
dataArray: [],
};
export const demoData = {
version: "1.0",
dataKey: "DataKey_YM5-9",
title: { NO: "C", mainText: "Read and point", mainTextAudio_url: "" },
dataArray: [ dataArray: [
{ {
image_url: "demo_card_image_2", questionText: "Where is Mandy and Carl's backyard?",
image_url_back: "demo_popup_B", audio_url_question: "",
image_url_left: "demo_0001", answerText: "It is behind there house.",
image_url_right: "demo_0002", },
audio_url_left: "", {
audio_url_right: "", questionText: "Where is Mandy and Carl's backyard?",
text_left: "ch", audio_url_question: "",
text_right: "ph", answerText: "It is behind there house. There is a birdbath and\na windmill next to pond.",
}, audio_url_answer: "",
], },
long_audio: { {
audio_url: "", questionText: "Where is Mandy and Carl's backyard?",
} audio_url_question: "",
answerText: "It is behind there house.",
audio_url_answer: "",
},
{
questionText: "Where is Mandy and Carl's backyard?",
audio_url_question: "",
answerText: "It is behind there house.",
audio_url_answer: "",
},
{
questionText: "Where is Mandy and Carl's backyard?",
audio_url_question: "",
answerText: "It is behind there house. You can see fireflies at \nnight.",
audio_url_answer: "",
},
]
}; };
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