Commit 2933a3fd authored by limingzhe's avatar limingzhe

first

parent 058295b3
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="model-content"> <div class="model-content">
<div nz-row nzType="flex" nzJustify="start" nzAlign="middle">
<div *ngFor="let it of picArr; let i = index" <div *ngFor="let it of picArr; let i = index"
...@@ -9,15 +10,37 @@ ...@@ -9,15 +10,37 @@
<div class="item-box"> <div class="item-box border" >
<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 *ngIf="it.optionType == 'A'" style="width: 100%">
<input type="text" nz-input placeholder="input text" [(ngModel)]="it.text" (blur)="saveItem()">
</div>
<div *ngIf="it.optionType == 'B'" style="width: 100%">
<app-upload-image-with-preview <app-upload-image-with-preview
style="width: 100%" style="width: 100%"
[picUrl]="it.pic_url" [picUrl]="it.pic_url"
(imageUploaded)="onImageUploadSuccessByItem($event, it)" (imageUploaded)="onImageUploadSuccessByItem($event, it)"
></app-upload-image-with-preview> ></app-upload-image-with-preview>
</div>
<div style="display: flex; justify-items: center; padding-top: 10px"> <div style="display: flex; justify-items: center; padding-top: 10px">
...@@ -33,56 +56,12 @@ ...@@ -33,56 +56,12 @@
</div> </div>
<!--<h5> id-{{i+1}} </h5>-->
<!--<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>-->
<!--<app-upload-image-with-preview-->
<!--style="width: 100%"-->
<!--[picUrl]="it.pic_url"-->
<!--(imageUploaded)="onImageUploadSuccessByItem($event, it)"-->
<!--&gt;</app-upload-image-with-preview>-->
<!--<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; align-items: center; justify-content: center">-->
<!--<span style="width: 80px;">-->
<!--answer:-->
<!--</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it['a_audio_url']"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'a')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
</div>
<!--<nz-radio-group [(ngModel)]="it.radioValue" >--> </div>
<!--<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>
...@@ -92,7 +71,7 @@ ...@@ -92,7 +71,7 @@
<button style=" margin: auto; width: 60%; height: 60%;" nz-button nzType="dashed" class="add-btn" <button style=" margin: auto; width: 60%; height: 60%;" nz-button nzType="dashed" class="add-btn"
(click)="addPic()"> (click)="addPic()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
Add Add Option
</button> </button>
<!--</div>--> <!--</div>-->
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
padding: 10px; padding: 10px;
padding-bottom: 5vw; padding-bottom: 5vw;
padding-top: 5vw; padding-top: 2vw;
} }
...@@ -50,5 +50,12 @@ ...@@ -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 { ...@@ -14,10 +24,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item: any; _item: any;
KEY = 'hw_000'; KEY = 'dfzx_13';
questionType = 'A';
// @Input() // @Input()
...@@ -35,7 +46,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -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 { ...@@ -60,6 +72,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console.log('~data:', data); console.log('~data:', data);
this.init(); this.init();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh(); this.refresh();
}, this.KEY); }, this.KEY);
...@@ -83,6 +99,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -83,6 +99,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.contentObj.picArr = this.picArr; this.item.contentObj.picArr = this.picArr;
} }
if (!this.item.contentObj.questionType) {
this.item.contentObj.questionType = 'A';
}
console.log('item:' , this.item); console.log('item:' , this.item);
// this.picArr = this.getDefaultPicArr(); // this.picArr = this.getDefaultPicArr();
// this.item.contentObj.picArr = this.picArr; // this.item.contentObj.picArr = this.picArr;
...@@ -169,6 +189,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -169,6 +189,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.picArr.push({ this.picArr.push({
pic_url: '', pic_url: '',
audio_url: '', audio_url: '',
optionType: 'A'
// text: '', // text: '',
// radioValue: 'A' // radioValue: 'A'
}); });
......
This diff is collapsed.
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
src: url("../../assets/font/BRLNSDB.TTF") ; src: url("../../assets/font/BRLNSDB.TTF") ;
} }
//
// //
//@font-face //@font-face
//{ //{
......
This diff is collapsed.
const res = [ const res = [
['bg', "assets/play/bg.jpg"], ['bg', "assets/play/bg.jpg"],
['btn_left', "assets/play/btn_left.png"], ['wheel_bottom', "assets/play/wheel_bottom.png"],
['btn_right', "assets/play/btn_right.png"], ['start_btn', "assets/play/start_btn.png"],
['text_bg', "assets/play/text_bg.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 = [ ...@@ -13,9 +17,16 @@ const res = [
const resAudio = [ 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