Commit 0eda6855 authored by 李维's avatar 李维

New feature

parent bcd9d29f
...@@ -17,6 +17,14 @@ ...@@ -17,6 +17,14 @@
<div *ngIf="item.questionType == 'text'"> <div *ngIf="item.questionType == 'text'">
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()"> <input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
</div> </div>
<div *ngIf="item.questionType == 'text'">
<span>字体</span>
<nz-radio-group [(ngModel)]="item.fontSize" style="margin-left: 20px; margin-top: -11px" (ngModelChange)="save()">
<label nz-radio nzValue="64"></label>
<label nz-radio nzValue="50"></label>
<label nz-radio nzValue="40"></label>
</nz-radio-group>
</div>
<div *ngIf="item.questionType == 'pic'" style="width: 80%"> <div *ngIf="item.questionType == 'pic'" style="width: 80%">
<app-upload-image-with-preview <app-upload-image-with-preview
...@@ -47,7 +55,6 @@ ...@@ -47,7 +55,6 @@
[videoUrl]="item.video_url"></app-upload-video> [videoUrl]="item.video_url"></app-upload-video>
</div> </div>
</div> </div>
<nz-divider style=" margin-top: 80px; margin-bottom: 80px;"></nz-divider> <nz-divider style=" margin-top: 80px; margin-bottom: 80px;"></nz-divider>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
......
...@@ -31,7 +31,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -31,7 +31,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (data) { if (data) {
this.item = data; this.item = data;
} }
if(!this.item.fontSize) {
this.item.fontSize = "50"
}
this.init(); this.init();
this.refresh(); this.refresh();
......
...@@ -923,12 +923,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -923,12 +923,15 @@ export class PlayComponent implements OnInit, OnDestroy {
const questionLabel = new RichText(); const questionLabel = new RichText();
questionLabel.text = this.data.text; questionLabel.text = this.data.text;
questionLabel.width = this.questionBG.width * 0.95; questionLabel.width = this.questionBG.width * 0.95;
questionLabel.x = -questionLabel.width / 2; questionLabel.x = -10 // -questionLabel.width / 2;
questionLabel.y = -28; questionLabel.y = -28;
questionLabel.fontColor = '#fae0a3'; questionLabel.fontColor = '#fae0a3';
questionLabel.fontName = 'MMTextBook-Bold'; questionLabel.fontName = 'MMTextBook-Bold';
questionLabel.disH = 5; questionLabel.disH = 5;
questionLabel.fontSize = 50;
let fontSize = this.data.fontSize?Number(this.data.fontSize):50
questionLabel.fontSize = fontSize;
questionLabel.textAlign = "center"
this.questionBG.addChild(questionLabel); this.questionBG.addChild(questionLabel);
} }
...@@ -1305,7 +1308,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1305,7 +1308,10 @@ export class PlayComponent implements OnInit, OnDestroy {
const pic = createSprite(data.pic_url); const pic = createSprite(data.pic_url);
pic.setScaleXY(getMinScale(pic, maxW, maxH)); pic.setScaleXY(getMinScale(pic, maxW, maxH));
picBg.addChild(pic); picBg.addChild(pic);
// console.log((maxW - pic.width * pic.scaleX) / 2)
// pic.x = (maxW - pic.width * pic.scaleX) / 2 - 5
pic.x = 12
pic.y = 2
picBg['answerRight'] = data.answerRight === '1' ? true : false; picBg['answerRight'] = data.answerRight === '1' ? true : false;
const jianguo = createSprite('bg_xuan3pic'); const jianguo = createSprite('bg_xuan3pic');
......
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