Commit 807ae0a0 authored by 范雪寒's avatar 范雪寒

feat: 停止自动播放音乐&删除空选项

parent 7c7976fc
This diff is collapsed.
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
"rxjs": "^6.3.3", "rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3", "rxjs-compat": "^6.3.3",
"rxjs-tslint": "^0.1.6", "rxjs-tslint": "^0.1.6",
"sass": "^1.32.6",
"spark-md5": "^3.0.0", "spark-md5": "^3.0.0",
"webpack": "^4.28.2", "webpack": "^4.28.2",
"zone.js": "^0.8.26" "zone.js": "^0.8.26"
...@@ -70,6 +71,7 @@ ...@@ -70,6 +71,7 @@
"protractor": "^5.4.2", "protractor": "^5.4.2",
"ts-node": "~5.0.1", "ts-node": "~5.0.1",
"tslint": "^5.12.0", "tslint": "^5.12.0",
"node-sass": "^4.0.0",
"typescript": "3.1.1" "typescript": "3.1.1"
} }
} }
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
<div style="margin-top: 1vw; margin-left: 2vw; margin-bottom: 3vw;">
<label nz-checkbox nzValue="stopPlayBgAudio" [(ngModel)]="stopPlayBgAudio"
(ngModelChange)="clickCheckBox()">停止播放背景音乐</label>
</div>
<div *ngFor="let it of picArr; let i = index" style="padding: 0.5vw"> <div *ngFor="let it of picArr; let i = index" style="padding: 0.5vw">
......
...@@ -23,6 +23,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -23,6 +23,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item: any; _item: any;
stopPlayBgAudio = false;
KEY = 'hw_003'; KEY = 'hw_003';
...@@ -103,6 +105,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -103,6 +105,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.contentObj.optionType = 'A'; this.item.contentObj.optionType = 'A';
} }
this.stopPlayBgAudio = this.item.contentObj.stopPlayBgAudio;
let tmpFlag = false; let tmpFlag = false;
...@@ -247,14 +250,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -247,14 +250,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
clickCheckBox() { clickCheckBox() {
console.log(' in clickCheckBox'); console.log(' in clickCheckBox');
this.item.contentObj.stopPlayBgAudio = !this.item.contentObj.stopPlayBgAudio;
this.saveItem(); this.saveItem();
} }
saveItem() { saveItem() {
console.log(' in saveItem'); console.log(' in saveItem');
// this.update.emit(this.item); // this.update.emit(this.item);
console.log('this.item' + JSON.stringify(this.item));
this.save(); this.save();
} }
......
...@@ -597,8 +597,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -597,8 +597,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initQuestionWindow(); this.initQuestionWindow();
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg'); this.playAudio('bg');
} }
}
showStartAnima() { showStartAnima() {
...@@ -2001,8 +2003,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2001,8 +2003,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.wheelRun(); this.wheelRun();
this.playAudio('click_1'); this.playAudio('click_1');
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg'); this.playAudio('bg');
} }
}
getNextItemIndex() { getNextItemIndex() {
...@@ -2137,8 +2141,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2137,8 +2141,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.textBgArr[i].wrongBg.visible = false; this.textBgArr[i].wrongBg.visible = false;
if (this.answerLabelArr[i] && answerArr[i].text) { if (this.answerLabelArr[i] && answerArr[i].text) {
this.answerLabelArr[i].text = answerArr[i].text; this.answerLabelArr[i].text = answerArr[i].text;
this.textBgArr[i].visible = true;
} else { } else {
this.answerLabelArr[i].text = ''; this.answerLabelArr[i].text = '';
this.textBgArr[i].visible = false;
} }
} }
...@@ -2684,7 +2690,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2684,7 +2690,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}; };
audio.src = url; audio.src = url;
audio.load(); audio.load();
resolve(); resolve(null);
}); });
} }
......
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