Commit 2933a3fd authored by limingzhe's avatar limingzhe

first

parent 058295b3
......@@ -2,87 +2,66 @@
<div class="model-content">
<div nz-row nzType="flex" nzJustify="start" nzAlign="middle">
<div *ngFor="let it of picArr; let i = index"
nz-col nzSpan="8" >
<div *ngFor="let it of picArr; let i = index"
nz-col nzSpan="8" >
<div class="item-box">
<div class="item-box border" >
<app-upload-image-with-preview
style="width: 100%"
[picUrl]="it.pic_url"
(imageUploaded)="onImageUploadSuccessByItem($event, it)"
></app-upload-image-with-preview>
<div style="display: flex; align-items: center; padding-bottom: 0.5vw">
<span style="padding-right: 20px">item-{{i+1}} </span>
<span> 类型:</span>
<nz-radio-group [(ngModel)]="it.optionType" (ngModelChange)="save()">
<label nz-radio nzValue="A">文本</label>
<label nz-radio nzValue="B">图片</label>
</nz-radio-group>
</div>
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder
[audioUrl]="it.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it)">
</app-audio-recorder>
<div *ngIf="it.optionType == 'A'" style="width: 100%">
<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">
<i nz-icon type="close"></i>
</button>
</div>
</div>
<input type="text" nz-input placeholder="input text" [(ngModel)]="it.text" (blur)="saveItem()">
<!--<h5> id-{{i+1}} </h5>-->
</div>
<!--<div style="display: flex; align-items: center; justify-content: center; padding-bottom: 5px">-->
<!--<input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="saveItem()">-->
<!--<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">-->
<!--<i nz-icon type="close"></i>-->
<!--</button>-->
<!--</div>-->
<div *ngIf="it.optionType == 'B'" style="width: 100%">
<app-upload-image-with-preview
style="width: 100%"
[picUrl]="it.pic_url"
(imageUploaded)="onImageUploadSuccessByItem($event, it)"
></app-upload-image-with-preview>
<!--<app-upload-image-with-preview-->
<!--style="width: 100%"-->
<!--[picUrl]="it.pic_url"-->
<!--(imageUploaded)="onImageUploadSuccessByItem($event, it)"-->
<!--&gt;</app-upload-image-with-preview>-->
</div>
<!--<div style="display: flex; align-items: center; justify-content: center">-->
<!--<span style="width: 80px;">-->
<!--question:-->
<!--</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it['q_audio_url']"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'q')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder
[audioUrl]="it.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, it)">
</app-audio-recorder>
<!--<div style="display: flex; align-items: center; justify-content: center">-->
<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">
<i nz-icon type="close"></i>
</button>
</div>
<!--<span style="width: 80px;">-->
<!--answer:-->
<!--</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it['a_audio_url']"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'a')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
</div>
</div>
<!--<nz-radio-group [(ngModel)]="it.radioValue" >-->
<!--<label nz-radio nzValue="A" (click)="radioClick(it, 'A')"> <i nz-icon nzType="check" nzTheme="outline"></i> </label>-->
<!--<label nz-radio nzValue="B" (click)="radioClick(it, 'B')"> <i nz-icon nzType="close" nzTheme="outline"></i> </label>-->
<!--</nz-radio-group>-->
</div>
</div>
......@@ -92,7 +71,7 @@
<button style=" margin: auto; width: 60%; height: 60%;" nz-button nzType="dashed" class="add-btn"
(click)="addPic()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
Add
Add Option
</button>
<!--</div>-->
......
......@@ -22,7 +22,7 @@
padding: 10px;
padding-bottom: 5vw;
padding-top: 5vw;
padding-top: 2vw;
}
......@@ -50,5 +50,12 @@
}
.border {
border-style: solid;
border-radius: 15px;
height: 30vw;
}
}
import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef} from '@angular/core';
import {
Component,
EventEmitter,
Input,
OnDestroy,
OnChanges,
OnInit,
Output,
ApplicationRef,
ChangeDetectorRef
} from '@angular/core';
......@@ -14,10 +24,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item: any;
KEY = 'hw_000';
KEY = 'dfzx_13';
questionType = 'A';
// @Input()
......@@ -35,7 +46,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
constructor(private appRef: ApplicationRef) {
constructor(private appRef: ApplicationRef,
public changeDetectorRef: ChangeDetectorRef) {
}
......@@ -60,6 +72,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console.log('~data:', data);
this.init();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
}, this.KEY);
......@@ -83,6 +99,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.contentObj.picArr = this.picArr;
}
if (!this.item.contentObj.questionType) {
this.item.contentObj.questionType = 'A';
}
console.log('item:' , this.item);
// this.picArr = this.getDefaultPicArr();
// this.item.contentObj.picArr = this.picArr;
......@@ -169,6 +189,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.picArr.push({
pic_url: '',
audio_url: '',
optionType: 'A'
// text: '',
// radioValue: 'A'
});
......
This diff is collapsed.
......@@ -19,8 +19,6 @@
src: url("../../assets/font/BRLNSDB.TTF") ;
}
//
//
//@font-face
//{
......
This diff is collapsed.
const res = [
['bg', "assets/play/bg.jpg"],
['btn_left', "assets/play/btn_left.png"],
['btn_right', "assets/play/btn_right.png"],
['text_bg', "assets/play/text_bg.png"],
['wheel_bottom', "assets/play/wheel_bottom.png"],
['start_btn', "assets/play/start_btn.png"],
['start_btn_2', "assets/play/start_btn2.png"],
['run_btn', "assets/play/run_btn.png"],
['arrow', "assets/play/arrow.png"],
['mask', "assets/play/mask.png"],
];
......@@ -13,9 +17,16 @@ const res = [
const resAudio = [
// ['click', "assets/play/music/click.mp3"],
// ['audio_bg', "assets/play/music/bg.mp3"],
['tip', "assets/play/music/tip.mp3"],
['wheel_run', "assets/play/music/wheel_run.mp3"],
// ['audio_click_level_1', "assets/play/music/click_level_1.mp3"],
// ['audio_click_level_2', "assets/play/music/click_level_2.mp3"],
// ['audio_right', "assets/play/music/right.mp3"],
// ['audio_wrong', "assets/play/music/wrong.mp3"],
// ['audio_show_window', "assets/play/music/show_window.mp3"],
// ['audio_tip', "assets/play/music/tip.mp3"],
// ['audio_wheel_run', "assets/play/music/wheel_run.mp3"],
];
......
src/assets/play/bg.jpg

25.8 KB | W: | H:

src/assets/play/bg.jpg

124 KB | W: | H:

src/assets/play/bg.jpg
src/assets/play/bg.jpg
src/assets/play/bg.jpg
src/assets/play/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
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