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

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

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