{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { DispatcherManager } from \"../Game/DispatcherManager\";\r\nimport { GameManager } from \"../Game/GameManager\";\r\nimport { PlayerManager } from \"../Game/PlayerManager\";\r\nimport UserModel from \"../Net/UserModel\";\r\nimport NetManager, { PROTOCOLS } from \"../Net/NetManager\";\r\nimport { LevelController } from \"../Game/LevelController\";\r\nimport { SettingController, SoundType } from \"../Game/SettingController\";\r\nimport { WXSdk } from \"../Net/WXSdk\";\r\nimport { GuangGao } from \"../Net/GuangGao\";\r\nimport { ViewManager, ViewType } from \"../Net/ViewManager\";\r\nexport default class CompleteView extends ui.CompleteViewUI {\r\n    constructor() {\r\n        super();\r\n        this.isWin = false;\r\n        CompleteView.instance = this;\r\n        this.Resize();\r\n        DispatcherManager.on(Laya.Event.RESIZE, this, this.Resize);\r\n    }\r\n    static get Instance() {\r\n        return CompleteView.instance;\r\n    }\r\n    OnShow(data) {\r\n        this.isWin = data;\r\n        this.RefreshData();\r\n        this.RegButton();\r\n        this.RefreshUI();\r\n        GuangGao.CheatBanner(this.winbtnBox);\r\n    }\r\n    Resize() {\r\n        this.height = Laya.stage.height;\r\n    }\r\n    RefreshData() {\r\n        this.coinValue = this.isWin == true ? LevelController.Instance._level.gold : LevelController.Instance._level.fail_gold;\r\n        this.tes1 = this.coinValue;\r\n        this.coinValue += (PlayerManager.tower_reward * GameManager.Instance.towerCount + PlayerManager.enemy_reward * GameManager.Instance.roleCount + PlayerManager.block_reward * GameManager.Instance.blockCount);\r\n        let iswin = this.isWin == true ? 1 : 0;\r\n        let count = this.coinValue;\r\n        let param = [{ \"t\": UserModel.Instance.CurModel.ServerTime }, { \"play_id\": PlayerManager.Instance.Play_Id }, { \"win\": iswin }, { \"money\": count }];\r\n        NetManager.Instance.HttpPostRequest(PROTOCOLS.protocols.GameResult, param, (data) => {\r\n        }, (data) => {\r\n            ViewManager.Instance.ShowTips(\"结算失败\");\r\n        });\r\n        if (this.isWin) {\r\n            SettingController.Instance.PlaySound(SoundType.win);\r\n            WXSdk.Success(PlayerManager.Instance.stage.toString());\r\n        }\r\n        else {\r\n            SettingController.Instance.PlaySound(SoundType.defeat);\r\n            WXSdk.Fail(PlayerManager.Instance.stage.toString());\r\n        }\r\n    }\r\n    RegButton() {\r\n        this.doublegetBtn.CZ = () => {\r\n            this.DoubleGet();\r\n        };\r\n        this.nextBtn.CZ = () => {\r\n            if (this.isWin) {\r\n                this.Next();\r\n            }\r\n            else {\r\n                this.Resset();\r\n            }\r\n        };\r\n    }\r\n    Next() {\r\n        GameManager.Instance.LevelUp();\r\n    }\r\n    Resset() {\r\n        ViewManager.Instance.CloseView(ViewType.CompleteView);\r\n        ViewManager.Instance.AddView(ViewType.AttributeUpView);\r\n    }\r\n    OnClose() {\r\n        DispatcherManager.off(Laya.Event.RESIZE, this, this.Resize);\r\n        CompleteView.instance = null;\r\n        Laya.timer.clearAll(this);\r\n        GuangGao.Clear();\r\n    }\r\n    RefreshUI() {\r\n        this.winTop.visible = this.isWin;\r\n        this.shibaiTop.visible = !this.isWin;\r\n        this.valueText.text = \"+\" + this.coinValue;\r\n        this.doubleText.text = (this.coinValue * 3).toString();\r\n        this.towerCount.text = \"X\" + GameManager.Instance.towerCount.toString();\r\n        this.towerValue.text = (PlayerManager.tower_reward * GameManager.Instance.towerCount).toString();\r\n        this.roleCount.text = \"X\" + GameManager.Instance.roleCount.toString();\r\n        this.roleValue.text = (PlayerManager.enemy_reward * GameManager.Instance.roleCount).toString();\r\n        this.blockCount.text = \"X\" + GameManager.Instance.blockCount.toString();\r\n        this.blockValue.text = (PlayerManager.block_reward * GameManager.Instance.blockCount).toString();\r\n    }\r\n    DoubleGet() {\r\n        GuangGao.ShowVideo((isok) => {\r\n            if (isok) {\r\n                WXSdk.AldEvent(\"结束界面看视屏获得钱\");\r\n                var param = [{ \"t\": UserModel.Instance.CurModel.ServerTime.toString() }, { \"reward_item\": \"1000\" }, { \"reward_num\": (this.coinValue * 2).toString() }];\r\n                NetManager.Instance.HttpPostRequest(PROTOCOLS.protocols.Fissionvd, param, (data) => {\r\n                    ViewManager.Instance.ShowTips(\"金币:X\" + (this.coinValue * 3));\r\n                    this.Next();\r\n                }, (data) => {\r\n                });\r\n            }\r\n        });\r\n    }\r\n}\r\n//# sourceMappingURL=CompleteView.js.map",
  "references": [
    "C:/Users/Administrator/Desktop/gungang/src/ui/layaMaxUI.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/DispatcherManager.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/MouseEvent.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/GameManager.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/PlayerManager.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Net/UserModel.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Net/NetManager.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/LevelController.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Util/MathTool.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/SettingController.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Net/WXSdk.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Net/GuangGao.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Net/ViewManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"CompleteView.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/View/CompleteView.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,UAAU,EAAE,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,y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