Commit 485e2042 authored by Chen Jiping's avatar Chen Jiping

fix:需求变更

parent d7a5a9b0
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<div class="save-box"> <div class="save-box">
<button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round" <button class="save-btn" nz-button nzType="primary" [nzSize]="'large'" nzShape="round" [disabled]="saveDisabled ? true : false"
(click)="saveClick()" > (click)="saveClick()" >
<i nz-icon nzType="save"></i> <i nz-icon nzType="save"></i>
Save Save
......
...@@ -71,7 +71,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -71,7 +71,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
images = new Map(); images = new Map();
animationId: any; animationId: any;
// 资源 // 资源
// rawImages = new Map(res); // rawImages = new Map(res);
winResizeEventStream = new Subject(); winResizeEventStream = new Subject();
...@@ -142,15 +141,18 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -142,15 +141,18 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
console.log('e: ', e); console.log('e: ', e);
this.bgItem.picUrl = e.url; this.bgItem.picUrl = e.url;
this.refreshBackground(); this.refreshBackground();
this.saveDisabled = false;
} }
onItemImgUploadSuccess(e, item) { onItemImgUploadSuccess(e, item) {
item.pic_url = e.url; item.pic_url = e.url;
this.loadHotZonePic(item.pic, e.url); this.loadHotZonePic(item.pic, e.url);
this.saveDisabled = false;
} }
onItemAudioUploadSuccess(e, item) { onItemAudioUploadSuccess(e, item) {
item.audio_url = e.url; item.audio_url = e.url;
this.saveDisabled = false;
} }
...@@ -195,6 +197,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -195,6 +197,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshHotZoneId(); this.refreshHotZoneId();
this.saveDisabled = false;
} }
deleteBtnClick(index) { deleteBtnClick(index) {
...@@ -205,11 +208,14 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -205,11 +208,14 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshHotZoneId(); this.refreshHotZoneId();
this.saveDisabled = false;
} }
onImgUploadSuccessByImg(e, img) { onImgUploadSuccessByImg(e, img) {
img.pic_url = e.url; img.pic_url = e.url;
this.refreshImage(img); this.refreshImage(img);
this.saveDisabled = false;
} }
refreshImage(img) { refreshImage(img) {
...@@ -348,6 +354,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -348,6 +354,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onAudioUploadSuccessByImg(e, img) { onAudioUploadSuccessByImg(e, img) {
img.audio_url = e.url; img.audio_url = e.url;
this.saveDisabled = false;
} }
deleteItem(e, i) { deleteItem(e, i) {
...@@ -356,6 +363,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -356,6 +363,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.hotZoneArr.splice(i, 1); this.hotZoneArr.splice(i, 1);
this.refreshHotZoneId(); this.refreshHotZoneId();
this.saveDisabled = false;
} }
...@@ -364,7 +372,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -364,7 +372,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshItem(item); this.refreshItem(item);
// console.log(' in radioChange e: ', e); this.saveDisabled = false;
} }
refreshItem(item) { refreshItem(item) {
...@@ -600,7 +608,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -600,7 +608,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.oldPos = {x: this.mx, y: this.my}; this.oldPos = {x: this.mx, y: this.my};
this.saveDisabled = true; this.saveDisabled = false;
} }
...@@ -919,6 +927,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -919,6 +927,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} }
this.save.emit({bgItem, hotZoneItemArr, exercises}); this.save.emit({bgItem, hotZoneItemArr, exercises});
this.saveDisabled = true;
} }
private updatePos() { private updatePos() {
...@@ -998,6 +1008,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -998,6 +1008,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
saveText(item) { saveText(item) {
item.textLabel.text = item.text; item.textLabel.text = item.text;
this.saveDisabled = false;
} }
private loadHotZonePic(pic: HotZoneImg, url) { private loadHotZonePic(pic: HotZoneImg, url) {
......
...@@ -981,8 +981,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -981,8 +981,11 @@ export class PlayComponent implements OnInit, OnDestroy {
this.curAudio = this.playAudio(this.curHotZoneItem.data.audio_url, true, () => { this.curAudio = this.playAudio(this.curHotZoneItem.data.audio_url, true, () => {
setTimeout(()=>{
this.curIndex++; this.curIndex++;
this.showNext(); this.showNext();
}, 3000);
}); });
} }
...@@ -1065,16 +1068,14 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1065,16 +1068,14 @@ export class PlayComponent implements OnInit, OnDestroy {
else { else {
this.magnifier['wrong'].visible = true; this.magnifier['wrong'].visible = true;
this.canTouch = false; this.canTouch = true;
this.playAudio('wrong', true); this.playAudio('try_again', true);
shake(this.magnifier, 0.5, () => { shake(this.magnifier, 0.5, () => {
//加载下一个
this.curIndex++;
this.showNext();
}) })
} }
} }
this.isMagnifierTouched = false; this.isMagnifierTouched = false;
......
...@@ -48,6 +48,7 @@ const resAudio = [ ...@@ -48,6 +48,7 @@ const resAudio = [
['right', "assets/play/music/right.mp3"], ['right', "assets/play/music/right.mp3"],
['find', "assets/play/music/find.mp3"], ['find', "assets/play/music/find.mp3"],
['wrong', "assets/play/music/wrong.mp3"], ['wrong', "assets/play/music/wrong.mp3"],
['try_again', "assets/play/music/try_again.mp3"],
]; ];
export {res, resAudio}; export {res, resAudio};
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