Commit 6ba386bc authored by limingzhe's avatar limingzhe

index loading

parent 5cf53e43
......@@ -110,7 +110,7 @@ export class UploadVideoComponent implements OnChanges, OnDestroy {
break;
case 'progress':
this.progress = parseInt(info.event.percent, 10);
this.doProgress(this.progress);
// this.doProgress(this.progress);
break;
}
}
......
import {
ApplicationRef,
ApplicationRef, ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
......@@ -37,7 +37,8 @@ export class FormComponent implements OnInit, OnChanges {
constructor(private nzMessageService: NzMessageService,
private appRef: ApplicationRef) {
private appRef: ApplicationRef,
public changeDetectorRef: ChangeDetectorRef) {
}
......@@ -88,6 +89,9 @@ export class FormComponent implements OnInit, OnChanges {
// this.refresh();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
}, this.KEY);
}
......
......@@ -64,6 +64,8 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
window['air'].hideAirClassLoading(this.KEY, this.data);
this.refresh();
}, this.KEY);
......
......@@ -7,82 +7,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script>
window.courseware = (function(){
if(window.parent.net){
window.net = window.parent.net;
var id = window.frameElement.getAttribute("dataid");
return {
getData: function(callback, key=''){
net.getData("getCoursewareData",id,function(res){
if(res){
res = JSON.parse(res);
if(res.msg==="success"){
let callData = null;
if(res.data&&res.data!='null'){
callData = JSON.parse(res.data);
}
callback&&callback(callData);
}else{
alert('数据加载失败!');
}
}else{
alert('数据加载失败!');
}
});
},
setData: function(data,callback, key=''){
let str = JSON.stringify(data);
net.getData("setCoursewareData",{id: id,data: str},function(res){
if(res){
res = JSON.parse(res);
if(res.msg==="success"){
callback&&callback();
}else{
alert('数据保存失败!');
}
}else{
alert('数据保存失败!');
}
});
},
uploadUrl: function(){
return net.getUploadFileURL();
},
uploadData: function(){
return net.getAjaxData("uploadFile","");
}
}
} else {
return {
getData: function(callback, key=''){
let data = localStorage.getItem("courseware_data_" + key);
if(data){
data = JSON.parse(data);
}
callback&&callback(data);
},
setData: function(data,callback, key=''){
console.log("******local********");
localStorage.setItem("courseware_data_" + key,JSON.stringify(data));
callback&&callback();
},
uploadUrl: function(){
return 'http://localhost:3000/api/test';
},
uploadData: function(){
return {};
}
}
}
})();
</script>
<script type="text/javascript" src="http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script>
</head>
<body>
<app-root></app-root>
</body>
<app-root></app-root>
</body>
</html>
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