Commit 3b8ffabe authored by 李维's avatar 李维

dev commit

parent 97964bd9
...@@ -21,8 +21,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -21,8 +21,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
Type = Type; Type = Type;
withRmBtn = false; withRmBtn = false;
uploadUrl = (<any>window).courseware.uploadUrl(); uploadUrl;
uploadData = (<any>window).courseware.uploadData(); uploadData;
@Input() @Input()
needRemove = false; needRemove = false;
...@@ -52,9 +52,13 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy { ...@@ -52,9 +52,13 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
recorder: any; recorder: any;
audioBlob: any; audioBlob: any;
constructor( private nzMessageService: NzMessageService ) { constructor( 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;
};
} }
init() { init() {
......
...@@ -29,10 +29,17 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges { ...@@ -29,10 +29,17 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
@Input() @Input()
disableUpload = false; disableUpload = false;
uploadUrl = (<any> window).courseware.uploadUrl(); uploadUrl;
uploadData = (<any> window).courseware.uploadData(); uploadData;
constructor(private nzMessageService: NzMessageService) { constructor(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() { ngOnChanges() {
if (!this.picItem) { if (!this.picItem) {
...@@ -40,10 +47,6 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges { ...@@ -40,10 +47,6 @@ export class UploadImageWithPreviewComponent implements OnDestroy, OnChanges {
} }
} }
handleChange(info: { type: string, file: UploadFile, event: any }): void { handleChange(info: { type: string, file: UploadFile, event: any }): void {
switch (info.type) { switch (info.type) {
case 'start': case 'start':
......
...@@ -27,9 +27,6 @@ export class UploadVideoComponent implements OnChanges, OnDestroy { ...@@ -27,9 +27,6 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
@ViewChild('videoNode') @ViewChild('videoNode')
videoNode: ElementRef; videoNode: ElementRef;
// @Input() // @Input()
// extractCoverFunc = null; // extractCoverFunc = null;
...@@ -47,8 +44,8 @@ export class UploadVideoComponent implements OnChanges, OnDestroy { ...@@ -47,8 +44,8 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
item: any; item: any;
// videoItem = null; // videoItem = null;
uploadUrl = (<any> window).courseware.uploadUrl(); uploadUrl;
uploadData = (<any> window).courseware.uploadData(); uploadData;
constructor(private nzMessageService: NzMessageService, constructor(private nzMessageService: NzMessageService,
private sanitization: DomSanitizer private sanitization: DomSanitizer
...@@ -58,6 +55,13 @@ export class UploadVideoComponent implements OnChanges, OnDestroy { ...@@ -58,6 +55,13 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
this.uploading = false; this.uploading = false;
this.videoFile = null; this.videoFile = null;
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData();
window['air'].getUploadCallback = (url, data) => {
this.uploadUrl = url;
this.uploadData = data;
};
} }
ngOnChanges() { ngOnChanges() {
// if (!this.videoFile || this.showUploadBtn) { // if (!this.videoFile || this.showUploadBtn) {
......
...@@ -633,20 +633,26 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -633,20 +633,26 @@ export class PlayComponent implements OnInit, OnDestroy {
curtainContral(status, callback?){ curtainContral(status, callback?){
let all = ["Curtain-A", "Curtain-B", "Curtain-C", "Curtain-D"] let all = ["Curtain-A", "Curtain-B", "Curtain-C", "Curtain-D"]
let _this = this
this.g_cartoon.playAudio("tongshenghuanhu") this.g_cartoon.playAudio("tongshenghuanhu")
this.m_setTimeoutIDs.push(setTimeout(() => { this.m_setTimeoutIDs.push(setTimeout(() => {
this.g_cartoon.playAudio("gusheng_kaitou") this.g_cartoon.playAudio("gusheng_kaitou")
}, 2000)) }, 2000))
if(status){ if(status){
all.forEach(item=>{ all.forEach(item=>{
this.g_cartoon.getCartoonElement(item).open() _this.g_cartoon.getCartoonElement(item).open()
})
this.m_setTimeoutIDs.push(setTimeout(()=>{
this.m_allDrums.forEach(function(item,index){
_this.g_cartoon.getCartoonElement(item).show(index)
}) })
}, 4000))
this.m_setTimeoutIDs.push(setTimeout(()=>{ this.m_setTimeoutIDs.push(setTimeout(()=>{
callback && callback() callback && callback()
}, 7000)) }, 7000))
}else{ }else{
all.forEach(item=>{ all.forEach(item=>{
this.g_cartoon.getCartoonElement(item).close() _this.g_cartoon.getCartoonElement(item).close()
}) })
this.m_setTimeoutIDs.push(setTimeout(()=>{ this.m_setTimeoutIDs.push(setTimeout(()=>{
callback && callback() callback && callback()
...@@ -731,7 +737,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -731,7 +737,6 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
initDrum(){ initDrum(){
console.log("initDrum")
if(this.g_formData.dataArray.length == 0){ if(this.g_formData.dataArray.length == 0){
return return
} }
...@@ -872,12 +877,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -872,12 +877,20 @@ export class PlayComponent implements OnInit, OnDestroy {
element.isOpen = false; element.isOpen = false;
this.subscribeMapDownEvent(element.id, ()=>{ this.subscribeMapDownEvent(element.id, ()=>{
if(!this.m_startGame || element.isOpen){ if(!this.m_startGame || element.isOpen){
if(element.isOpen){
if(data.audio_url){
this.g_cartoon.playAudio(data.audio_url)
}
}
this.g_enableMapDown = true; this.g_enableMapDown = true;
return return
} }
this.g_cartoon.playAudio(`gusheng_${index+1}`) this.g_cartoon.playAudio(`gusheng_${index+1}`)
this.setRenderZIndex(element.ref, zIndexMap.drum + 1) this.setRenderZIndex(element.ref, zIndexMap.drum + 1)
tweenChange(element.ref, {scaleX: element.initScaleX * 1.1, scaleY: element.initScaleY * 1.1}, 0.2, ()=>{ tweenChange(element.ref, {scaleX: element.initScaleX * 1.1, scaleY: element.initScaleY * 1.1}, 0.2, ()=>{
if(data.audio_url){
this.g_cartoon.playAudio(data.audio_url)
}
if(element.content){ if(element.content){
element.content.visible = true; element.content.visible = true;
tweenChange(element.content, {scaleX: element.content.initScaleX, scaleY: element.content.initScaleY}, 0.2) tweenChange(element.content, {scaleX: element.content.initScaleX, scaleY: element.content.initScaleY}, 0.2)
...@@ -889,6 +902,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -889,6 +902,20 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
}) })
}) })
element.show = (index)=>{
this.m_setTimeoutIDs.push(setTimeout(() => {
this.setRenderZIndex(element.ref, zIndexMap.drum + 1)
tweenChange(element.ref, {scaleX: element.initScaleX * 1.05, scaleY: element.initScaleY * 1.05}, 0.1, ()=>{
this.m_setTimeoutIDs.push(setTimeout(() => {
tweenChange(element.ref, {scaleX: element.initScaleX, scaleY: element.initScaleY}, 0.1, ()=>{
this.setRenderZIndex(element.ref, zIndexMap.drum)
})
}, 200))
})
}, 500 * index))
}
return element return element
} }
...@@ -900,7 +927,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -900,7 +927,6 @@ export class PlayComponent implements OnInit, OnDestroy {
drum = _this.g_cartoon.getCartoonElement(item) drum = _this.g_cartoon.getCartoonElement(item)
drum.resetContent(_this.m_dataArrayNew[index]) drum.resetContent(_this.m_dataArrayNew[index])
}) })
console.log(this.g_cartoon.getAllCartoonElement())
} }
checkAllOpen(){ checkAllOpen(){
...@@ -968,6 +994,36 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -968,6 +994,36 @@ export class PlayComponent implements OnInit, OnDestroy {
......
...@@ -32,10 +32,8 @@ const localImages = { ...@@ -32,10 +32,8 @@ const localImages = {
'boy_1': 'assets/play/boy_1.png', 'boy_1': 'assets/play/boy_1.png',
'btn_start': 'assets/play/btn_start.png', 'btn_start': 'assets/play/btn_start.png',
'card_bg': 'assets/play/card_bg.png', 'card_bg': 'assets/play/card_bg.png',
'creatJsonProfile': 'assets/play/creatJsonProfile.py',
'dengqiu1': 'assets/play/dengqiu1.png', 'dengqiu1': 'assets/play/dengqiu1.png',
'drum_highlight': 'assets/play/drum_highlight.png', 'drum_highlight': 'assets/play/drum_highlight.png',
'filename': 'assets/play/filename.txt',
'green': 'assets/play/green.png', 'green': 'assets/play/green.png',
'hand': 'assets/play/hand.png', 'hand': 'assets/play/hand.png',
'hand2': 'assets/play/hand2.png', 'hand2': 'assets/play/hand2.png',
...@@ -52,13 +50,10 @@ const localImages = { ...@@ -52,13 +50,10 @@ const localImages = {
'light4': 'assets/play/light4.png', 'light4': 'assets/play/light4.png',
'qiaoji1': 'assets/play/qiaoji1.png', 'qiaoji1': 'assets/play/qiaoji1.png',
'red': 'assets/play/red.png', 'red': 'assets/play/red.png',
'resizeImg': 'assets/play/resizeImg.py',
'restart': 'assets/play/restart.png', 'restart': 'assets/play/restart.png',
'reversalImg': 'assets/play/reversalImg.py',
'star': 'assets/play/star.png', 'star': 'assets/play/star.png',
'yellow': 'assets/play/yellow.png', 'yellow': 'assets/play/yellow.png',
'light1 (1)': 'assets/play/frame/light1 (1).png', 'light1 (1)': 'assets/play/frame/light1 (1).png',
'light1 (10)': 'assets/play/frame/light1 (10).png', 'light1 (10)': 'assets/play/frame/light1 (10).png',
'light1 (11)': 'assets/play/frame/light1 (11).png', 'light1 (11)': 'assets/play/frame/light1 (11).png',
......
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