/*
    打点数据类型
    广告:AD
    加载时长:LoadTime
    停留时长:StayTime
    切换后台:OnHide
    普通按钮合集:Btns
    离开当前界面:Out
    进入界面:Enter
*/
export enum  ENTERTYPE {
    XUANGUAN,
    TONGGUAN,
    TIAOZHUAN,
    CHONGWAN,
}
export enum  OUTTYPE {
    CHENGGONG,
    TIAOZHUAN,
    FANHUI,
    SHIBAI,

}
export const OPER_TYPE = {
    AD:"AD",
    LoadTime:"LoadTime",
    StayTime:"StayTime",
    OnHide:"OnHide",
    Out:"Out",
    Enter:"Enter",
    Btns:"Btns",
}


export default class GameReport{
    
    public static loadingTime = 0;
    public static isSendLoadingTime = false;
    public static loadingFinishTime = 0
    public static GamePlatform = "OTHER";
    public static GameVersion = "1.0.0";
    public static GameName = "BYYDW"; //手动配置
    public static UserUuid = null;
    public static SubGame = 'default';
    public static SubGameRemake = 'default';
    public static OperType:string = OPER_TYPE.AD;
    public static OperRemake:string|number = null;
    public static stayTime = 0;
        //OperRemake 
    /*
    操作备注OperType
	OperType==LoadTime 必填--秒 例如:30
	OperType==StayTime 必填--秒 例如:3000
	OperType==OUT 必填 例如:重玩离开
	OperType==ENTER 必填 例如:重玩进入
	OperType==onHide 选择填 例如:hide
	OperType==BTNS 选择填 例如:签到
	OperType==AD 选择填 例如:钓鱼
    */


    public static OperTypeResult:number = 1;

    public static onHideState = {
        gold:0, //金币
        strength:0,  //体力
        sendCardTimes:0, //发牌次数
        unlockLevel:0, //已经解锁关卡
        removeTimes:0, //消除次数
        default1:0, //默认字段1
        default2:0, //默认字段2
        default3:0 //默认字段3
    }
    public static OperateName = 'default';
    public static CustomClicks = '';

    //
    public static tmpUserid = "";
    public static PostTime = '';
    public static AllowGamePlatform = "OTHER";
    public static ReportConfig = null;
    public static ReportUrl = null;
    public static getReqData = null;
    public static postReqData = null;
    public static GameTable = "";
    
    public static isReport = false;
    public static isRequest = false;
    public static checkSendData(){
        
    }

    public static ReportSend(OperType, OperRemake,OperTypeResult){
        return

    
        
    }

    public static ADReport(OperRemake:string,OperTypeResult=1, OperateName?){
        if(OperateName){
          
            this.OperateName = OperateName;
        }


        this.ReportSend(OPER_TYPE.AD, OperRemake, OperTypeResult)
    }

    public static LoadTimeReport(OperRemake:number, OperateName?){

    }

    public static StayTimeReport(OperRemake:number, OperateName?){

    }

    public static OUTReport(enterType:OUTTYPE = OUTTYPE.FANHUI, OperateName?){
        //OperRemake 离开备注
    

    }

    public static EnterReport(enterType:ENTERTYPE = ENTERTYPE.XUANGUAN, OperateName?){
        //OperRemake进入备注
   

    }

    public static BtnsReport( CustomClicks:string, OperRemake ='普通按钮点击集合', OperateName?){
 
    }

    public static checkSendBtnsReport(){


    }


    public static OnHideReport(OperRemake, OperateName? , gold=0, strength=0, sendCardTimes=0, unlockLevel=0, removeTimes=0,default1=0, default2=0,default3=0){
  
    }

    public static OnHideReport2(OperRemake, onHideState, OperateName?){
 
    }



    public static ReportContent(content,typeInput?){
        return
       
    }
    public static init(){
        return
        

    }
    public static initPostReq(reqUrl){
     
    }
   

    public static setLoadingTime(loadingTime){
        this.loadingTime = loadingTime
    }

    public static setLoadingFinishTime(FinishTime){
        this.loadingFinishTime = FinishTime
    }


    public static getLoadingTime(){
        return this.loadingTime
    }

    public static setStayTime(stayTime){
        this.stayTime = stayTime
    }


    public static getStayTime(){
        return this.stayTime
    }


    public static  getOpenUserId(){
        
    }

    public static SetCurGame(OperateName){
        this.OperateName = OperateName;
    }


    public static SetCurOperateName(OperateName){
        this.OperateName = OperateName;
    }

    public static setSubGame(SubGame){
        this.SubGame = SubGame;
    }
    
    public static setSubGameRemake(SubGameRemake){
        this.SubGameRemake = SubGameRemake;
    }


    public static SetUserUuid(UserUuid){
        this.UserUuid = UserUuid;
    }
    
    public static getGameVersion(){
        return this.GameVersion
    }

    public static initOtherPlatformUser(){
        let tmpUserid = this.getTempUserId()
        this.tmpUserid = tmpUserid;
        console.log( this.tmpUserid, 'tmpUserid')
        //User.setOtherplatformUserid(this.tmpUserid);
        
    }

    public static SetOnHideState(onHideState){
        this.onHideState = onHideState;
    }
    
    
    public static getTempUserId(){
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0,
                v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    
    }

}