Commit eb34e572 authored by Li Mingzhe's avatar Li Mingzhe

fix: 渲染

parent 47614fef
...@@ -154,9 +154,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -154,9 +154,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
// this.init(); // this.init();
this.update(); this.update();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh(); this.refresh();
} }
...@@ -180,10 +177,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -180,10 +177,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
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.refresh();
} }
onItemAudioUploadSuccess(e, item) { onItemAudioUploadSuccess(e, item) {
item.audio_url = e.url; item.audio_url = e.url;
this.refresh();
} }
...@@ -215,6 +214,9 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -215,6 +214,9 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
if (callBack) { if (callBack) {
callBack(); callBack();
} }
this.refresh();
}); });
// } // }
...@@ -247,6 +249,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -247,6 +249,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onImgUploadSuccessByImg(e, img) { onImgUploadSuccessByImg(e, img) {
img.pic_url = e.url; img.pic_url = e.url;
this.refreshImage(img); this.refreshImage(img);
this.refresh();
} }
refreshImage(img) { refreshImage(img) {
...@@ -269,6 +272,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -269,6 +272,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} }
} }
this.refresh();
} }
...@@ -423,6 +427,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -423,6 +427,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.refresh();
} }
deleteItem(e, i) { deleteItem(e, i) {
...@@ -431,6 +436,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -431,6 +436,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.hotZoneArr.splice(i, 1); this.hotZoneArr.splice(i, 1);
this.refreshHotZoneId(); this.refreshHotZoneId();
this.refresh();
} }
...@@ -438,7 +444,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -438,7 +444,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.itemType = e; item.itemType = e;
this.refreshItem(item); this.refreshItem(item);
this.refresh();
// console.log(' in radioChange e: ', e); // console.log(' in radioChange e: ', e);
} }
...@@ -448,6 +454,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -448,6 +454,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.gIdx = e; item.gIdx = e;
this.refreshCustomItem(item); this.refreshCustomItem(item);
this.refresh();
// const curGroup = this.customTypeGroupArr[e]; // const curGroup = this.customTypeGroupArr[e];
} }
...@@ -511,6 +518,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -511,6 +518,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} }
initItem() { initItem() {
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
if (!this.bgItem) { if (!this.bgItem) {
this.bgItem = {}; this.bgItem = {};
} else { } else {
...@@ -526,6 +537,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -526,6 +537,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}); });
} }
this.refresh();
} }
initHotZoneArr() { initHotZoneArr() {
......
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