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

Bug fix

parent cb639768
......@@ -2021,6 +2021,11 @@
"resolved": "https://registry.npmjs.org/angular2-fontawesome/-/angular2-fontawesome-5.2.1.tgz",
"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": {
"version": "1.6.4",
"resolved": "https://registry.npmjs.org/angularx-qrcode/-/angularx-qrcode-1.6.4.tgz",
......
......@@ -88,6 +88,7 @@ export class PlayComponent implements OnInit, OnDestroy {
g_firstTouch = true;
g_partTitle_x = null;
g_mainTitle_x = null;
g_dragDelay = 300 //放置拖拽事件触发播放音效
// ------------------------------------
// ------------ 私有数据 ------------
......@@ -298,7 +299,7 @@ export class PlayComponent implements OnInit, OnDestroy {
labelWidth = w/2
return {
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 {
}, (w, h)=>{
return {
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 {
this.render(element.ref)
this.render(elementDrag.ref)
element.timeoutID = null
this.subscribeMapDragEvent(element.id, ()=>{
item.media.audio_url && this.g_cartoon.playAudio(item.media.audio_url)
console.log(item.media.audio_url)
element.timeoutID = setTimeout(() => {
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.y = this.g_clickY
}, ()=>{
......@@ -430,9 +440,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(textDrag.ref)
this.render(element.ref)
element.timeoutID = null
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;
}, ()=>{
if(element.timeoutID) {
clearTimeout(element.timeoutID)
element.timeoutID = null
}
textDrag.ref.x = this.g_clickX,
textDrag.ref.y = this.g_clickY
}, ()=>{
......@@ -473,9 +494,20 @@ export class PlayComponent implements OnInit, OnDestroy {
this.render(textDrag.ref)
this.render(element.ref)
element.timeoutID = null
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;
}, ()=>{
if(element.timeoutID) {
clearTimeout(element.timeoutID)
element.timeoutID = null
}
textDrag.ref.x = this.g_clickX,
textDrag.ref.y = this.g_clickY
}, ()=>{
......@@ -498,7 +530,7 @@ export class PlayComponent implements OnInit, OnDestroy {
value = this.g_formData.bgItem.wordLeft_text;
} else if(key == -2) {
value = this.g_formData.bgItem.wordRight_text;
} else {
} else if(this.g_formData.hotZoneItemArr.length > 0) {
value = this.g_formData.hotZoneItemArr[combinIndex].media.text
}
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