ErrorApe.js 1.8 KB
//*
// 控制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));
    }
    _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)
    }

}
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;