ErrorApe.js
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//*
// 控制UI界面的模块
// */
import Loger from "../Loger";
import Ape from "./Ape";
import $ from "jquery";
import ClassDataProxy from "proxy/ClassDataProxy";
let loger = Loger.getLoger('PC-ErrorApe');
class ErrorApe extends Ape {
constructor() {
super();
this.init();
}
init(){
//警告框warn 关闭事件
$('#warnHintA').on('click',this._hideWarnError.bind(this));
$('#createUserNo').on('click',this._createUserNoHandler.bind(this));//取消创建用户
$('#createUserBoxA').on('click',this._createUserNoHandler.bind(this));//取消创建用户
$('#teacherDetailRemindersA').on('click',this._closeteacherDetailHandler.bind(this));//取消创建用户
$('#remindersBtn').on('click',this._closeteacherDetailHandler.bind(this));//取消创建用户
}
_hideWarnError(){
clearTimeout(this._isTime);
$('#warnHintBox').hide();
}
//关闭warn提示框
_hideWarnError(){
clearTimeout(this._isTime);
$('#warnHintBox').hide();
}
judgeDisplayStatus(){
let children = $('.errorHintBox').find('.errorHint'),len = 0;
for(let i = 0;i<children.length;i++){
if($(children[i]).attr('data') == 'open'){
len ++;
}
}
if(len <= 0){
this.hide();
}
}
//显示warn提示框 倒计时结束自动关闭盒子
showWarnError(_msg,_time=3){
clearTimeout(this._isTime);
$('#warnHintBox').show();
$('#warnHintContent').html(_msg);
let time = parseInt(_time*1000);
this._isTime = setTimeout(function(){
$('#warnHintBox').hide();
},time)
}
_createUserNoHandler(){
$('#createUserAccountBox').hide();
}
_closeCreateUserHandler(){
$('#createUserBox').hide();
}
_closeteacherDetailHandler(){
$('#teacherDetailRemindersBox').hide();
}
}
ErrorApe.prototype.TYPE_1=ErrorApe.TYPE_1=1;//兼容直播课堂的浏览器
ErrorApe.prototype.TYPE_2=ErrorApe.TYPE_2=2;//兼容录制回放的浏览器
ErrorApe.prototype.TYPE_3=ErrorApe.TYPE_3=3;//没有麦克风
ErrorApe.prototype.TYPE_24=ErrorApe.TYPE_24=24;//显示退出课堂
ErrorApe.prototype.language=ErrorApe.language="zh_cn";//设置默认语言为中文
ErrorApe.prototype.PATH=ErrorApe.PATH="explorerSetMsg";//定义默认路径
export default new ErrorApe;