Commit 9ce7f7ea authored by 范雪寒's avatar 范雪寒

fix: 右下角按钮状态改变

parent 93e104fc
......@@ -91,6 +91,8 @@ cc.Class({
this.initListeners();
this.updateButtons();
this.updateBgSize();
if (this._onLoadFinishFunc && typeof (this._onLoadFinishFunc) == 'function') {
......@@ -117,6 +119,20 @@ cc.Class({
optionPosListBase.scaleY = canvas.height / optionPosListBase.height;
},
updateButtons() {
const btnBefore = cc.find('Canvas/BtnNode/BtnBefore');
btnBefore.color = cc.color(255, 255, 255);
if (this.status.currentQuestionIdx <= 0) {
btnBefore.color = cc.color(150, 150, 150);
}
const btnNext = cc.find('Canvas/BtnNode/BtnNext');
btnNext.color = cc.color(255, 255, 255);
if (this.status.currentQuestionIdx + 1 >= this.data.questionList.length) {
btnNext.color = cc.color(150, 150, 150);
}
},
initListeners() {
addButtonListener(cc.find('Canvas/BtnNode/BtnBefore'), () => {
if (this.status.currentQuestionIdx <= 0) {
......@@ -124,6 +140,7 @@ cc.Class({
}
this.status.currentQuestionIdx--;
this.showQuestion();
this.updateButtons();
return true;
});
......@@ -133,6 +150,7 @@ cc.Class({
}
this.status.currentQuestionIdx++;
this.showQuestion();
this.updateButtons();
return true;
});
......
......@@ -56,5 +56,60 @@ module.exports = {
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}, {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/90e313405ba454880e75ff6958ea05c0.mp3",
"questionTxt": "12as s df sdfab",
"rightOptionIdx": 1,
"optionList": [{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/a86e5c9e40e818879bb96c6d566e2c47.json",
"name": "dc_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/c7a47999c11c158e717c49861d39c3fa.json",
"name": "dc_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/4ca3ab5ea9ce40cfebee20952e22e76e.png",
"name": "dc_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
},
{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/703a41d6c7afe6fe653014d585ef0d58.json",
"name": "d1_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/02bbebdc4a9f4a35d9ec285f61fca19c.json",
"name": "d1_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ba2041fb4f69c37be52b76f5fb274c09.png",
"name": "d1_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/8ba49890c74b8c68b1da4556ac8c1dda.mp3"
},
{
"optionDragonBone": {
"skeJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/2cd8f3daa6534efd6f7ca3b138581e5c.json",
"name": "ant_ske.json"
},
"texJsonData": {
"url": "http://staging-teach.cdn.ireadabc.com/b2d30dbdfe2ec050af5651f8f609b56d.json",
"name": "ant_tex.json"
},
"texPngData": {
"url": "http://staging-teach.cdn.ireadabc.com/ad816ff2b5823868bf87a5c05bc949a1.png",
"name": "ant_tex.png"
}
},
"optionAudio": "http://staging-teach.cdn.ireadabc.com/b75df34ef55bd1c6e3a799f1dac87fec.mp3"
}]
}]
}
\ No newline at end of file
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