Commit b7faee30 authored by liujiaxin's avatar liujiaxin

sdf

parent dc6f3c7e
...@@ -75,25 +75,24 @@ export class PlayComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -75,25 +75,24 @@ export class PlayComponent implements OnInit, AfterViewInit, OnDestroy {
// 获取数据 // 获取数据
const getData = (window as any).courseware.getData; const getData = (window as any).courseware.getData;
getData((data) => { getData((data) => {
console.log('getdata', data)
if (data && typeof data === 'object') { if (data && typeof data === 'object') {
this.data = data; this.data = data;
this.currentSeqIndex = 0; }
if (!Array.isArray(this.data.contentObj.pics)) { this.currentSeqIndex = 0;
this.data.contentObj.pics = []; if (!Array.isArray(this.data.contentObj.pics)) {
} this.data.contentObj.pics = [];
}
this.randPics = this.shuffle(this.data.contentObj.pics.map((res_id, idx) => {
return {res_id, idx };
}));
const pl = this.randPics.length;
this._itemsArr = Array(pl).fill(null).map((_, i) => i + 1);
if ( pl <= 4) {
this.col = 12;
} else if (pl > 4 ) {
this.col = 8;
}
this.randPics = this.shuffle(this.data.contentObj.pics.map((res_id, idx) => {
return {res_id, idx };
}));
const pl = this.randPics.length;
this._itemsArr = Array(pl).fill(null).map((_, i) => i + 1);
if ( pl <= 4) {
this.col = 12;
} else if (pl > 4 ) {
this.col = 8;
} }
this.changeDetectorRef.markForCheck(); this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
......
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