Commit bce9fd06 authored by Li MingZhe's avatar Li MingZhe

Merge branch 'master' of http://vcs.ireadabc.com/template/hw_003

parents 3f658fc7 8f88565b
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"
......
...@@ -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();
} }
......
...@@ -615,8 +615,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -615,8 +615,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initQuestionWindow(); this.initQuestionWindow();
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg'); this.playAudio('bg');
} }
}
showStartAnima() { showStartAnima() {
...@@ -2019,8 +2021,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2019,8 +2021,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() {
...@@ -2155,8 +2159,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2155,8 +2159,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;
} }
} }
...@@ -2697,14 +2703,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2697,14 +2703,12 @@ export class PlayComponent implements OnInit, OnDestroy {
preloadAudio(url) { preloadAudio(url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const audio = new Audio(); const audio = new Audio();
audio.oncanplay = (a) => {
resolve();
};
audio.onerror = () => { audio.onerror = () => {
reject; reject;
}; };
audio.src = url; audio.src = url;
audio.load(); audio.load();
resolve(null);
}); });
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<script type="text/javascript" src="http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script> <script type="text/javascript" src="//teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script>
</head> </head>
<body> <body>
......
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