Commit 631f7f50 authored by Chen Jiping's avatar Chen Jiping

完善

parent a4761847
...@@ -100,7 +100,7 @@ export class Exercises { ...@@ -100,7 +100,7 @@ export class Exercises {
playAudio(type, callback = null){ playAudio(type, callback = null){
if(type == 'T'){ if(type == 'T'){
playAudio(this.audio); playAudio(this.audio, true);
return this.audio; return this.audio;
} }
else if(type == 'I'){ else if(type == 'I'){
......
...@@ -42,7 +42,7 @@ export class Skin { ...@@ -42,7 +42,7 @@ export class Skin {
this.scaleX = this.scaleY = sacle; this.scaleX = this.scaleY = sacle;
if (this.skinType == 'B') { if (this.skinType == 'B') {
this.intervalHeight = 56 * this.scaleY; this.intervalHeight = 117 * this.scaleY;
this.intervalWidth = 28 * this.scaleX; this.intervalWidth = 28 * this.scaleX;
...@@ -125,14 +125,22 @@ export class Skin { ...@@ -125,14 +125,22 @@ export class Skin {
textLabel.y = bg.height / 2; textLabel.y = bg.height / 2;
bg.addChild(textLabel); bg.addChild(textLabel);
const indexBg = new MySprite();
indexBg.init(this.images.get('skin_2_index_bg')); const indexPic = new MySprite();
indexBg.scaleX = this.scaleX; indexPic.init(this.images.get('skin_2_index_bg'));
indexBg.scaleY = this.scaleY; indexPic.scaleX = this.scaleX;
indexBg.x = bg.width / 2; indexPic.scaleY = this.scaleY;
indexBg.y = - indexBg.getBoundingBox().height / 2 + 14 * this.scaleY; indexPic.x = indexPic.getBoundingBox().width / 2;
indexPic.y = indexPic.getBoundingBox().height / 2;
const indexBg = new ShapeRect();
indexBg.setSize(indexPic.getBoundingBox().width, indexPic.getBoundingBox().height);
indexBg.x = (bg.width - indexBg.width) / 2;
indexBg.y = - (indexBg.height - 14 * this.scaleY);
indexBg.alpha = 0;
exercises.indexBg = indexBg; exercises.indexBg = indexBg;
bg.addChild(indexBg); bg.addChild(indexBg);
indexBg.addChild(indexPic);
const indexLabel = new Label(); const indexLabel = new Label();
exercises.indexLabel = indexLabel; exercises.indexLabel = indexLabel;
...@@ -143,8 +151,8 @@ export class Skin { ...@@ -143,8 +151,8 @@ export class Skin {
indexLabel.fontColor = "#000000"; indexLabel.fontColor = "#000000";
indexLabel.setMaxSize(indexBg.getBoundingBox().width); indexLabel.setMaxSize(indexBg.getBoundingBox().width);
indexLabel.refreshSize(); indexLabel.refreshSize();
indexLabel.x = - indexLabel.width / 2 + 6 * this.scaleX; indexLabel.x = (indexBg.width - indexLabel.getBoundingBox().width) / 2 + 2 * this.scaleX;
indexLabel.y = - 6 * this.scaleY; indexLabel.y = indexBg.height / 2 - 4 * this.scaleY;
indexLabel.alpha = 0; indexLabel.alpha = 0;
indexBg.addChild(indexLabel); indexBg.addChild(indexLabel);
} }
......
...@@ -515,6 +515,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -515,6 +515,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.curAnswerIndex = 1; this.curAnswerIndex = 1;
if (this.curAudio) {
this.curAudio.pause();
}
} }
...@@ -674,7 +678,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -674,7 +678,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
//起始y坐标 //起始y坐标
let startY = (this.canvasHeight - totalHeight) / 2; let startY = (this.canvasHeight - totalHeight) / 2 + this.title.titleBg.height;
let tempStartX = startX; let tempStartX = startX;
...@@ -770,6 +774,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -770,6 +774,9 @@ export class PlayComponent implements OnInit, OnDestroy {
if (exercisesObj.indexShowed) { if (exercisesObj.indexShowed) {
this.curAudio = exercisesObj.playAudio('I'); this.curAudio = exercisesObj.playAudio('I');
} }
else{
this.curAudio = exercisesObj.playAudio('T');
}
} }
return; return;
......
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