Commit e4ce7880 authored by 李维's avatar 李维

dev commit

parent 8a51c964
<div class="model-content">
<div style="padding: 20px">
<div style="position: absolute; left: 200px; top: 100px; width: 800px;">
<div>
<!--<h2>组:</h2>-->
<h3> 泡泡: </h3>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
<div *ngFor="let it of item.picArr; let i = index" style="padding: 10px; border: 1px solid #ccc; border-radius: 10px; width: 520px; margin-bottom: 20px">
<app-upload-image-with-preview
[picUrl]="item.pic_url"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')"
></app-upload-image-with-preview>
<div style=" display: flex; align-items: center;">
<div style="width: 200px; margin-right: 10px; display: flex; justify-content: center; flex-direction: column">
<h4>组-{{i+1}}: </h4>
<input type="text" nz-input [(ngModel)]="it.text" (blur)="save()">
<app-audio-recorder
style="margin-top: 5px"
[audioUrl]="it.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url', it)"
></app-audio-recorder>
<button style="width: 150px; margin-top: 5px" nz-button nzType="danger" (click)="deletePic(i)">
删除
</button>
</div>
<div style="width: 260px">
<app-upload-image-with-preview
[picUrl]="it.pic_url"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url', it)"
></app-upload-image-with-preview>
</div>
</div>
</div>
</div>
<app-audio-recorder
[audioUrl]="item.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"
></app-audio-recorder>
<app-custom-hot-zone></app-custom-hot-zone>
<app-upload-video></app-upload-video>
<app-lesson-title-config></app-lesson-title-config>
<div *ngIf="item.picArr.length < 14">
<button style="width: 180px; height: 70px;" nz-button nzType="dashed" (click)="addPic()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加组
</button>
</div>
<div style="width: 700px">
<nz-divider></nz-divider>
</div>
<div>
<h3> 格子: </h3>
<div style="margin-top: 10px">
<!--<span> 宽: </span>-->
<!--<nz-input-number [(ngModel)]="item.logicX" [nzMin]="2" [nzMax]="10" [nzStep]="1" (nzBlur)="gridSizeSave()"></nz-input-number>-->
<!--<span style="margin-left: 10px"> 高: </span>-->
<!--<nz-input-number [(ngModel)]="item.logicY" [nzMin]="2" [nzMax]="10" [nzStep]="1" (nzBlur)="gridSizeSave()"></nz-input-number>-->
</div>
<div style="margin-top: 10px; display: flex">
<div *ngFor="let oneRow of item.grid; let x = index" >
<div *ngFor="let oneGrid of oneRow; let y = index" style="padding: 2px;">
<input style="width: 38px" [maxLength]="1" type="text" nz-input [(ngModel)]="oneGrid.text" (blur)="save()" >
</div>
</div>
</div>
</div>
</div>
<!--<div style="position: absolute; left: 200px; top: 100px; width: 800px;">-->
<!--<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">-->
<!--<app-upload-image-with-preview-->
<!--[picUrl]="item.pic_url"-->
<!--(imageUploaded)="onImageUploadSuccess($event, 'pic_url')"-->
<!--&gt;</app-upload-image-with-preview>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="item.audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"-->
<!--&gt;</app-audio-recorder>-->
<!--<app-custom-hot-zone></app-custom-hot-zone>-->
<!--<app-upload-video></app-upload-video>-->
<!--<app-lesson-title-config></app-lesson-title-config>-->
<!--</div>-->
</div>
\ No newline at end of file
......@@ -10,7 +10,7 @@ import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, Ap
export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "test_0011";
saveKey = "Datakey_LST03";
// 储存对象
item;
......@@ -30,6 +30,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (data) {
this.item = data;
}
console.log('data:', data);
this.init();
this.changeDetectorRef.markForCheck();
......@@ -50,7 +51,16 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init() {
if (!this.item.logicX) {
this.item.logicX = 10;
}
if (!this.item.logicY) {
this.item.logicY = 10;
}
if (!this.item.picArr) {
this.item.picArr = [];
}
this.gridSizeSave();
}
......@@ -58,9 +68,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存图片数据
* @param e
*/
onImageUploadSuccess(e, key) {
this.item[key] = e.url;
onImageUploadSuccess(e, key, item = null) {
if (item == null) {
item = this.item;
}
item[key] = e.url;
this.save();
}
......@@ -68,9 +80,63 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, key) {
onAudioUploadSuccess(e, key, item = null) {
if (item == null) {
item = this.item;
}
item[key] = e.url;
this.save();
}
addPic() {
console.log(' in add Pic');
if (!this.item.picArr) {
this.item.picArr = [];
}
this.item.picArr.push(
{
text: '',
audio_url: '',
pic_url: ''
}
)
this.save();
}
deletePic(index) {
this.item.picArr.splice(index, 1);
this.save();
}
gridSizeSave() {
console.log(' in gridSizeSave')
if (!this.item.grid) {
this.item.grid = [];
}
const w = Number(this.item.logicX);
const h = Number(this.item.logicY);
this.item.grid.length = w;
for (let i = 0; i < w; i ++) {
if (!this.item.grid[i]) {
this.item.grid[i] = [];
}
this.item.grid[i].length = h;
for (let j = 0; j < h; j++) {
if (!this.item.grid[i][j]) {
this.item.grid[i][j] = {};
}
}
}
this.item[key] = e.url;
this.save();
}
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
@font-face
{
font-family: 'BRLNSDB';
src: url("../../assets/font/BRLNSDB.TTF") ;
font-family: 'MMTextBook-Bold';
src: url("../../assets/font/MMTextBook-Bold.otf") ;
}
<div class="game-container" #wrap>
<canvas id="canvas" #canvas></canvas>
</div>
<label style="position: absolute; top: 0px; opacity: 0; font-family: 'MMTextBook-Bold'">1</label>
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"],
['bg', "assets/play/bg_bg.png"],
['bg_right', "assets/play/bg_container_1.png"],
['bubble_frame', "assets/play/bg_picdi.png"],
['bubble_bg', "assets/play/bg_bubble_select.png"],
['stone', "assets/play/bg_bian2.png"],
['letter_bg', "assets/play/bg_didoor.png"],
['grid_bg', "assets/play/bg_di.png"],
['start_btn', "assets/play/btn_start.png"],
['bg_tree', "assets/play/bg_tree.png"],
['star_1', "assets/play/frame/bg_star1.png"],
['star_2', "assets/play/frame/bg_star2.png"],
['star_3', "assets/play/frame/bg_star3.png"],
['star_4', "assets/play/frame/bg_star4.png"],
['star_5', "assets/play/frame/bg_star5.png"],
['star_6', "assets/play/frame/bg_star6.png"],
['star_7', "assets/play/frame/bg_star7.png"],
['star_8', "assets/play/frame/bg_star8.png"],
['star_9', "assets/play/frame/bg_star9.png"],
['star_10', "assets/play/frame/bg_star10.png"],
['star_11', "assets/play/frame/bg_star11.png"],
['star_12', "assets/play/frame/bg_star12.png"],
['star_13', "assets/play/frame/bg_star13.png"],
['star_14', "assets/play/frame/bg_star14.png"],
['star_15', "assets/play/frame/bg_star15.png"],
['star_16', "assets/play/frame/bg_star16.png"],
['star_17', "assets/play/frame/bg_star17.png"],
['star_18', "assets/play/frame/bg_star18.png"],
['wave_1', "assets/play/bg_ye1.png"],
['wave_2', "assets/play/bg_ye2.png"],
['wave_3', "assets/play/bg_ye3.png"],
['petal_1', "assets/play/petal_1.png"],
['petal_2', "assets/play/petal_2.png"],
['petal_3', "assets/play/petal_3.png"],
['star', "assets/play/icon_star.png"],
['restart_btn', "assets/play/btn_restart.png"],
['apple', "assets/play/default/apple.png"],
['icon_axe', "assets/play/icon_axe.png"],
['bg_color_bubble', "assets/play/bg_color_bubble.png"],
['bg_worddi', "assets/play/bg_worddi.png"],
];
......@@ -11,8 +50,15 @@ const res = [
const resAudio = [
['apple', "assets/play/default/apple.mp3"],
['click', "assets/play/music/click.mp3"],
['btn', "assets/play/music/btn.mp3"],
['finish', "assets/play/music/finish.mp3"],
['right', "assets/play/music/right.mp3"],
['star', "assets/play/music/star.mp3"],
['stone', "assets/play/music/stone.mp3"],
['wrong', "assets/play/music/wrong.mp3"],
['open_door', "assets/play/music/open_door.mp3"],
];
export {res, resAudio};
......@@ -3,6 +3,12 @@
<head>
<meta charset="utf-8">
<title>NgOne</title>
<style>
html, body{
width: 100%;
height: 100%;
}
</style>
<base href="/">
<!-- <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<meta name="viewport" content="width=device-width, initial-scale=1">
......
/* You can add global styles to this file, and also import other style files */
@import "~ng-zorro-antd/ng-zorro-antd.min.css";
\ No newline at end of file
......@@ -3,6 +3,7 @@
"rules": {
"array-type": false,
"arrow-parens": false,
"no-string-literal": false,
"deprecation": {
"severity": "warning"
},
......
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