Commit db3edc2e authored by 李维's avatar 李维

Bug fix

parent 96334524
...@@ -493,6 +493,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -493,6 +493,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if(nextQuestion) { if(nextQuestion) {
pannel.currentQuestionIndex++; pannel.currentQuestionIndex++;
} }
if(this.g_formData.dataArray.length == pannel.currentQuestionInde+1) {
return;
}
this.g_cartoon.playAudio("wtcx") this.g_cartoon.playAudio("wtcx")
let textString = "" let textString = ""
let startX = 42 * this.g_mapScale; let startX = 42 * this.g_mapScale;
...@@ -665,12 +668,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -665,12 +668,18 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
const scrollPannel = this.g_cartoon.getCartoonElement("scroll-pannel") const scrollPannel = this.g_cartoon.getCartoonElement("scroll-pannel")
btnQuestion.canClick = true;
this.subscribeMapDownEvent(btnQuestion.id, ()=>{ this.subscribeMapDownEvent(btnQuestion.id, ()=>{
if(!btnQuestion.canClick) {
this.g_enableMapDown = true;
return
}
let text = this.g_formData.dataArray[this.m_currentQuestionIndex].questionText?this.g_formData.dataArray[this.m_currentQuestionIndex].questionText:"" let text = this.g_formData.dataArray[this.m_currentQuestionIndex].questionText?this.g_formData.dataArray[this.m_currentQuestionIndex].questionText:""
let textArray = text.split(/\n/) let textArray = text.split(/\n/)
let lastIndex = textArray.length; let lastIndex = textArray.length;
this.g_cartoon.playAudio("click_btn") this.g_cartoon.playAudio("click_btn")
jelly(btnQuestion.ref) jelly(btnQuestion.ref)
btnQuestion.canClick = false;
textArray.forEach((item, index) => { textArray.forEach((item, index) => {
if(index==0) { if(index==0) {
setTimeout(() => { setTimeout(() => {
...@@ -679,6 +688,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -679,6 +688,7 @@ export class PlayComponent implements OnInit, OnDestroy {
setTimeout(() => { setTimeout(() => {
btnQuestion.hide(()=>{ btnQuestion.hide(()=>{
btnAnswer.show(()=>{ btnAnswer.show(()=>{
btnQuestion.canClick = true;
this.g_enableMapDown = true; this.g_enableMapDown = true;
}) })
}) })
...@@ -692,6 +702,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -692,6 +702,7 @@ export class PlayComponent implements OnInit, OnDestroy {
setTimeout(() => { setTimeout(() => {
btnQuestion.hide(()=>{ btnQuestion.hide(()=>{
btnAnswer.show(()=>{ btnAnswer.show(()=>{
btnQuestion.canClick = true;
this.g_enableMapDown = true; this.g_enableMapDown = true;
}) })
}) })
...@@ -702,12 +713,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -702,12 +713,18 @@ export class PlayComponent implements OnInit, OnDestroy {
}) })
}, 100) }, 100)
btnAnswer.canClick = true;
this.subscribeMapDownEvent(btnAnswer.id, ()=>{ this.subscribeMapDownEvent(btnAnswer.id, ()=>{
if(!btnAnswer.canClick) {
this.g_enableMapDown = true;
return
}
let text = this.g_formData.dataArray[this.m_currentQuestionIndex].answerText?this.g_formData.dataArray[this.m_currentQuestionIndex].answerText:"" let text = this.g_formData.dataArray[this.m_currentQuestionIndex].answerText?this.g_formData.dataArray[this.m_currentQuestionIndex].answerText:""
let textArray = text.split(/\n/) let textArray = text.split(/\n/)
let lastIndex = textArray.length; let lastIndex = textArray.length;
this.g_cartoon.playAudio("click_btn") this.g_cartoon.playAudio("click_btn")
jelly(btnAnswer.ref); jelly(btnAnswer.ref);
btnAnswer.canClick = false;
textArray.forEach((item, index) => { textArray.forEach((item, index) => {
setTimeout(() => { setTimeout(() => {
scrollPannel.insertAnswer(item); scrollPannel.insertAnswer(item);
...@@ -717,9 +734,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -717,9 +734,11 @@ export class PlayComponent implements OnInit, OnDestroy {
this.nextQuestion((status)=>{ this.nextQuestion((status)=>{
if(status) { if(status) {
btnQuestion.show(()=>{ btnQuestion.show(()=>{
btnAnswer.canClick = true;
this.g_enableMapDown = true; this.g_enableMapDown = true;
}) })
} else { } else {
btnAnswer.canClick = true;
this.g_enableMapDown = true; this.g_enableMapDown = true;
} }
}) })
......
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