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.
{
"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"
......
......@@ -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();
}
......
......@@ -615,7 +615,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initQuestionWindow();
this.playAudio('bg');
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg');
}
}
showStartAnima() {
......@@ -2019,7 +2021,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.wheelRun();
this.playAudio('click_1');
this.playAudio('bg');
if (!this.data.contentObj.stopPlayBgAudio) {
this.playAudio('bg');
}
}
......@@ -2155,8 +2159,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;
}
}
......@@ -2697,14 +2703,12 @@ export class PlayComponent implements OnInit, OnDestroy {
preloadAudio(url) {
return new Promise((resolve, reject) => {
const audio = new Audio();
audio.oncanplay = (a) => {
resolve();
};
audio.onerror = () => {
reject;
};
audio.src = url;
audio.load();
resolve(null);
});
}
......
......@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<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>
<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