import Gamecfg from "../common/gameCfg";
import { PlayerLoginPlayerPram } from "../common/Xyc";
import Config from "../Config";
import { GameEvent, WindowEvent } from "../data/const/EventConst";
import { AD_VIDEO_KEY, PayProductParam, ReportRoleType, PlatFormDevType } from "../data/const/TypeConst";
import GameDataCenter from "../data/GameDataCenter";
import GameController from "../GameController";
import EventMng from "../manager/EventMng";
import { ReqLogin } from "../shared/player/PtlLogin";
import ThinkingDataMgr from "../utils/ThinkingDataMgr";
import IPlatform from "./IPlatform";
export default class PlatformBase implements IPlatform {
    private _hasAuthUserInfo: boolean = false
    set hasAuthUserInfo(val: boolean) {
        this._hasAuthUserInfo = val
        EventMng.emit(GameEvent.WX_AUTH_SUCC)
    }
    get hasAuthUserInfo() {
        return this._hasAuthUserInfo
    }
    // userInfo: PlatUserInfo
    openId: string = ""
    deviceOS: PlatFormDevType = PlatFormDevType.default // 设备平台类型
    productKey: number = 0
    loginParams: any[] = [] // 平台登录验证参数
    AdXiaDanSuc: boolean;//是否有下单广告
    showLoginView(): void {
    }
    login(inviter: string = ""): void {
        let packageCfg = Gamecfg.packageInfo.getItem(Config.pid)
        let param: ReqLogin = {
            pid: Config.pid, //分包ID
            openId: this.openId, //登陆唯一标识
            lang: "cn", //语言
            plat: packageCfg.plat, //登陆平台
            parms: this.loginParams,
            device: this.deviceOS//登录设备
        }
        //数数数据设置登录唯一标识
        ThinkingDataMgr.TDIdentify(this.openId);
        GameDataCenter.login.sendLoginGame(param)
    }
    logout(): void {
        // throw new Error("Method not implemented.");
    }
    init(...args: string[]): void {
        // throw new Error("Method not implemented.");
    }
    pay(orderId: string, order10cs: string, param: PayProductParam) {
        // throw new Error("Method not implemented.");
    }
    exit(force?: boolean) {
        // throw new Error("Method not implemented.");
    }
    restart(force?: boolean) {
        // throw new Error("Method not implemented.");
        GameController.clear()
        cc.game.restart()
    }
    // shareAppMessage(...args: any[]): void { }
    createUserInfo(btn: cc.Node, callback: Function): void {
        callback()
    }
    reportUserInfo(...arges: any[]): void { }
    reportRole(event: ReportRoleType, ...args): void { }
    checkMsg(str: string, cb: Function): void {
        cb()
    }
    openService() {
        // FguiMgr.Instance.openUI(KeFuViewView, ViewZorder.POP);
    }
    showRewardAd(adkey: string, kid: string, order11Id: string): void {
        // GameDataCenter.adVideo.onXiadanSucc()
    }
    setSubscribe(tmplIds: string[], ids: string[]) {

    }
    initRewardedVideoAd(key: string) { }
    resportShareEvent() { }
    openUrl(url: string) {

    }
    isMiniClient() {
        return false
    }
    reShowLogInView() { }
    reportUserAction(actionId: number) { }
}