{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { ViewManager, ViewType } from \"./ViewManager\";\r\nimport GuangGao from \"../Net/GuangGao\";\r\nimport { AccountManager } from \"../Net/AccountManager\";\r\nimport { ServerManager, BlastToMerge } from \"../Net/ServerManager\";\r\nimport { WXSDK } from \"../Net/WXSDK\";\r\nimport { GameTools, faafssfafsa } from \"../Tool/GameTools\";\r\nexport default class LotteryView extends ui.LotteryViewUI {\r\n    constructor() {\r\n        super();\r\n        this.circleNum = 5;\r\n    }\r\n    static get Instance() {\r\n        if (LotteryView.ins) {\r\n            return LotteryView.ins;\r\n        }\r\n        else {\r\n            return new LotteryView();\r\n        }\r\n    }\r\n    Show() {\r\n        this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);\r\n        this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.OnVedio);\r\n        this.height = Laya.stage.height;\r\n        Laya.stage.on(Laya.Event.RESIZE, this, () => {\r\n            this.height = Laya.stage.height;\r\n        });\r\n    }\r\n    Close() {\r\n    }\r\n    ClickClose() {\r\n        ViewManager.Instance.ShowView(ViewType.MainView);\r\n    }\r\n    OnVedio() {\r\n        GuangGao.KaiShiPin((flag) => {\r\n            if (flag) {\r\n                this.LotteryBtn.visible = false;\r\n                let param = [{ \"channel\": \"video\" }, { \"t\": AccountManager.Instance.ServerTime.toString() }];\r\n                ServerManager.Instance.SendHttp(BlastToMerge.Lottery, param, Laya.Handler.create(this, function (e) {\r\n                    this.RotationDial(e);\r\n                }), Laya.Handler.create(this, () => {\r\n                    WXSDK.ShowTxt(\"抽奖次数已经用完!\");\r\n                }), true);\r\n            }\r\n        });\r\n    }\r\n    RotationDial(e) {\r\n        var result = e.lottery_id - 1;\r\n        this.dial.rotation = 0;\r\n        let tween = Laya.Tween.to(this.dial, {\r\n            rotation: 360 * (this.circleNum) - result * 60\r\n        }, 5000, Laya.Ease.quadInOut, new Laya.Handler(null, () => {\r\n            tween.clear();\r\n            this.LotteryBtn.visible = true;\r\n            if (!LotteryView.IsCanLottery()) {\r\n                this.LotteryBtn.gray = true;\r\n                console.log(\"观看视频抽奖按钮已变灰\");\r\n            }\r\n            var reward = e[\"rewards\"];\r\n            GameTools.TweenText(new faafssfafsa(\"道具 + 1\", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {\r\n                ViewManager.Instance.ShowView(ViewType.MainView);\r\n            }));\r\n        }));\r\n    }\r\n    static IsCanLottery() {\r\n        var _timer = Number(AccountManager.Instance.curplayerData.lottery.day_video_times);\r\n        return _timer > 0;\r\n    }\r\n}\r\n//# sourceMappingURL=LotteryView.js.map",
  "references": [
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/ui/layaMaxUI.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/View/ViewManager.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/Net/GuangGao.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/Net/AccountManager.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/Net/ServerManager.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/Net/WXSDK.ts",
    "C:/Users/Administrator/Desktop/2048/2048_laya/src/Tool/GameTools.ts"
  ],
  "map": "{\"version\":3,\"file\":\"LotteryView.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/View/LotteryView.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAM,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,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