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

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

parent 7c7976fc
This diff is collapsed.
{
"name": "ng-template-generator",
"version": "0.0.1",
"scripts": {
"start": "ng serve",
"scripts": {
"start": "ng serve",
"build": "ng build --build--optimizer --aot --base-href /JGT/v3/",
"publish": "node ./bin/publish.js"
"publish": "node ./bin/publish.js"
},
"private": true,
"dependencies": {
......@@ -47,6 +47,7 @@
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"rxjs-tslint": "^0.1.6",
"sass": "^1.32.6",
"spark-md5": "^3.0.0",
"webpack": "^4.28.2",
"zone.js": "^0.8.26"
......@@ -70,6 +71,7 @@
"protractor": "^5.4.2",
"ts-node": "~5.0.1",
"tslint": "^5.12.0",
"node-sass": "^4.0.0",
"typescript": "3.1.1"
}
}
......@@ -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">
......
......@@ -23,6 +23,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
_item: any;
stopPlayBgAudio = false;
KEY = 'hw_003';
......@@ -103,6 +105,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.contentObj.optionType = 'A';
}
this.stopPlayBgAudio = this.item.contentObj.stopPlayBgAudio;
let tmpFlag = false;
......@@ -247,14 +250,19 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
clickCheckBox() {
console.log(' in clickCheckBox');
this.item.contentObj.stopPlayBgAudio = !this.item.contentObj.stopPlayBgAudio;
this.saveItem();
}
saveItem() {
console.log(' in saveItem');
// this.update.emit(this.item);
console.log('this.item' + JSON.stringify(this.item));
this.save();
}
......
......@@ -597,7 +597,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initQuestionWindow();
this.playAudio('bg');
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg');
}
}
showStartAnima() {
......@@ -2001,7 +2003,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.wheelRun();
this.playAudio('click_1');
this.playAudio('bg');
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg');
}
}
......@@ -2137,8 +2141,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.textBgArr[i].wrongBg.visible = false;
if (this.answerLabelArr[i] && answerArr[i].text) {
this.answerLabelArr[i].text = answerArr[i].text;
this.textBgArr[i].visible = true;
} else {
this.answerLabelArr[i].text = '';
this.textBgArr[i].visible = false;
}
}
......@@ -2684,7 +2690,7 @@ export class PlayComponent implements OnInit, OnDestroy {
};
audio.src = url;
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