Commit f7538b0c authored by Chen Jiping's avatar Chen Jiping

fix:修复问题

parent 25707be6
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</app-audio-recorder> </app-audio-recorder>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-divider nzText="顶部字母" nzOrientation="left"></nz-divider> <nz-divider nzText="添加词缀" nzOrientation="left"></nz-divider>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="2" nzFor="exercises">操作</nz-form-label> <nz-form-label [nzSpan]="2" nzFor="exercises">操作</nz-form-label>
<nz-form-control [nzSpan]="4"> <nz-form-control [nzSpan]="4">
...@@ -82,9 +82,9 @@ ...@@ -82,9 +82,9 @@
</app-upload-image-with-preview> </app-upload-image-with-preview>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-card nzTitle="卡片配置"> <nz-card nzTitle="弹窗内容设置">
<div nz-card-grid [ngStyle]="gridStyle"> <div nz-card-grid [ngStyle]="gridStyle">
<nz-divider nzText="左边卡片"></nz-divider> <nz-divider nzText="弹转左边"></nz-divider>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">图片</nz-form-label> <nz-form-label [nzSpan]="4">图片</nz-form-label>
<nz-form-control [nzSpan]="8"> <nz-form-control [nzSpan]="8">
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
</div> </div>
<div nz-card-grid [ngStyle]="gridStyle"> <div nz-card-grid [ngStyle]="gridStyle">
<nz-divider nzText="右边卡片"></nz-divider> <nz-divider nzText="弹窗右边"></nz-divider>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">图片</nz-form-label> <nz-form-label [nzSpan]="4">图片</nz-form-label>
<nz-form-control [nzSpan]="8"> <nz-form-control [nzSpan]="8">
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-card-grid [ngStyle]="gridStyle"> <div nz-card-grid [ngStyle]="gridStyle">
<nz-divider nzText="卡片背部"></nz-divider> <nz-divider nzText="弹窗反转后内容设置"></nz-divider>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4">图片</nz-form-label> <nz-form-label [nzSpan]="4">图片</nz-form-label>
<nz-form-control [nzSpan]="6"> <nz-form-control [nzSpan]="6">
......
...@@ -84,9 +84,13 @@ export class Exercises { ...@@ -84,9 +84,13 @@ export class Exercises {
pic.x = width / 2; pic.x = width / 2;
pic.y = height / 2; pic.y = height / 2;
bg.addChild(pic); bg.addChild(pic);
let scale = Math.min(maxW / pic.width, maxH / pic.height);
let mScale = getMaxScale(pic, maxW, maxH); //如果小于1,则缩放图片
pic.setScaleXY(mScale); if (scale < 1) {
pic.setScaleXY(scale);
}
} }
initIndex() { initIndex() {
...@@ -96,10 +100,17 @@ export class Exercises { ...@@ -96,10 +100,17 @@ export class Exercises {
indexBg.fillColor = "#cddce4"; indexBg.fillColor = "#cddce4";
indexBg.x = this.bg.width - 16 * this.scaleX - r; indexBg.x = this.bg.width - 16 * this.scaleX - r;
indexBg.y = 16 * this.scaleY + r; indexBg.y = 16 * this.scaleY + r;
indexBg.setShadow(0, 1, 3, "rgba(0, 0, 0, 0.5)"); indexBg.alpha = 0;
this.bg.addChild(indexBg); this.bg.addChild(indexBg);
this.indexLabelBg = indexBg; this.indexLabelBg = indexBg;
let indexPic = new MySprite();
indexPic.init(this.images.get('index_bg'));
indexPic.setScaleXY(this.scaleX);
indexPic.x = 0;
indexPic.y = 0;
indexBg.addChild(indexPic);
let index = new Label(); let index = new Label();
index.text = this.index + ""; index.text = this.index + "";
index.textAlign = 'center'; index.textAlign = 'center';
......
...@@ -961,6 +961,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -961,6 +961,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}); });
} }
else{ else{
tweenChange(item.text, { alpha: 1 }, 0.2, () => {
jelly(item.text);
});
this.curAudio = this.playAudio(this.curExer.data.leftAnswer.audioUrl, true); this.curAudio = this.playAudio(this.curExer.data.leftAnswer.audioUrl, true);
} }
} }
...@@ -983,6 +986,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -983,6 +986,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}); });
} }
else{ else{
tweenChange(item.text, { alpha: 1 }, 0.2, () => {
jelly(item.text);
});
this.curAudio = this.playAudio(this.curExer.data.rightAnswer.audioUrl, true); this.curAudio = this.playAudio(this.curExer.data.rightAnswer.audioUrl, true);
} }
} }
......
...@@ -5,6 +5,7 @@ const res = [ ...@@ -5,6 +5,7 @@ const res = [
['letter-bg', "assets/play/letter-bg.png"], ['letter-bg', "assets/play/letter-bg.png"],
['close', "assets/play/close.png"], ['close', "assets/play/close.png"],
['overturn', "assets/play/overturn.png"], ['overturn', "assets/play/overturn.png"],
['index_bg', "assets/play/index_bg.png"],
]; ];
......
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