Commit 1ed900a9 authored by Tt's avatar Tt

游戏后台配置完成

parent 4973c0b8
......@@ -25,160 +25,63 @@
<div style="width: 100%; align-items:center;">
<!-- <span style="font-weight: 500; font-size: 27px; color: red; ">选项</span> -->
<div class="item-box" style="width: 50%;height:200px; margin-left: 25%; margin-top: 10%;">
<span>文字</span>
<input style="width: 80%; margin-bottom: 0.5vw" type="text" nz-input placeholder="" [(ngModel)]="item.title"
(blur)="saveItem()">
<div>
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)">
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)"
[skeJsonData]="item.imgAni.ske" [texJsonData]="item.imgAni.tex" [texPngData]="item.imgAni.png">
</app-upload-dragon-bone>
</div>
<span>文字</span>
<input style="width: 80%; margin-bottom: 0.5vw" type="text" nz-input placeholder=""
[(ngModel)]="item.title" (blur)="saveItem()">
<span>图片</span>
<app-upload-image-with-preview style="width: 100%" [picUrl]="item.bgImg"
(imageUploaded)="onImageUploadSuccessByItem($event, item)">
</app-upload-image-with-preview>
</div>
<div class="item-box" style="width: 50%; margin-left: 25%;">
<button style="margin-bottom: 10px;" nz-button nzType="danger"
(click)="deleteItem(i)">
<span>删除</span>
</button>
</div>
</div>
</div>
</div>
<!--
<div class="box-dbt-0">
<div style="width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;">
<span style="font-weight: 700; font-size: 30px; vertical-align:middle;">标题:</span>
<input (blur)="saveItem()" [(ngModel)]="biaoti.title" type="text"
style="width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;" />
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder [audioUrl]="biaoti.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, biaoti)">
<app-audio-recorder [audioUrl]="item.wordAudio"
(audioUploaded)="onAudioUploadSuccessByItem($event, item)">
</app-audio-recorder>
</div>
</div>
</div>
<div class="box-dbt-1">
<div *ngFor="let zhulei of biaoti.child; let b = index">
<div class="box-lbt-0">
<div style="width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;">
<span style="font-weight: 700; font-size: 30px; vertical-align:middle;">主类:</span>
<input (blur)="saveItem()" [(ngModel)]="zhulei.title" type="text"
style="width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;" />
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder [audioUrl]="zhulei.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, zhulei)">
</app-audio-recorder>
</div>
</div>
</div>
<div class="box-lbt-1">
<div *ngFor="let fenlei of zhulei.child; let c = index">
<div class="box-lbt-0">
<div style="width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;">
<span style="font-weight: 700; font-size: 30px; vertical-align:middle;">分类{{c+1}}:</span>
<input (blur)="saveItem()" [(ngModel)]="fenlei.title" type="text"
style="width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;" />
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder [audioUrl]="fenlei.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, fenlei)">
</app-audio-recorder>
</div>
</div>
</div>
<div class="box-lbt-1">
<div *ngFor="let sonlei of fenlei.child; let d = index">
<div class="box-son-0">
<div>
<div
style="width:100%;vertical-align:middle; padding-top: 10px; padding-bottom: 10px; text-align: left;">
<span
style="font-weight: 700; font-size: 30px; vertical-align:middle;">分类{{c+1}}-子类{{d+1}}:</span>
<button style="margin-left: 30px;" nz-button nzType="danger" (click)="deleteSon(a, b, c,d)">
<div class="item-box" style="width: 50%; margin-left: 25%;
margin-top: 30px;">
<button style="margin-bottom: 10px;" nz-button nzType="danger" (click)="deleteItem(i)">
<span>删除</span>
</button>
<input (blur)="saveItem()" [(ngModel)]="sonlei.title" type="text"
style="width: 750px;height:35px;margin-left: 30px; vertical-align:middle;font-size: 30px; border: 1px solid #ccc; border-radius: 10px;" />
<div style="display: flex; justify-items: center; padding-top: 10px">
<app-audio-recorder [audioUrl]="sonlei.audio_url"
(audioUploaded)="onAudioUploadSuccessByItem($event, sonlei)">
</app-audio-recorder>
</div>
</div>
</div>
</div>
<div class="box-son-1">
<div class="group-item">
<div *ngFor="let it of sonlei.child; let e = index">
<div class="border">
<div style="width: 100%; align-items:center;">
<span style="font-weight: 500; font-size: 27px; color: red; ">选项{{e+1}}</span>
<div class="item-box" style="width: 50%;height:200px; margin-left: 25%; margin-top: 10%;">
<span>文字</span>
<input style="width: 80%; margin-bottom: 0.5vw" type="text" nz-input placeholder=""
[(ngModel)]="it.title" (blur)="saveItem()">
<span>图片</span>
<app-upload-image-with-preview style="width: 100%" [picUrl]="it.pic_url"
(imageUploaded)="onImageUploadSuccessByItem($event, it)">
</app-upload-image-with-preview>
</div>
<div class="item-box" style="width: 50%; margin-left: 25%;">
<button style="margin-bottom: 10px;" nz-button nzType="danger"
(click)="deleteItem(a,b,c,d,e)">
<span>删除</span>
</button>
</div>
</div>
<div>
<!-- http://localhost:4200/?type=form
一组游戏
一个图片动画
一个文字动画
一个文字声音
一个图片背景
不限制组的数量 -->
</div>
</div>
<div class="border">
<h3 style="margin-top: 40%; width: 100%; line-height: 40px; text-align: center; color: red;">
每个子类卡片2~4个
</h3>
<button *ngIf="picArr[a].child[b].child[c].child[d].child.length >= 4" disabled nz-button
nzType="primary" (click)="addItem(a,b,c,d)">
<span>增加卡片</span>
</button>
<button *ngIf="picArr[a].child[b].child[c].child[d].child.length < 4" nz-button nzType="primary"
(click)="addItem(a,b,c,d)">
<span>增加卡片</span>
</button>
</div>
</div>
</div>
</div>
<div class="box-lbt-2">
<button
*ngIf="picArr[a].child[b].child[c].child.length >= 4 || picArr[a].child[b].child[0].child.length + picArr[a].child[b].child[1].child.length >=6"
style="width: 100%; height: 100%; border-radius: 25px; " disabled nz-button nzType="solid"
(click)="addSon(a, b, c)">
<i nz-icon nzType="plus-circle"></i>
<span style="font-size: 20px;">增加子类</span>
</button>
<button
*ngIf="picArr[a].child[b].child[c].child.length < 4 && picArr[a].child[b].child[0].child.length + picArr[a].child[b].child[1].child.length <6"
style="width: 100%; height: 100%; border-radius: 25px; " nz-button nzType="solid"
(click)="addSon(a, b, c)">
<i nz-icon nzType="plus-circle"></i>
<span style="font-size: 20px;">增加子类</span>
<div style="width: 100%; align-items:center;">
<div class="item-box" style="width: 50%; margin-left: 25%;
margin-top: 30px;">
<button style="margin-bottom: 10px;" nz-button nzType="default" (click)="addItem(i)">
<span>增加</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
......
......@@ -68,9 +68,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
classItem() {
function AniAssets() {
this.ske = "";
this.tex = "";
this.png = "";
this.ske = {};
this.tex = {};
this.png = {};
this.setData = function (obj) {
this.ske = obj.ske;
this.tex = obj.tex;
......@@ -83,7 +83,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.bgImg = "";
this.wordAudio = "";
this.imgAni = new AniAssets();
this.wordAni = new AniAssets();
}
return new Item();
......@@ -103,21 +102,14 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
cardItemData() {
return {
// cardId: "",
// title: "",
// pic_url: "",
// audio_url: "",
};
return this.classItem()
}
getDefaultPicArr() {
let arr = [this.classItem(), this.classItem(), this.classItem(), this.classItem()]
let arr = [this.classItem()]
return arr;
}
initData() {
......@@ -129,12 +121,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
onImageUploadSuccessByItem(e, item) {
item.pic_url = e.url;
item.bgImg = e.url;
this.save();
}
onAudioUploadSuccessByItem(e, item) {
item.audio_url = e.url;
item.wordAudio = e.url;
this.save();
}
......
This diff is collapsed.
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