Commit 0952dbf6 authored by jeff's avatar jeff

=。=半截上传

parent 30bbe2bc
......@@ -128,5 +128,8 @@
}
}
},
"defaultProject": "ng-template-generator"
"defaultProject": "ng-template-generator",
"cli": {
"analytics": "d34c626f-1cb5-4532-8f46-d97c6969e2fd"
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import {BackgroundImagePipe} from './pipes/background-image.pipe';
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 {CustomHotZoneComponent} from './common/custom-hot-zone/custom-hot-zone.component';
import {CustomHotZoneComponent1} from './common/custom-hot-zone-mini/custom-hot-zone-mini.component';
import {UploadVideoComponent} from './common/upload-video/upload-video.component';
import {TimePipe} from './pipes/time.pipe';
import {ResourcePipe} from './pipes/resource.pipe';
......@@ -42,6 +43,7 @@ registerLocaleData(zh);
TimePipe,
UploadVideoComponent,
CustomHotZoneComponent,
CustomHotZoneComponent1,
UploadDragonBoneComponent,
PlayerContentWrapperComponent,
CustomActionComponent,
......
This diff is collapsed.
<div class="p-image-children-editor">
<h5 style="margin-left: 2.5%;"> 预览: </h5>
<div class="preview-box" #wrap>
<canvas id="canvas" #canvas></canvas>
</div>
<div nz-row nzType="flex" nzAlign="middle">
<div nz-col nzSpan="5" nzOffset="1">
<h5> 添加背景: </h5>
<div class="bg-box">
<app-upload-image-with-preview
[picUrl]="bgItem?.url"
(imageUploaded)="onBackgroundUploadSuccess($event)">
</app-upload-image-with-preview>
</div>
</div>
<div nz-col nzSpan="5" nzOffset="1" class="img-box"
*ngFor="let it of hotZoneArr; let i = index">
<div
style="margin: auto; padding: 5px; margin-top: 30px; width:90%; border: 2px dashed #ddd; border-radius: 10px">
<span style="margin-left: 40%;"> 区域{{i + 1}}
</span>
<button style="float: right;" nz-button nzType="danger" nzSize="small" (click)="deleteBtnClick(i)">
X
</button>
<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">
<label *ngIf="isHasRect" nz-radio nzValue="rect">矩形</label>
<label *ngIf="isHasPic" nz-radio nzValue="pic">图片</label>
<label *ngIf="isHasText" nz-radio nzValue="text">文本</label>
</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].animaSmall" align="center" style="margin-top: 5px">
<button nz-button (click)="setAnimaSmallBtnClick(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 *ngIf="customTypeGroupArr[it.gIdx]?.action" style="display: flex;align-items: center; margin-top: 5px">
<app-custom-action
style="margin: auto"
[item]="it ? it['actionData_' + it.gIdx] : {}"
[type]="customTypeGroupArr[it.gIdx].action.type"
[option]="customTypeGroupArr[it.gIdx].action.option"
(save)="onSaveCustomAction($event, it)">
></app-custom-action>
</div>
</div>
<!-- <div *ngIf="!customTypeGroupArr">
<div *ngIf="it.itemType == 'pic'">
<app-upload-image-with-preview
[picUrl]="it?.pic_url"
(imageUploaded)="onItemImgUploadSuccess($event, it)">
</app-upload-image-with-preview>
</div>
<div *ngIf="it.itemType == 'text'">
<input type="text" nz-input [(ngModel)]="it.text" (blur)="saveText(it)">
</div>
<div *ngIf="isHasAudio"
style="width: 100%; margin-top: 5px; display: flex; align-items: center; justify-items: center;">
<app-audio-recorder
style="margin: auto"
[audioUrl]="it.audio_url"
(audioUploaded)="onItemAudioUploadSuccess($event, it)"
></app-audio-recorder>
</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 nz-col nzSpan="5" nzOffset="1">
<div class="bg-box">
<button nz-button nzType="dashed" (click)="addBtnClick()"
class="add-btn">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
<!--Add Image-->
添加点击区域
</button>
</div>
</div>
</div>
<nz-divider></nz-divider>
<div class="save-box">
<button style="margin-left: 200px" class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round"
(click)="saveClick()" >
<i nz-icon nzType="save"></i>
Save
</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>
<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>
.p-image-children-editor {
width: 100%;
height: 100%;
border-radius: 0.5rem;
border: 2px solid #ddd;
.preview-box {
margin: auto;
width: 95%;
height: 35vw;
border: 2px dashed #ddd;
border-radius: 0.5rem;
background-color: #fafafa;
text-align: center;
color: #aaa;
.preview-img {
height: 100%;
width: auto;
}
}
.bg-box{
//width: 100%;
margin-bottom: 1rem;
}
.img-box {
margin-bottom: 1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.img-box-upload{
width: 80%;
}
.add-btn {
margin-top: 1rem;
width: 200px;
height: 90px;
display: flex;
align-items: center;
justify-content: center;
}
}
.save-box {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.save-btn {
width: 160px;
height: 40px;
//margin-top: 20px;
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: center;
}
}
.anima-upload-btn {
padding: 10px;
}
h5 {
margin-top: 1rem;
}
//
//@font-face
//{
// font-family: 'BRLNSR_1';
// src: url("/assets/font/BRLNSR_1.TTF") ;
//}
<div class="model-content">
<div style="padding: 10px;">
<!--
<div style="padding: 10px;">
<div style="width: 100%; margin-top: 15px; margin-bottom: 50px;" align="center">
<h2>标题设置</h2>
......@@ -15,15 +16,15 @@
</div>
</div>
<app-custom-hot-zone
-->
<app-custom-hot-zone-mini
[bgItem]="item.bgItem"
[hotZoneItemArr]="item.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr"
(save)="saveHotZone(item, $event)"
>
</app-custom-hot-zone>
</app-custom-hot-zone-mini>
<!-- <div style="width: 300px;" align='center'>
<span>图1: </span>
<app-upload-image-with-preview
......
{
"ver": "1.1.2",
"uuid": "f10d537b-d9e1-4903-ae19-44fda7c00000",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "hand",
"_objFlags": 0,
"_native": "",
"_duration": 0.7,
"sample": 30,
"speed": 1,
"wrapMode": 2,
"curveData": {
"paths": {
"icon_hand": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "562deefd-c9fd-42f0-97d7-d6f5893ef3f3"
}
},
{
"frame": 0.3333333333333333,
"value": {
"__uuid__": "61e47c68-658d-416b-a46e-399ebfddd2c8"
}
},
{
"frame": 0.6666666666666666,
"value": {
"__uuid__": "562deefd-c9fd-42f0-97d7-d6f5893ef3f3"
}
}
]
}
},
"props": {
"color": [
{
"frame": 0,
"value": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"curve": "constant"
},
{
"frame": 0.3333333333333333,
"value": {
"__type__": "cc.Color",
"r": 176,
"g": 176,
"b": 176,
"a": 255
},
"curve": "constant"
},
{
"frame": 0.6666666666666666,
"value": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
}
}
]
}
},
"icon_dian": {
"props": {
"scale": [
{
"frame": 0,
"value": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
},
"curve": "constant"
},
{
"frame": 0.3333333333333333,
"value": {
"__type__": "cc.Vec2",
"x": 1.3,
"y": 1.3
},
"curve": "constant"
},
{
"frame": 0.6666666666666666,
"value": {
"__type__": "cc.Vec2",
"x": 1,
"y": 1
}
}
],
"position": [
{
"frame": 0,
"value": [
-22.199,
34.822,
0
],
"curve": "constant"
}
]
}
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "110d5a6d-4d4e-4a04-bed2-4bb56c56d03d",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "tips",
"_objFlags": 0,
"_native": "",
"_duration": 0.5,
"sample": 40,
"speed": 1,
"wrapMode": 2,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255,
"curve": "constant"
},
{
"frame": 0.25,
"value": 0,
"curve": "constant"
},
{
"frame": 0.5,
"value": 255
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "a13d6552-0ece-42e3-813a-2029ad0cab0c",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"uuid": "39ef1939-3bf9-4d21-a67a-bc1dede521a9",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "e0bcf4cc-35a7-4d61-b202-8dd49299c2c0",
"downloadMode": 0,
"duration": 1.7487,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "be0db2d0-24f0-4d3d-b613-ad695edaac17",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "2ce7d58d-b6fe-4ef7-a128-de76f672a803",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
cc.Class({
extends: cc.Component,
properties: {
tipsAnim: cc.Animation,
handAnim: cc.Animation,
},
data: null,
onLoad() {
this.tipsAnim.node.active = false
this.handAnim.node.active = false
},
onEnable() {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
onDisable() {
this.node.off(cc.Node.EventType.TOUCH_START, this.onTouchStart, this)
},
initWithData(data) {
this.data = data
let rect = this.data.rect
this.node.x = rect.x
this.node.y = rect.y
this.node.width = rect.width
this.node.height = rect.height
if (this.data.useHand) {
this.handAnim.node.active = false
this.handAnim.play()
}
},
onTouchStart() {
if (this.data) {
let url = this.data.audio_url
if (url && url != '') {
this.playAudio(url)
}
}
},
/** 播放音乐 */
playAudio(url) {
cc.assetManager.loadRemote(url, (err, audioClip) => {
if (err) return
this.audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(this.audioId, () => {
this.audioId = null
});
});
},
stopAudio() {
if (this.audioId != null) {
cc.audioEngine.stop(this.audioId)
this.audioId = null
}
},
/** 音频id */
audioId: null,
});
{
"ver": "1.0.8",
"uuid": "1b435fe6-616a-4026-8037-ebce861f53e5",
"uuid": "57f79280-6f4b-4d53-b1e3-1cca543a4d9e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
This diff is collapsed.
......@@ -9,7 +9,34 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
onLoad() {
console.log('测试ts脚本能否正常使用')
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start() {
cc.color()
this.node.off(cc.Node.EventType.MOUSE_DOWN)
}
// update (dt) {}
onEnable() {
let one = new cc.Animation()
one.currentClip.speed
one.play().wrapMode
one.defaultClip.wrapMode = cc.WrapMode.Reverse
cc.Node.EventType.MOUSE_LEAVE
cc.tween(this.node).to(1,{opacity:1}).to
cc.assetManager.loadRemote
this.node.
}
}
{
"ver": "1.0.8",
"uuid": "ade7af40-d56d-4087-bbc6-2888fef55353",
"uuid": "81db3e2c-d815-4891-a77d-5651d54dc92d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
{
"ver": "1.0.8",
"uuid": "f4ede462-f8d7-4069-ba80-915611c058ca",
"uuid": "c238bc0d-c57b-401e-a217-404098e27433",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
......
export const tools = {
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "68947d90-e044-48ff-8bce-670db8633681",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
......@@ -26,8 +26,8 @@
"height": 720,
"rawWidth": 14,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderTop": 22,
"borderBottom": 33,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
......
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