Commit b31a2b75 authored by asdf's avatar asdf

init

parent ddfebd10
...@@ -128,5 +128,8 @@ ...@@ -128,5 +128,8 @@
} }
} }
}, },
"defaultProject": "ng-template-generator" "defaultProject": "ng-template-generator",
"cli": {
"analytics": false
}
} }
\ No newline at end of file
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
"compressing": "^1.5.0", "compressing": "^1.5.0",
"ng-zorro-antd": "^8.5.2", "ng-zorro-antd": "^8.5.2",
"rxjs": "~6.5.4", "rxjs": "~6.5.4",
"sass": "1.28.0",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"tslib": "^1.10.0", "tslib": "^1.10.0",
......
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core'; import { NgModule, ErrorHandler } from '@angular/core';
import {MyErrorHandler} from './MyError'; import { MyErrorHandler } from './MyError';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd'; import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
...@@ -10,20 +10,21 @@ import { HttpClientModule } from '@angular/common/http'; ...@@ -10,20 +10,21 @@ import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common'; import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh'; import zh from '@angular/common/locales/zh';
import {FormComponent} from './form/form.component'; import { FormComponent } from './form/form.component';
import {PlayComponent} from './play/play.component'; import { PlayComponent } from './play/play.component';
import {LessonTitleConfigComponent} from './common/lesson-title-config/lesson-title-config.component'; import { LessonTitleConfigComponent } from './common/lesson-title-config/lesson-title-config.component';
import {BackgroundImagePipe} from './pipes/background-image.pipe'; import { BackgroundImagePipe } from './pipes/background-image.pipe';
import {UploadImageWithPreviewComponent} from './common/upload-image-with-preview/upload-image-with-preview.component'; import { UploadImageWithPreviewComponent } from './common/upload-image-with-preview/upload-image-with-preview.component';
import {PlayerContentWrapperComponent} from './common/player-content-wrapper/player-content-wrapper.component'; import { PlayerContentWrapperComponent } from './common/player-content-wrapper/player-content-wrapper.component';
import {CustomHotZoneComponent} from './common/custom-hot-zone/custom-hot-zone.component'; import { CustomHotZoneComponent } from './common/custom-hot-zone/custom-hot-zone.component';
import {UploadVideoComponent} from './common/upload-video/upload-video.component'; import { UploadVideoComponent } from './common/upload-video/upload-video.component';
import {TimePipe} from './pipes/time.pipe'; import { TimePipe } from './pipes/time.pipe';
import {ResourcePipe} from './pipes/resource.pipe'; import { ResourcePipe } from './pipes/resource.pipe';
import {AudioRecorderComponent} from './common/audio-recorder/audio-recorder.component'; import { AudioRecorderComponent } from './common/audio-recorder/audio-recorder.component';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'; import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons'; import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons'; import { far } from '@fortawesome/free-regular-svg-icons';
import { UploadDragonBoneComponent } from './common/upload-dragon-bone/upload-dragon-bone.component';
registerLocaleData(zh); registerLocaleData(zh);
...@@ -40,7 +41,7 @@ registerLocaleData(zh); ...@@ -40,7 +41,7 @@ registerLocaleData(zh);
TimePipe, TimePipe,
UploadVideoComponent, UploadVideoComponent,
CustomHotZoneComponent, CustomHotZoneComponent,
UploadDragonBoneComponent,
PlayerContentWrapperComponent PlayerContentWrapperComponent
], ],
...@@ -53,7 +54,7 @@ registerLocaleData(zh); ...@@ -53,7 +54,7 @@ registerLocaleData(zh);
FontAwesomeModule FontAwesomeModule
], ],
providers: [ providers: [
{provide: ErrorHandler, useClass: MyErrorHandler}, { provide: ErrorHandler, useClass: MyErrorHandler },
{ provide: NZ_I18N, useValue: zh_CN } { provide: NZ_I18N, useValue: zh_CN }
], ],
bootstrap: [AppComponent] bootstrap: [AppComponent]
......
This diff is collapsed.
...@@ -32,15 +32,63 @@ ...@@ -32,15 +32,63 @@
<nz-divider style="margin-top: 10px;"></nz-divider> <nz-divider style="margin-top: 10px;"></nz-divider>
<div style="margin-top: -20px; margin-bottom: 5px; width: 100%;">
<div *ngIf="customTypeGroupArr">
<nz-radio-group [ngModel]="it.gIdx" (ngModelChange)="customRadioChange($event, it)" style="display: flex; align-items: center; justify-content: center; flex-wrap: wrap;">
<div *ngFor="let group of customTypeGroupArr; let gIdx = index" style="display: flex; ">
<label nz-radio nzValue="{{gIdx}}">{{group.name}}</label>
</div>
</nz-radio-group>
</div>
<!-- <div *ngIf="!customTypeGroupArr">
<nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)" style="display: flex; align-items: center; justify-content: center">
<div style="margin-top: -20px; margin-bottom: 5px">
<nz-radio-group [ngModel]="it.itemType" (ngModelChange)="radioChange($event, it)">
<label *ngIf="isHasRect" nz-radio nzValue="rect">矩形</label> <label *ngIf="isHasRect" nz-radio nzValue="rect">矩形</label>
<label *ngIf="isHasPic" nz-radio nzValue="pic">图片</label> <label *ngIf="isHasPic" nz-radio nzValue="pic">图片</label>
<label *ngIf="isHasText" nz-radio nzValue="text">文本</label> <label *ngIf="isHasText" nz-radio nzValue="text">文本</label>
</nz-radio-group> </nz-radio-group>
</div> -->
</div>
<div *ngIf="customTypeGroupArr && customTypeGroupArr[it.gIdx]">
<div *ngIf="customTypeGroupArr[it.gIdx].pic">
<app-upload-image-with-preview
[picUrl]="it?.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, it)">
</app-upload-image-with-preview>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].text" style="margin-top: 5px">
<input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].anima" align="center" style="margin-top: 5px">
<button nz-button (click)="setAnimaBtnClick(i)" >
<i nz-icon nzType="tool" nzTheme="outline"></i>
配置龙骨动画
</button>
</div>
<div *ngIf="customTypeGroupArr[it.gIdx].audio" style="display: flex;align-items: center; margin-top: 5px">
<app-audio-recorder
style="margin: auto"
[audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)"
></app-audio-recorder>
</div> </div>
</div>
<!-- <div *ngIf="!customTypeGroupArr">
<div *ngIf="it.itemType == 'pic'"> <div *ngIf="it.itemType == 'pic'">
<app-upload-image-with-preview <app-upload-image-with-preview
[picUrl]="it?.pic_url" [picUrl]="it?.pic_url"
...@@ -52,13 +100,26 @@ ...@@ -52,13 +100,26 @@
<input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)"> <input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
</div> </div>
<div style="width: 100%; margin-top: 5px;"> <div *ngIf="isHasAudio"
style="width: 100%; margin-top: 5px; display: flex; align-items: center; justify-items: center;">
<app-audio-recorder <app-audio-recorder
style="margin: auto"
[audioUrl]="it.audio_url" [audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)" (audioUploaded)="onItemAudioUploadSuccess($event, it)"
></app-audio-recorder> ></app-audio-recorder>
</div> </div>
<div *ngIf="it.itemType == 'rect' && isHasAnima" align="center" style="margin-bottom: 5px">
<button nz-button (click)="setAnimaBtnClick(i)" >
<i nz-icon nzType="tool" nzTheme="outline"></i>
配置龙骨动画
</button>
</div>
</div> -->
</div> </div>
</div> </div>
...@@ -83,12 +144,29 @@ ...@@ -83,12 +144,29 @@
<div class="save-box"> <div class="save-box">
<button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round" <button style="margin-left: 200px" class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
(click)="saveClick()" > (click)="saveClick()" >
<i nz-icon nzType="save"></i> <i nz-icon nzType="save"></i>
Save Save
</button> </button>
<div *ngIf="isCopyData" style="height: 40px; display: flex; justify-items: center;" >
<label style="margin-left: 40px" nz-checkbox [(ngModel)]="bgItem.isShowDebugLine">显示辅助框</label>
<button style="margin-left: 20px; margin-top: -5px" nz-button (click)="copyHotZoneData()"> 复制基础数据 </button>
<div style="margin-left: 10px; margin-top: -5px" >
<span>粘贴数据: </span>
<input style="width: 100px;" type="text" nz-input [(ngModel)]="pasteData" >
<button style="margin-left: 5px;" nz-button [disabled]="pasteData==''" nzType="primary" (click)="importData()">导入</button>
</div>
</div>
</div> </div>
...@@ -98,3 +176,52 @@ ...@@ -98,3 +176,52 @@
<label style="opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'">1</label> <label style="opacity: 0; position: absolute; top: 0px; font-family: 'BRLNSR_1'">1</label>
<!--龙骨面板-->
<nz-modal [(nzVisible)]="animaPanelVisible" nzTitle="配置资源文件" (nzAfterClose)="closeAfterPanel()" (nzOnCancel)="animaPanelCancel()" (nzOnOk)="animaPanelOk()" nzOkText="保存">
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 ske_json 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept="application/json"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="skeJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isSkeJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="skeJsonData['name']" style="margin-left: 10px"><u> {{skeJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_json 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept="application/json"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="texJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texJsonData['name']" style="margin-left: 10px"><u> {{texJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_png 文件: </span>
<nz-upload [nzShowUploadList]="false"
nzAccept = "image/*"
[nzAction]="uploadUrl"
[nzData]="uploadData"
(nzChange)="texPngHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexPngLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texPngData['name']" style="margin-left: 10px"><u> {{texPngData['name']}} </u></span>
</div>
<div class="anima-upload-btn" *ngIf="customTypeGroupArr && customTypeGroupArr[curDragonBoneGIdx] && customTypeGroupArr[curDragonBoneGIdx].animaNames">
提示:需包含以下动画: {{customTypeGroupArr[curDragonBoneGIdx].animaNames.toString()}}
</div>
</nz-modal>
...@@ -81,19 +81,21 @@ ...@@ -81,19 +81,21 @@
} }
} }
h5 { .anima-upload-btn {
margin-top: 1rem; padding: 10px;
} }
h5 {
margin-top: 1rem;
@font-face
{
font-family: 'BRLNSR_1';
src: url("/assets/font/BRLNSR_1.TTF") ;
} }
//
//@font-face
//{
// font-family: 'BRLNSR_1';
// src: url("/assets/font/BRLNSR_1.TTF") ;
//}
...@@ -107,104 +109,3 @@ h5 { ...@@ -107,104 +109,3 @@ h5 {
//@import '../../../style/common_mixin';
//
//.p-image-uploader {
// position: relative;
// display: block;
// width: 100%;
// height: 0;
// padding-bottom: 56.25%;
// .p-box {
// position: absolute;
// left: 0;
// top: 0;
// right: 0;
// bottom: 0;
// border: 2px dashed #ddd;
// border-radius: 0.5rem;
// background-color: #fafafa;
// text-align: center;
// color: #aaa;
// .p-upload-icon {
// text-align: center;
// margin: auto;
// .anticon-upload {
// color: #888;
// font-size: 5rem;
// }
// .p-progress-bar {
// position: relative;
// width: 20rem;
// height: 1.5rem;
// border: 1px solid #ccc;
// border-radius: 1rem;
// .p-progress-bg {
// background-color: #1890ff;
// border-radius: 1rem;
// height: 100%;
// }
// .p-progress-value {
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// text-shadow: 0 0 4px #000;
// color: white;
// text-align: center;
// font-size: 0.9rem;
// line-height: 1.5rem;
// }
// }
// }
// .p-preview {
// width: 100%;
// height: 100%;
// //background-image: url("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png");
// @include k-img-bg();
// }
// }
//}
//
//.p-btn-delete {
// position: absolute;
// right: -0.5rem;
// top: -0.5rem;
// width: 2rem;
// height: 2rem;
// border: 0.2rem solid white;
// border-radius: 50%;
// font-size: 1.2rem;
// background-color: #fb781a;
// color: white;
// text-align: center;
//}
//
//.p-upload-progress-bg {
// position: absolute;
// width: 100%;
// height: 100%;
// display: flex;
// align-items: center;
// justify-content: center;
// & .i-text {
// position: absolute;
// text-align: center;
// color: white;
// text-shadow: 0 0 2px rgba(0, 0, 0, .85);
// }
// & .i-bg {
// position: absolute;
// left: 0;
// top: 0;
// height: 100%;
// background-color: #27b43f;
// border-radius: 0.5rem;
// }
//}
//
//
//:host ::ng-deep .ant-upload {
// display: block;
//}
<div class="position-relative">
<button nz-button (click)="setAnimaBtnClick()" style=" border-radius: 0.5rem; border: 1px solid #ddd;">
<i nz-icon nzType="tool" nzTheme="outline"></i>
{{btnName}}
</button>
<!--配置龙骨面板-->
<nz-modal [(nzVisible)]="animaPanelVisible" (nzAfterClose)="closePanel()" nzTitle="配置资源文件"
(nzOnCancel)="animaPanelCancel()" (nzOnOk)="animaPanelOk()" nzOkText="保存">
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 ske_json 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="application/json" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="skeJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isSkeJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="skeJsonData && skeJsonData['name']" style="margin-left: 10px"><u> {{skeJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_json 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="application/json" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="texJsonHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexJsonLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texJsonData && texJsonData['name']" style="margin-left: 10px"><u> {{texJsonData['name']}} </u></span>
</div>
<div class="anima-upload-btn">
<span style="margin-right: 10px">上传 tex_png 文件: </span>
<nz-upload [nzShowUploadList]="false" nzAccept="image/*" [nzAction]="uploadUrl" [nzData]="uploadData"
(nzChange)="texPngHandleChange($event)">
<button nz-button><i nz-icon nzType="upload"></i><span>Upload</span></button>
</nz-upload>
<i *ngIf="isTexPngLoading" style="margin-left: 10px;" nz-icon [nzType]="'loading'"></i>
<span *ngIf="texPngData && texPngData['name']" style="margin-left: 10px"><u> {{texPngData['name']}} </u></span>
</div>
<div class="anima-upload-btn" *ngIf="animaNames && animaNames.length > 0">
提示:需包含动画: {{animaNames.toString()}}.
</div>
</nz-modal>
</div>
\ No newline at end of file
@import '../../style/common_mixin.css';
.p-image-uploader {
position: relative;
display: block;
width: 100%;
height: 0;
padding-bottom: 56.25%;
.p-box {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border: 2px dashed #ddd;
border-radius: 0.5rem;
background-color: #fafafa;
text-align: center;
color: #aaa;
.p-upload-icon {
text-align: center;
margin: auto;
.anticon-upload {
color: #888;
font-size: 5rem;
}
.p-progress-bar {
position: relative;
width: 20rem;
height: 1.5rem;
border: 1px solid #ccc;
border-radius: 1rem;
.p-progress-bg {
background-color: #1890ff;
border-radius: 1rem;
height: 100%;
}
.p-progress-value {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-shadow: 0 0 4px #000;
color: white;
text-align: center;
font-size: 0.9rem;
line-height: 1.5rem;
}
}
}
.p-preview {
width: 100%;
height: 100%;
background-size: contain;
background-repeat: no-repeat;
background-position: 50% 50%;
//background-image: url("https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png");
}
}
.d-flex{
display: flex;
}
}
.p-btn-delete {
position: absolute;
right: -0.5rem;
top: -0.5rem;
width: 2rem;
height: 2rem;
border: 0.2rem solid white;
border-radius: 50%;
font-size: 1.2rem;
background-color: #fb781a;
color: white;
text-align: center;
}
.p-upload-progress-bg {
position: absolute;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
& .i-text {
position: absolute;
text-align: center;
color: white;
text-shadow: 0 0 2px rgba(0, 0, 0, .85);
}
& .i-bg {
position: absolute;
left: 0;
top: 0;
height: 100%;
background-color: #27b43f;
border-radius: 0.5rem;
}
}
.anima-upload-btn {
padding: 10px;
}
:host ::ng-deep .ant-upload {
display: block;
}
import {ApplicationRef, Component, EventEmitter, Input, OnChanges, OnDestroy, Output} from '@angular/core';
import { NzMessageService, UploadXHRArgs, UploadFile } from 'ng-zorro-antd';
@Component({
selector: 'app-upload-dragon-bone',
templateUrl: './upload-dragon-bone.component.html',
styleUrls: ['./upload-dragon-bone.component.scss']
})
export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
uploading = false;
progress = 0;
@Input()
btnName = '配置龙骨动画';
@Input()
animaNames = [];
@Input()
skeJsonData = {};
@Input()
texJsonData = {};
@Input()
texPngData = {};
@Output()
save = new EventEmitter();
@Output()
refreshEmitter = new EventEmitter();
// @Input()
// picUrl;
// @Input()
// canDelete = false;
// @Output()
// imageUploaded = new EventEmitter();
// @Output()
// imageUploadFailure = new EventEmitter();
// @Output()
// delete = new EventEmitter();
// @Input()
// picItem = null;
// @Input()
// iconSize = 2;
// @Input()
// TIP = 'Click here to upload image';
// @Input()
// disableUpload = false;
uploadUrl;
uploadData;
animaPanelVisible = false;
isSkeJsonLoading = false;
isTexJsonLoading = false;
isTexPngLoading = false;
constructor(private appRef: ApplicationRef, private nzMessageService: NzMessageService) {
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
}
ngOnChanges() {
}
setAnimaBtnClick() {
this.animaPanelVisible = true;
this.refresh();
}
animaPanelCancel() {
this.animaPanelVisible = false;
this.refresh();
}
animaPanelOk() {
this.sendItemDragonBoneData();
this.animaPanelVisible = false;
this.refresh();
}
sendItemDragonBoneData() {
const data = {};
data['skeJsonData'] = this.skeJsonData;
data['texJsonData'] = this.texJsonData;
data['texPngData'] = this.texPngData;
this.save.emit(data);
}
skeJsonHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isSkeJsonLoading = true;
break;
case 'success':
console.log('e.file.response.url',e.file.response.url);
this.skeJsonData = {
'url':e.file.response.url,
'name': e.file.name
};
console.log('json',this.skeJsonData);
// this.skeJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isSkeJsonLoading = false;
break;
case 'progress':
break;
}
}
texJsonHandleChange(e) {
console.log('e: ', e);
console.log('this',this);
switch (e.type) {
case 'start':
this.isTexJsonLoading = true;
break;
case 'success':
this.texJsonData = {
'url':e.file.response.url,
'name': e.file.name
};
// this.texJsonData['url'] = e.file.response.url;
// this.texJsonData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexJsonLoading = false;
break;
case 'progress':
break;
}
}
texPngHandleChange(e) {
console.log('e: ', e);
switch (e.type) {
case 'start':
this.isTexPngLoading = true;
break;
case 'success':
this.texPngData = {
'url':e.file.response.url,
'name': e.file.name
};
// this.texPngData['url'] = e.file.response.url;
// this.texPngData['name'] = e.file.name;
this.nzMessageService.success('上传成功');
this.isTexPngLoading = false;
break;
case 'progress':
break;
}
}
/**
* 刷新 渲染页面
*/
refresh() {
// this.refreshEmitter.emit();
setTimeout(() => {
this.appRef.tick();
}, 1);
}
closePanel() {
console.log(' in closePanel ');
this.refresh();
}
ngOnDestroy() {
}
}
...@@ -6,30 +6,3 @@ ...@@ -6,30 +6,3 @@
height: 100%; height: 100%;
} }
.radioPaire {
float: left;
margin: 3px;
border-style: dashed;
border-color: #000;
border-width: 1px;
}
.border {
border-radius: 20px;
border-style: dashed;
padding: 20px;
margin: 20px;
/*width: 500px; */
/*//border-radius: 20px;*/
/*//border-width: 2px;*/
/*//border-color: #000000;*/
}
.border-lite {
border: 2px dashed #ddd;
border-radius: 0.5rem;
padding: 10px;
margin: 10px;
}
<div class="model-content"> <div class="model-content">
<div *ngFor="let question of item.questionList; let i = index">
<div style="border-style: dotted; border-width: 1px;">
<div style="margin-left: 5%; margin-bottom: 50px; padding-top: 20px; ">
<span style="height: 30px; font-size: 18px;">第{{i + 1}}页标题音频:</span>
<app-audio-recorder [audioUrl]="question.questionAudio"
(audioUploaded)="onQuestionAudioUploadSuccess($event, i)">
</app-audio-recorder>
<br>
<span style="height: 30px; font-size: 18px;">第{{i + 1}}页标题文本:</span>
<br>
<input style="width: 150px; " type="text" maxlength="" nz-input [(ngModel)]="question.questionText"
(blur)="save()">
<br>
<br>
<div style="height: 330px;width:100%">
<span style="height: 30px; font-size: 18px;">第{{i + 1}}页题干:</span>
<div *ngFor="let option of question.optionList; let j = index">
<div style="margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 20px; width: 230px;">
<span style="height: 30px; font-size: 18px;">题干音频:</span>
<app-audio-recorder [audioUrl]="option.optionAudio" (audioUploaded)="onOptionUploadSuccess($event, i, j)">
</app-audio-recorder>
<br>
<span style="height: 30px; font-size: 18px;">题干文本:</span>
<input style="width: 150px; " type="text" maxlength="" nz-input [(ngModel)]="option.text" (blur)="save()">
<br>
<span style="height: 30px; font-size: 18px;">题干骨骼动画:</span>
<app-upload-dragon-bone [btnName]="[['配置骨骼动画']]" [animaNames]="[[['normal']]]"
[skeJsonData]=option.optionDragonBone.skeJsonData [texJsonData]=option.optionDragonBone.texJsonData
[texPngData]=option.optionDragonBone.texPngData (save)="saveAnima($event, option.optionDragonBone)"
(refreshEmitter)="refresh()">
</app-upload-dragon-bone>
<br>
</div>
</div>
<div *ngIf="(question.optionList.length < 4)">
<button style="margin-top: 20px; float: left; border-width: 1px;
border-style: dotted; padding: 20px; margin-right: 20px;
width: 230px; height: 263px;" nz-button nzType="dashed" class="add-btn" (click)="addOption(i)">
增加选项
</button>
</div>
</div>
<div style="padding: 10px;"> <div style="height: 130px;width:100%">
<span style="height: 30px; font-size: 18px;">第{{i + 1}}页选项:</span>
<div *ngFor="let option of question.optionList; let j = index">
<div style="margin-top: 20px; float: left; border-width: 1px; border-style: dotted;
padding: 20px; margin-right: 20px; width: 230px;">
<span style="height: 30px; font-size: 18px;">选项骨骼动画:</span>
<app-upload-dragon-bone [btnName]="[['配置骨骼动画']]" [animaNames]="[[['normal']]]"
[skeJsonData]=option.optionDragonBone.skeJsonData2 [texJsonData]=option.optionDragonBone.texJsonData2
[texPngData]=option.optionDragonBone.texPngData2 (save)="saveAnima2($event, option.optionDragonBone)"
(refreshEmitter)="refresh()">
</app-upload-dragon-bone>
<br>
<div style="width: 300px;" align='center'> <div *ngIf="(question.optionList.length >= 4)">
<span>图1: </span> <button style="margin-top: 20px; width: 100%; height: 32px; color: red;" nz-button nzType="dashed"
<app-upload-image-with-preview class="add-btn" (click)="removeOption(i, j)">
[picUrl]="item.pic_url" 删除选项
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')"> </button>
</app-upload-image-with-preview>
</div> </div>
<div style="width: 300px; margin-top: 5px;" align='center'>
<span>图2: </span>
<app-upload-image-with-preview
[picUrl]="item.pic_url_2"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url_2')">
</app-upload-image-with-preview>
</div> </div>
<div style="width: 300px; margin-top: 15px;">
<span>文本: </span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
</div> </div>
<div style="margin-top: 5px">
<span>音频: </span>
<app-audio-recorder
[audioUrl]="item.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"
></app-audio-recorder>
</div> </div>
</div> </div>
<button style="margin-left: 5%; margin-top: 50px;margin-bottom: 8px; width: 90%; height: 32px; color: red;"
nz-button nzType="dashed" class="add-btn" (click)="removeQuestion(i)">
删除问题{{i+1}}
</button>
</div>
</div>
<button style="margin-left: 5%; margin-top: 8px; margin-bottom: 100px; height: 50px; width: 90%;" nz-button
nzType="dashed" class="add-btn" (click)="addQuestion()">
添加问题
</button>
</div> </div>
\ No newline at end of file
@import "../style/common_mixin";
.model-content {
margin: 10px;
.card-config {
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
.card-item{
width: 500px;
margin-bottom: 40px;
.border {
border-radius: 20px;
border-style: dashed;
padding:20px;
width: 100%;
}
.card-item-content{
.title {
font-size: 24px;
width: 100%;
text-align: center;
}
.section{
border-top: 1px dashed ;
padding: 10px 0;
.section-title{
font-size: 24px;
width: 100%;
}
.section-content{
display: flex;
flex-direction: column;
margin: 5px 0 10px 0;
}
}
.pic-sound-box {
width: 50%;
display: flex;
flex-direction: column;
}
.add-btn-box {
display: flex;
align-items: center;
justify-content: center;
height: 20vw;
padding: 10px;
padding-top: 5vw;
}
}
}
}
}
.clearfix:before,.clearfix:after {
content: "";
display: block;
clear: both;
}
\ No newline at end of file
...@@ -10,7 +10,7 @@ import { JsonPipe } from '@angular/common'; ...@@ -10,7 +10,7 @@ import { JsonPipe } from '@angular/common';
export class FormComponent implements OnInit, OnChanges, OnDestroy { export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用 // 储存数据用
saveKey = "test_001"; saveKey = "DataKey_Cocos_FT11";
// 储存对象 // 储存对象
item; item;
...@@ -18,24 +18,78 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -18,24 +18,78 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
createShell() { addQuestion() {
this.item.wordList.push({ this.item.questionList.push({
word: '', "questionAudio": "",
audio: '', "questionText": "",
backWord: '', "optionList": [{
backWordAudio: '', "text":"",
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" },
"skeJsonData2": { "url": "" },
"texJsonData2": { "url": "" },
"texPngData2": { "url": "" }
},
"optionAudio": ""
}, {
"text":"",
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" },
"skeJsonData2": { "url": "" },
"texJsonData2": { "url": "" },
"texPngData2": { "url": "" }
},
"optionAudio": ""
}, {
"text":"",
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" },
"skeJsonData2": { "url": "" },
"texJsonData2": { "url": "" },
"texPngData2": { "url": "" }
},
"optionAudio": ""
}]
}); });
this.save(); this.save();
} }
removeShell(idx) { removeQuestion(idx) {
this.item.wordList.splice(idx, 1); this.item.questionList.splice(idx, 1);
this.save(); this.save();
} }
ngOnInit() { addOption(questionIdx) {
this.item.questionList[questionIdx].optionList.push({
"text":"",
"optionDragonBone": {
"skeJsonData": { "url": "" },
"texJsonData": { "url": "" },
"texPngData": { "url": "" },
"skeJsonData2": { "url": "" },
"texJsonData2": { "url": "" },
"texPngData2": { "url": "" }
},
"optionAudio": ""
});
this.save();
}
this.item = {}; removeOption(questionIdx, optionIdx) {
this.item.questionList[questionIdx].optionList.splice(optionIdx, 1);
this.save();
}
ngOnInit() {
this.item = {
questionList: []
};
// 获取存储的数据 // 获取存储的数据
(<any>window).courseware.getData((data) => { (<any>window).courseware.getData((data) => {
...@@ -62,33 +116,34 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -62,33 +116,34 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
onOptionUploadSuccess(e, questionIdx, optionIdx) {
/** this.item.questionList[questionIdx].optionList[optionIdx].optionAudio = e.url;
* 储存图片数据
* @param e
*/
onImageUploadSuccess(e, key) {
this.item[key] = e.url;
this.save(); this.save();
} }
/** onQuestionAudioUploadSuccess(e, questionIdx) {
* 储存音频数据 this.item.questionList[questionIdx].questionAudio = e.url;
* @param e
*/
onAudioUploadSuccess(e, key) {
this.item[key] = e.url;
this.save(); this.save();
// questionText
} }
onWordAudioUploadSuccess(e, idx) { radioClick(questionIdx, optionIdx) {
this.item.wordList[idx].audio = e.url; this.item.questionList[questionIdx].rightOptionIdx = optionIdx;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.save(); this.save();
} }
onBackWordAudioUploadSuccess(e, idx) { saveAnima(event, group) {
this.item.wordList[idx].backWordAudio = e.url; group.skeJsonData = event.skeJsonData;
group.texJsonData = event.texJsonData;
group.texPngData = event.texPngData;
this.save();
}
saveAnima2(event, group) {
group.skeJsonData2 = event.skeJsonData;
group.texJsonData2 = event.texJsonData;
group.texPngData2 = event.texPngData;
this.save(); this.save();
} }
......
{
"version": "1.1",
"key": "DataKey_Cocos_Test",
"dataArray": []
}
\ No newline at end of file
{
"version": "1.1",
"key": "DataKey_LST01",
"question": {
"type": "Image",
"text": "",
"image_url": "demo_main",
"shortAudio_url": "",
"longAudio_url": ""
},
"answerType": "Image",
"dataArray": [{
"text": "",
"image_url": "demo_1"
}, {
"text": "",
"image_url": "demo_2"
}, {
"text": "",
"image_url": "demo_3"
}, {
"text": "",
"image_url": "demo_4"
}, {
"text": "",
"image_url": "demo_5"
}, {
"text": "",
"image_url": "demo_6"
}]
}
\ No newline at end of file
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541", "uuid": "ea5aaedf-cabc-46c0-aba9-e7888b7ea2b2",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{
"ver": "1.1.2",
"uuid": "baa17bd2-3214-41ed-8a86-f64677160ad1",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "animDark",
"_objFlags": 0,
"_native": "",
"_duration": 0.016666666666666666,
"sample": 60,
"speed": 0.4,
"wrapMode": 1,
"curveData": {
"paths": {
"bg/bg_stardark": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "0ea1bc39-9ee3-4378-b7b5-0a637fff01aa"
}
}
]
}
}
},
"bg/bg_moondark": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "48f7c98b-5357-489f-a521-2cd6a62abde8"
}
}
]
}
}
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "a396ac09-978d-481b-a0e3-997a51f4678a",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "animation",
"_objFlags": 0,
"_native": "",
"_duration": 0.016666666666666666,
"sample": 60,
"speed": 0.4,
"wrapMode": 1,
"curveData": {
"paths": {
"bg/bg_stardark": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "3fc433b2-da4c-4aa2-bc03-1d202e971134"
}
}
]
}
}
},
"bg/bg_moondark": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "4ec3fc3d-35c2-4cde-af8c-52536d71c6d3"
}
}
]
}
}
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "20c8555e-3c4c-4d3e-b35a-afc1720cdfdb",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "86c3d350-b246-47cd-a46f-89901c28f26e",
"downloadMode": 0,
"duration": 2.403265,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1c6f13c1-6289-4131-9566-d1dbd3849ff4",
"downloadMode": 0,
"duration": 0.522449,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b", "uuid": "15166da1-4133-42f4-8122-b16ffdb68c51",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.130612, "duration": 0.130612,
"subMetas": {} "subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "c92eebf4-6f1f-4608-af47-a6277311de3f",
"downloadMode": 0,
"duration": 4.04898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "3aeb3c97-e4a2-4f0f-a479-48b8eeb6eeed",
"downloadMode": 0,
"duration": 0.966531,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "eebbeec5-bfc1-4481-b447-2ee0a7a79ee8",
"downloadMode": 0,
"duration": 2.76898,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "169e45bc-9858-4f55-8020-667f6e4563c6",
"downloadMode": 0,
"duration": 0.940417,
"subMetas": {}
}
\ No newline at end of file
{"name":"NewProject_2","isGlobal":0,"version":"5.5","armature":[{"name":"Armature","ik":[],"defaultActions":[{"gotoAndPlay":"newAnimation"}],"slot":[{"name":"图层_2","color":{},"parent":"root"},{"name":"眼1","displayIndex":2,"color":{},"z":1,"parent":"眼1"}],"bone":[{"name":"root","transform":{}},{"name":"眼1","transform":{"x":13.2,"y":-38.85},"parent":"root"}],"aabb":{"x":-68,"height":181,"y":-87,"width":131},"frameRate":24,"animation":[{"name":"newAnimation","frame":[],"duration":44,"slot":[{"name":"图层_2","colorFrame":[],"displayFrame":[]},{"name":"眼1","colorFrame":[],"displayFrame":[{"duration":20},{"duration":2},{"value":1,"duration":2},{"value":2,"duration":2},{"value":1,"duration":2},{"duration":16},{"duration":0}]}],"bone":[{"name":"root","scaleFrame":[],"translateFrame":[],"rotateFrame":[]},{"name":"眼1","scaleFrame":[],"translateFrame":[],"rotateFrame":[]}],"playTimes":0,"ffd":[],"ik":[]}],"type":"Armature","skin":[{"name":"","slot":[{"name":"图层_2","display":[{"name":"测试骨骼/图层_2","transform":{"x":-2.5,"y":3.5},"type":"image","path":"测试骨骼/图层_2"}]},{"name":"眼1","display":[{"name":"测试骨骼/眼1","transform":{"x":-14.7,"y":-1.65},"type":"image","path":"测试骨骼/眼1"},{"name":"测试骨骼/眼2","transform":{"x":-14.7,"y":-1.65},"type":"image","path":"测试骨骼/眼2"},{"name":"测试骨骼/眼3","transform":{"x":-14.7,"y":-1.65},"type":"image","path":"测试骨骼/眼3"}]}]}]}],"frameRate":24}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "e1623214-88d6-4d1e-a124-6d36cb382bce",
"subMetas": {}
}
\ No newline at end of file
{"name":"NewProject_2","SubTexture":[{"name":"测试骨骼/图层_2","x":1,"height":181,"y":1,"width":131},{"name":"测试骨骼/眼3","x":1,"height":15,"y":201,"width":43},{"name":"测试骨骼/眼2","x":1,"height":15,"y":218,"width":43},{"name":"测试骨骼/眼1","x":1,"height":15,"y":184,"width":43}],"imagePath":"NewProject_2_tex.png","height":256,"width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4791f23e-a9c9-4e6f-9366-55004bc2890a",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7029a1cf-56e3-49b4-976d-5919e29829f9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"NewProject_2_tex": {
"ver": "1.0.4",
"uuid": "f621ad8c-a101-4f46-a241-46985d60f980",
"rawTextureUuid": "7029a1cf-56e3-49b4-976d-5919e29829f9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -61.5,
"offsetY": 11,
"trimX": 1,
"trimY": 1,
"width": 131,
"height": 232,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1", "uuid": "06e2267e-0be5-4c48-afe9-8390e1d89c88",
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "45471cc5-3d53-4068-99c4-591121300416",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "ac86e335-44ed-48e5-bd97-5f4ab7fa28d4",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.7",
"uuid": "b125237b-1bc1-4ec8-9b7b-60c16e96c5ae",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.7",
"uuid": "f9d2b752-95ca-42ec-933f-4440d94f83d3",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.7",
"uuid": "682b8457-d696-4a22-8994-8ad61c414f1e",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
cc.Class({
extends: cc.Component,
onLoad() {
this.nodeDict = {};
this.linkWidget(this.node);
},
// 遍历节点树,获取重要节点
// 节点名字以$开头的节点为重要节点,放进nodeDict中,可以直接拿到,不用拖拽绑定
// $btn为按钮类型,放进nodeDict,并且绑定按钮点击事件
// $ui为ui节点,放进nodeDict,并且上面绑定了BaseUI脚本,所以不继续遍历该节点的子节点
// $btnUI为按钮类型ui节点,放进nodeDict,并且上面绑定了BaseUI脚本,所以不继续遍历该节点的子节点,并且绑定按钮点击事件
linkWidget(node) {
let children = node.children;
for (let i = 0; i < children.length; i++) {
let nodeName = children[i].name;
if (nodeName.substring(0, 1) !== "$") {
this.linkWidget(children[i]);
continue;
}
let realName = nodeName.substring(1);
if (this.nodeDict[realName]) {
cc.error("节点名字重复!" + realName);
this.linkWidget(children[i]);
continue;
}
let isUI = false;
this.nodeDict[realName] = children[i];
if (nodeName.substring(1, 6) === "btnUI") {
children[i].on('click', this.buttonListener, this);
isUI = true;
} else if (nodeName.substring(1, 4) === "btn") {
children[i].on('click', this.buttonListener, this);
isUI = false;
} else if (nodeName.substring(1, 3) === "ui") {
isUI = true;
}
children[i].name = realName;
this.nodeDict[realName] = children[i];
if (!isUI) {
this.linkWidget(children[i]);
}
}
},
getNodeByName(name) {
return this.nodeDict[name];
},
buttonListener(button) { }
});
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "7af27a40-c9d2-4101-b894-8dff982f3985",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
spfBase: [cc.SpriteFrame],
sprBg: cc.Sprite,
nodLight: cc.Node,
dragonBone: dragonBones.ArmatureDisplay,
audRight: cc.AudioClip,
audWrong: cc.AudioClip,
},
// onLoad () {},
start() {
},
onEnable() {
this.node.on('touchstart', this.onTouchStart, this);
},
onDisable() {
this.node.off('touchstart', this.onTouchStart, this);
},
onTouchStart() {
if (GameData.isMoving) {
return;
}
if (GameData.audioCount != 0) {
return;
}
if (GameData.currOptionIndex == this.index) {
this.chooseRight();
} else {
this.chooseWrong();
}
},
setInfo(data, index, scene) {
this.scene = scene;
this.data = data;
this.index = index;
this.loadDragonBone();
if (GameData.questionIndex % 2 == 0) {
this.sprBg.spriteFrame = this.spfBase[0];
} else {
this.sprBg.spriteFrame = this.spfBase[1];
}
},
loadDragonBone() {
this.dragonBone.dragonAtlasAsset = null;
this.dragonBone.dragonAsset = null;
this.dragonBone.armatureName = '';
var imageUrl = this.data.optionDragonBone.texPngData2.url;
var skeUrl = this.data.optionDragonBone.skeJsonData2.url;
var atlasUrl = this.data.optionDragonBone.texJsonData2.url;
// imageUrl = 'http://127.0.0.1/NewProject_2_tex.png';
// skeUrl = 'http://127.0.0.1/NewProject_2_ske.json';
// atlasUrl = 'http://127.0.0.1/NewProject_2_tex.json';
cc.assetManager.loadAny([{ url: atlasUrl, ext: '.txt' }, { url: skeUrl, ext: '.txt' }], (error, assets) => {
if (error) {
console.log(error)
}
else {
cc.assetManager.loadRemote(imageUrl, (error, texture) => {
if (error) {
console.log(error)
}
else {
var atlas = new dragonBones.DragonBonesAtlasAsset();
atlas._uuid = atlasUrl;
atlas.atlasJson = assets[0];
atlas.texture = texture;
var asset = new dragonBones.DragonBonesAsset();
asset._uuid = skeUrl;
asset.dragonBonesJson = assets[1];
this.dragonBone.dragonAtlasAsset = atlas;
this.dragonBone.dragonAsset = asset;
let data = asset._dragonBonesJsonData.armature[0];
if (!data) {
return;
}
this.dragonBone.armatureName = data.name;
this.animationName = data.animation[0].name;
// this.dragonBone.premultipliedAlpha = true;
// atlas.texture.setPremultiplyAlpha(true);
}
});
}
});
},
chooseRight() {
this.node.zIndex = 5;
this.playAudioRight();
this.nodLight.active = true;
this.scene.moveToQuestion(this);
},
chooseWrong() {
this.playAudioWrong();
cc.tween(this.node)
.to(0.2, { y: -150 })
.to(0.2, { y: 0 })
.start()
},
playAudioRight() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audRight, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
playAudioWrong() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audWrong, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "c7c4ae8d-8110-4bd4-b622-93f5720cd54b",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "801cd7c3-d02a-4ae9-8bd2-42c13f8f7456",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
const { showFireworks } = require("./utils");
cc.Class({
extends: cc.Component,
properties: {
audOver: cc.AudioClip,
},
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.node.getChildByName('bg_verygood').zIndex = 99;
},
start() {
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(0, -400), cc.v2(0, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(-600, -400), cc.v2(200, 1000), 200, 200
);
showFireworks(
this.node,
this.node.getChildByName('RibbonNodeBase').children,
cc.v2(600, -400), cc.v2(-200, 1000), 200, 200
);
this.playAudioOver();
},
playAudioOver() {
GameData.audioCount++;
let id = cc.audioEngine.play(this.audOver, false, 1);
cc.audioEngine.setFinishCallback(id, () => {
GameData.audioCount--;
})
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "538f4f45-dcad-4ae8-804d-aabcdfae9cee",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "e22e1d5e-d025-463d-a8df-85de258d791e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
{
"ver": "1.0.8",
"uuid": "34fd68c3-ee66-4456-9cb3-15b8cc3478b7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.1.2",
"uuid": "8540e37b-f678-4ca6-93df-acc60a7b2b9d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.SpriteAtlas"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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