Commit c77a46a1 authored by liujiaxin's avatar liujiaxin

www

parent 5411fff8
......@@ -58,9 +58,7 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
ngOnInit() {
this.data = {
contentObj: {}
};
this.data = {contentObj: {pic_id: 'http://staging-teach.cdn.ireadabc.com/5502addf299f5f34dc181f993f81e311.png', imgData: {naturalWidth: 378, naturalHeight: 452, aspectRatio: 0.8362831858407079, width: 723, height: 864.5396825396825, left: 0, top: 0}, parts: [{word: 'aaaaa', data: {x: 94.5, y: 162.79781509336098, width: 189.41866571576762, height: 40.99860606846473}}, {word: '22222222', data: {x: 94.0649961099585, y: 193.66062629668048, width: 189.41866571576762, height: 40.99860606846473}}]}};
// 获取数据
const getData = (window as any).courseware.getData;
......@@ -71,9 +69,9 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
}
this.init();
// @ts-ignore
if (window.air) {
if (window['air']) {
// @ts-ignore
window.air.hideAirClassLoading(this.saveKey, this.data);
window['air'].hideAirClassLoading(this.saveKey, this.data);
}
}, this.saveKey);
......@@ -102,7 +100,7 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
// console.log(this.previewContainer.nativeElement.offsetHeight);
}
calcCssProp (data, w, h) {
calcCssProp(data, w, h) {
// let scale = w / data.width;
......@@ -169,7 +167,7 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
const vh = this.readingContainer.nativeElement.offsetHeight
const vh = this.readingContainer.nativeElement.offsetHeight;
const w = this.readingContainer.nativeElement.offsetWidth / 2 - 0.04 * vh;
const h = this.readingContainer.nativeElement.offsetHeight - 0.08 * vh;
......@@ -195,14 +193,14 @@ export class PlayComponent extends BaseResizeComponent implements OnInit, AfterV
this.partViewDetailCss = {
'width.px': i_w,
'height.px': i_h,
'border': `3px solid ${this.colors[index]}`
border: `3px solid ${this.colors[index]}`
};
this.partViewImgDetailCss = {
'width.px': p_w,
'height.px': p_h,
'max-width.px': p_w,
'max-height.px': p_h,
'transform': `translateX(-${p_x}px) translateY(-${p_y}px)`
transform: `translateX(-${p_x}px) translateY(-${p_y}px)`
};
this.partDetailVisible = true;
......
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