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

fix: bugs

parent df7cd19f
...@@ -21,7 +21,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -21,7 +21,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
addQuestion() { addQuestion() {
this.item.questionList.push({ this.item.questionList.push({
questionAudio: '', questionAudio: '',
speedLevel: 2, speedLevel: 1,
rigthNumber: 5, rigthNumber: 5,
answerList: [] answerList: []
}); });
......
...@@ -1106,7 +1106,7 @@ ...@@ -1106,7 +1106,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
557, 557,
330, 300,
0, 0,
0, 0,
0, 0,
...@@ -1175,7 +1175,7 @@ ...@@ -1175,7 +1175,7 @@
"_alignFlags": 33, "_alignFlags": 33,
"_left": 0, "_left": 0,
"_right": 50.5, "_right": 50.5,
"_top": 30, "_top": 60,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -3103,7 +3103,7 @@ ...@@ -3103,7 +3103,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 176, "width": 176,
"height": 164 "height": 162
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -3247,7 +3247,7 @@ ...@@ -3247,7 +3247,7 @@
} }
], ],
"_spriteFrame": null, "_spriteFrame": null,
"_type": 1, "_type": 0,
"_segments": 64, "_segments": 64,
"_N$alphaThreshold": 0, "_N$alphaThreshold": 0,
"_N$inverted": false, "_N$inverted": false,
...@@ -3782,7 +3782,7 @@ ...@@ -3782,7 +3782,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"showInEditor": false, "showInEditor": false,
"_id": "f05W5JjmdFk7xuAgqQkcg3" "_id": "b32fignA1E/ZHx1Ogc9aIC"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -3817,7 +3817,7 @@ ...@@ -3817,7 +3817,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "b2+S45JnBLZLbWhO7q81l2" "_id": "51w5xnPDZPu5aHqpFiXcJd"
}, },
{ {
"__type__": "cc.RichText", "__type__": "cc.RichText",
...@@ -4315,8 +4315,8 @@ ...@@ -4315,8 +4315,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -4471,8 +4471,8 @@ ...@@ -4471,8 +4471,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -4627,8 +4627,8 @@ ...@@ -4627,8 +4627,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -4783,8 +4783,8 @@ ...@@ -4783,8 +4783,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -4939,8 +4939,8 @@ ...@@ -4939,8 +4939,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -5095,8 +5095,8 @@ ...@@ -5095,8 +5095,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -5251,8 +5251,8 @@ ...@@ -5251,8 +5251,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
...@@ -5407,8 +5407,8 @@ ...@@ -5407,8 +5407,8 @@
0, 0,
-0.7071067811865475, -0.7071067811865475,
0.7071067811865476, 0.7071067811865476,
1, 0.5,
1, 0.5,
1 1
] ]
}, },
......
...@@ -168,7 +168,7 @@ cc.Class({ ...@@ -168,7 +168,7 @@ cc.Class({
const BtnSpeaker = cc.find('Canvas/bg/BtnSpeaker'); const BtnSpeaker = cc.find('Canvas/bg/BtnSpeaker');
addBtnListener(BtnSpeaker, async () => { addBtnListener(BtnSpeaker, async () => {
await this.playQuestionAudio(); await this.playQuestionAudio();
}, this.playAudio.bind(this, 'btn')); });
const bg = cc.find('Canvas/bg'); const bg = cc.find('Canvas/bg');
bg.on('touchstart', (event) => { bg.on('touchstart', (event) => {
...@@ -333,7 +333,7 @@ cc.Class({ ...@@ -333,7 +333,7 @@ cc.Class({
.repeatForever() .repeatForever()
.start(); .start();
this.playAudio('appare'); this.playAudio('appare', null, 0.4);
ball.on('touchstart', async (event) => { ball.on('touchstart', async (event) => {
if (ball.canNotTouch) { if (ball.canNotTouch) {
...@@ -387,8 +387,18 @@ cc.Class({ ...@@ -387,8 +387,18 @@ cc.Class({
createTextBall(answer) { createTextBall(answer) {
const ball = cc.instantiate(cc.find('BallTxt')); const ball = cc.instantiate(cc.find('BallTxt'));
const mask = cc.find('Mask', ball);
const text = cc.find('Mask/AnswerText', ball); const text = cc.find('Mask/AnswerText', ball);
text.getComponent(cc.RichText).string = `<color=#37397b>${answer.answerTxt}</color>`; text.getComponent(cc.RichText).string = `<color=#37397b>${answer.answerTxt}</color>`;
cc.tween(text)
.delay(0)
.call(() => {
console.log('text = ' + answer.answerTxt + ', text.width = ' + text.width);
text.scale = Math.min(mask.width / text.width, 1);
})
.start();
return ball; return ball;
}, },
...@@ -505,10 +515,10 @@ cc.Class({ ...@@ -505,10 +515,10 @@ cc.Class({
await asyncTweenTo(node, 0.05, { x: x }); await asyncTweenTo(node, 0.05, { x: x });
}, },
playAudio(audioName, cb) { playAudio(audioName, cb, value = 0.8) {
const audioNode = cc.find(`AudioBase/${audioName}`); const audioNode = cc.find(`AudioBase/${audioName}`);
const audioClip = audioNode.getComponent(cc.AudioSource).clip; const audioClip = audioNode.getComponent(cc.AudioSource).clip;
const id = cc.audioEngine.play(audioClip, false, 0.8); const id = cc.audioEngine.play(audioClip, false, value);
cc.audioEngine.setFinishCallback(id, () => { cc.audioEngine.setFinishCallback(id, () => {
if (cb) { if (cb) {
cb(); cb();
......
export const defaultData = { export const defaultData = {
"questionList": [{ "questionList": [{
"questionAudio": "http://staging-teach.cdn.ireadabc.com/b44fa51172b19b555fda30717c773027.mp3", "questionAudio": "http://staging-teach.cdn.ireadabc.com/b44fa51172b19b555fda30717c773027.mp3",
"speedLevel": 2, "speedLevel": 1,
"rigthNumber": 5, "rigthNumber": 5,
"answerList": [{ "answerList": [{
"answerAudio": "http://staging-teach.cdn.ireadabc.com/b44fa51172b19b555fda30717c773027.mp3", "answerAudio": "http://staging-teach.cdn.ireadabc.com/b44fa51172b19b555fda30717c773027.mp3",
...@@ -12,7 +12,7 @@ export const defaultData = { ...@@ -12,7 +12,7 @@ export const defaultData = {
}, },
{ {
"answerAudio": "", "answerAudio": "",
"answerTxt": "cet", "answerTxt": "cettttttttttttttttt",
"answerImg": "", "answerImg": "",
"answerType": "txt", "answerType": "txt",
"rightAnswer": false "rightAnswer": false
...@@ -41,7 +41,7 @@ export const defaultData = { ...@@ -41,7 +41,7 @@ export const defaultData = {
}, },
{ {
"questionAudio": "http://staging-teach.cdn.ireadabc.com/a6a5c388c636bc6d063946e91b4bd21a.mp3", "questionAudio": "http://staging-teach.cdn.ireadabc.com/a6a5c388c636bc6d063946e91b4bd21a.mp3",
"speedLevel": 2, "speedLevel": 1,
"rigthNumber": 5, "rigthNumber": 5,
"answerList": [{ "answerList": [{
"answerAudio": "http://staging-teach.cdn.ireadabc.com/a6a5c388c636bc6d063946e91b4bd21a.mp3", "answerAudio": "http://staging-teach.cdn.ireadabc.com/a6a5c388c636bc6d063946e91b4bd21a.mp3",
......
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