Commit d75cd232 authored by 范雪寒's avatar 范雪寒

fix: 正确音效;点击正确后其他选项播放动画;表单页单选框bug修复

parent 29107ec2
......@@ -125,6 +125,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
radioClick(questionIdx, optionIdx) {
this.item.questionList[questionIdx].rightOptionIdx = optionIdx;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.save();
}
......
{
"ver": "2.0.1",
"uuid": "180326fb-4b13-4101-b74b-5c5c191029d2",
"downloadMode": 0,
"duration": 1.044898,
"subMetas": {}
}
\ No newline at end of file
......@@ -1675,7 +1675,7 @@
"array": [
0,
0,
709.2748056994553,
707.5427548918864,
0,
0,
0,
......@@ -3908,6 +3908,9 @@
"wrong": {
"__uuid__": "cbec1a32-0bc0-4ac8-bfff-b72f9faf24b7"
},
"right": {
"__uuid__": "180326fb-4b13-4101-b74b-5c5c191029d2"
},
"_id": "f8MXmdg/FGCpZZnMxAL8RJ"
},
{
......
......@@ -10,6 +10,7 @@ import {
playEffect,
stopEffect,
loadImgByUrl,
jelly,
blinkNode,
stopBlinkNode,
asyncLoadImgByUrl,
......@@ -202,13 +203,25 @@ cc.Class({
const btnFlower = cc.find('OptionSpeakerBtn/BtnFlower', optionNode);
const btnFlowerP = cc.find('OptionSpeakerBtn/BtnFlower_P', optionNode);
addButtonListener(cc.find('OptionSpeakerBtn', optionNode), async () => {
const optionSpeakerBtn = cc.find('OptionSpeakerBtn', optionNode);
optionSpeakerBtn.on('click', async () => {
if (!optionNode.canClick) {
return;
}
if (optionSpeakerBtn.canNotClick) {
return;
}
optionSpeakerBtn.canNotClick = true;
playEffect('按钮');
await jelly(optionSpeakerBtn);
blinkNode(optionNode, btnFlowerP, btnFlower);
await asyncPlayEffectByUrl(data.optionAudio);
asyncPlayDragonBoneAnimation(animeNode, 'normal', 1);
stopBlinkNode(optionNode, btnFlowerP, btnFlower);
optionSpeakerBtn.canNotClick = false;
});
});
},
......@@ -235,6 +248,8 @@ cc.Class({
const optionList = this.data.questionList[this.status.currentQuestionIdx].optionList;
const posNode = cc.find(`Canvas/OptionPosListBase/OptionTarget_${optionList.length}_${idx}`)
playEffect('right');
cc.tween(optionNode)
.to(1, { x: posNode.x }, { easing: 'quadIn' })
.start();
......@@ -242,6 +257,17 @@ cc.Class({
.to(1, { y: posNode.y, scale: 0.3 })
.to(0.5, { opacity: 0 })
.start();
optionList.forEach((data, idx) => {
const option = cc.find(`Canvas/optionNode_${idx}`);
option.canClick = false;
if (option != optionNode) {
const animeNode = cc.find('OptionDragonBoneBaseNode/animeNode', option);
animeNode.color = cc.color(255, 255, 255, 255);
asyncPlayDragonBoneAnimation(animeNode, 'normal', -1);
}
});
},
async questionBoardDown() {
......
......@@ -6,6 +6,10 @@ cc.Class({
default: null,
type: cc.AudioClip
},
right: {
default: null,
type: cc.AudioClip
},
},
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