Commit 5dff1197 authored by Tt's avatar Tt

修改成功时的拖拽禁止操作

parent 8a69c70c
...@@ -194,6 +194,8 @@ cc.Class({ ...@@ -194,6 +194,8 @@ cc.Class({
const box_mid = cc.find('Canvas/bg/box_mid'); const box_mid = cc.find('Canvas/bg/box_mid');
box_mid.removeAllChildren(); box_mid.removeAllChildren();
//TODO:copy---end //TODO:copy---end
this.canTouch = true;
this.showSubmitBtn();
const arr = randomSortByArr(this.data.question_arr[questionIdx].option_arr); const arr = randomSortByArr(this.data.question_arr[questionIdx].option_arr);
arr.forEach(async (option, idx) => { arr.forEach(async (option, idx) => {
...@@ -222,6 +224,9 @@ cc.Class({ ...@@ -222,6 +224,9 @@ cc.Class({
const box = cc.find('Canvas/bg/box'); const box = cc.find('Canvas/bg/box');
optionNode.on(cc.Node.EventType.TOUCH_START, (event) => { optionNode.on(cc.Node.EventType.TOUCH_START, (event) => {
if (!this.canTouch) {
return;
}
if (optionNode.optionData.selected) { if (optionNode.optionData.selected) {
return; return;
} }
...@@ -239,6 +244,9 @@ cc.Class({ ...@@ -239,6 +244,9 @@ cc.Class({
this.playAudioByUrl(optionNode.optionData.audio_url); this.playAudioByUrl(optionNode.optionData.audio_url);
}); });
optionNode.on(cc.Node.EventType.TOUCH_MOVE, (event) => { optionNode.on(cc.Node.EventType.TOUCH_MOVE, (event) => {
if (!this.canTouch) {
return;
}
if (optionNode.optionData.selected) { if (optionNode.optionData.selected) {
return; return;
} }
...@@ -247,6 +255,9 @@ cc.Class({ ...@@ -247,6 +255,9 @@ cc.Class({
optionNode.y = optionNode.startPos.y + (location.y - optionNode.startLocation.y); optionNode.y = optionNode.startPos.y + (location.y - optionNode.startLocation.y);
}); });
optionNode.on(cc.Node.EventType.TOUCH_END, (event) => { optionNode.on(cc.Node.EventType.TOUCH_END, (event) => {
if (!this.canTouch) {
return;
}
if (optionNode.optionData.selected) { if (optionNode.optionData.selected) {
return; return;
} }
...@@ -368,9 +379,10 @@ cc.Class({ ...@@ -368,9 +379,10 @@ cc.Class({
onAnswerRight() { onAnswerRight() {
this.canTouch = false;
//TODO:copy---放烟花时机修改 //TODO:copy---放烟花时机修改
this.showFlower(); this.showFlower();
this.hideSubmitBtn();
this.coolCatSpeakRight(() => { this.coolCatSpeakRight(() => {
//TODO:copy //TODO:copy
setTimeout(() => { setTimeout(() => {
...@@ -471,7 +483,7 @@ cc.Class({ ...@@ -471,7 +483,7 @@ cc.Class({
return; return;
} }
submitBtn.showed = false; submitBtn.showed = false;
submitBtn.off('click'); // submitBtn.off('click');
cc.tween(submitBtn) cc.tween(submitBtn)
.by(1, { y: -submitBtn.height }) .by(1, { y: -submitBtn.height })
.start(); .start();
......
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