Commit 022ef2ad authored by Wei Li's avatar Wei Li

Bug fix

parent cb639768
...@@ -2021,6 +2021,11 @@ ...@@ -2021,6 +2021,11 @@
"resolved": "https://registry.npmjs.org/angular2-fontawesome/-/angular2-fontawesome-5.2.1.tgz", "resolved": "https://registry.npmjs.org/angular2-fontawesome/-/angular2-fontawesome-5.2.1.tgz",
"integrity": "sha512-aS6Y8dBLFdSx4yqyqIQDujIKAHJjqvdaD/y3/qDPE/pHYd/HBZZMLBlHcVuocraA5TuPBWBxF1w9NxT+3J54nQ==" "integrity": "sha512-aS6Y8dBLFdSx4yqyqIQDujIKAHJjqvdaD/y3/qDPE/pHYd/HBZZMLBlHcVuocraA5TuPBWBxF1w9NxT+3J54nQ=="
}, },
"angular2-uuid": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/angular2-uuid/-/angular2-uuid-1.1.1.tgz",
"integrity": "sha1-cvA81TK39AAy6x7PufhFc4S+lW4="
},
"angularx-qrcode": { "angularx-qrcode": {
"version": "1.6.4", "version": "1.6.4",
"resolved": "https://registry.npmjs.org/angularx-qrcode/-/angularx-qrcode-1.6.4.tgz", "resolved": "https://registry.npmjs.org/angularx-qrcode/-/angularx-qrcode-1.6.4.tgz",
......
...@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy {
g_firstTouch = true; g_firstTouch = true;
g_partTitle_x = null; g_partTitle_x = null;
g_mainTitle_x = null; g_mainTitle_x = null;
g_dragDelay = 300 //放置拖拽事件触发播放音效
// ------------------------------------ // ------------------------------------
// ------------ 私有数据 ------------ // ------------ 私有数据 ------------
...@@ -298,7 +299,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -298,7 +299,7 @@ export class PlayComponent implements OnInit, OnDestroy {
labelWidth = w/2 labelWidth = w/2
return { return {
x: this.g_partTitle_x - 20 * this.g_mapScale + labelWidth * this.g_mapScale, x: this.g_partTitle_x - 20 * this.g_mapScale + labelWidth * this.g_mapScale,
y: (65*this.g_mapScale) / 2 y: 5*this.g_mapScale + (65*this.g_mapScale) / 2
} }
}) })
...@@ -310,7 +311,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -310,7 +311,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}, (w, h)=>{ }, (w, h)=>{
return { return {
x: this.g_partTitle_x + labelWidth + 60 * this.g_mapScale, x: this.g_partTitle_x + labelWidth + 60 * this.g_mapScale,
y: (65*this.g_mapScale) / 2 y: 5*this.g_mapScale + (65*this.g_mapScale) / 2
} }
}) })
...@@ -387,10 +388,19 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -387,10 +388,19 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(element.ref) this.render(element.ref)
this.render(elementDrag.ref) this.render(elementDrag.ref)
element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
item.media.audio_url && this.g_cartoon.playAudio(item.media.audio_url) element.timeoutID = setTimeout(() => {
console.log(item.media.audio_url) if(item.media.audio_url) {
this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(item.media.audio_url)
}
}, this.g_dragDelay);
}, ()=>{ }, ()=>{
if(element.timeoutID) {
clearTimeout(element.timeoutID)
element.timeoutID = null
}
elementDrag.ref.x = this.g_clickX, elementDrag.ref.x = this.g_clickX,
elementDrag.ref.y = this.g_clickY elementDrag.ref.y = this.g_clickY
}, ()=>{ }, ()=>{
...@@ -430,9 +440,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -430,9 +440,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(textDrag.ref) this.render(textDrag.ref)
this.render(element.ref) this.render(element.ref)
element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
element.timeoutID = setTimeout(() => {
if(this.g_formData.bgItem.wordLeft_audio_url) {
this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.bgItem.wordLeft_audio_url)
}
}, this.g_dragDelay);
text.ref.alpha = 0.5; text.ref.alpha = 0.5;
}, ()=>{ }, ()=>{
if(element.timeoutID) {
clearTimeout(element.timeoutID)
element.timeoutID = null
}
textDrag.ref.x = this.g_clickX, textDrag.ref.x = this.g_clickX,
textDrag.ref.y = this.g_clickY textDrag.ref.y = this.g_clickY
}, ()=>{ }, ()=>{
...@@ -473,9 +494,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -473,9 +494,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(textDrag.ref) this.render(textDrag.ref)
this.render(element.ref) this.render(element.ref)
element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{ this.subscribeMapDragEvent(element.id, ()=>{
element.timeoutID = setTimeout(() => {
if(this.g_formData.bgItem.wordRight_audio_url) {
this.g_cartoon.stopAllAudio()
this.g_cartoon.playAudio(this.g_formData.bgItem.wordRight_audio_url)
}
}, this.g_dragDelay);
text.ref.alpha = 0.5; text.ref.alpha = 0.5;
}, ()=>{ }, ()=>{
if(element.timeoutID) {
clearTimeout(element.timeoutID)
element.timeoutID = null
}
textDrag.ref.x = this.g_clickX, textDrag.ref.x = this.g_clickX,
textDrag.ref.y = this.g_clickY textDrag.ref.y = this.g_clickY
}, ()=>{ }, ()=>{
...@@ -498,7 +530,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -498,7 +530,7 @@ export class PlayComponent implements OnInit, OnDestroy {
value = this.g_formData.bgItem.wordLeft_text; value = this.g_formData.bgItem.wordLeft_text;
} else if(key == -2) { } else if(key == -2) {
value = this.g_formData.bgItem.wordRight_text; value = this.g_formData.bgItem.wordRight_text;
} else { } else if(this.g_formData.hotZoneItemArr.length > 0) {
value = this.g_formData.hotZoneItemArr[combinIndex].media.text value = this.g_formData.hotZoneItemArr[combinIndex].media.text
} }
textAll.push( textAll.push(
......
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