{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { GameTools, faafssfafsa } from \"../GameUtils/GameTools\";\r\nimport { AccountManager } from \"../NetWork/AccountManager\";\r\nimport { ViewManager, ViewType } from \"./ViewManager\";\r\nimport { ServerManager, TeamWave } from \"../NetWork/ServerManager\";\r\nimport Dictionary from \"../GameUtils/Dictionary\";\r\nimport { WXSDK } from \"../NetWork/WXSDK\";\r\nconst REWARDNAME = \"reward\";\r\nconst MAINPATH = \"Main/\";\r\nconst SKINPATH = \"subpackage2/res/skin/\";\r\nconst CIRCLES = 5;\r\nconst ROTATIME = 5000;\r\nexport class LotteryView extends ui.LotteryViewUI {\r\n    constructor() {\r\n        super();\r\n        LotteryView.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (LotteryView.ins == null) {\r\n            return new LotteryView();\r\n        }\r\n        return LotteryView.ins;\r\n    }\r\n    OnShow() {\r\n        this.RegButton();\r\n        this.RefreshUI();\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    RefreshUI() {\r\n        let lottery = AccountManager.Instance.curplayerData.GainCollocation(\"lottery\");\r\n        let idx = 1;\r\n        this._itemDic = new Dictionary();\r\n        lottery && lottery.forEach(item => {\r\n            this._itemDic.set(idx, item);\r\n            let type = Math.floor(Number(item.reward_item) * 0.001);\r\n            let reward = this.dial.getChildByName(`${REWARDNAME}${idx++}`);\r\n            if (!reward)\r\n                return;\r\n            let skin = reward.getChildByName(\"skin\");\r\n            let name = reward.getChildByName(\"name\");\r\n            if (type == 1) {\r\n                skin.skin = MAINPATH + item.icon + \".png\";\r\n                name.text = \"X\" + item.reward_num.toString();\r\n            }\r\n            else if (type == 6) {\r\n                skin.skin = SKINPATH + item.icon + \".png\";\r\n                name.text = item.name.toString();\r\n                name.visible = false;\r\n            }\r\n        }, this);\r\n    }\r\n    _rotateDial(data) {\r\n        let targRota = 360 * CIRCLES - 45 * (data.lottery_id - 1);\r\n        let tween = Laya.Tween.to(this.dial, { rotation: targRota }, ROTATIME, Laya.Ease.quadInOut, Laya.Handler.create(this, () => {\r\n            let item = this._itemDic.get(data.lottery_id);\r\n            let type = Math.floor(Number(item.reward_item) * 0.001);\r\n            var reward = data[\"rewards\"];\r\n            if (reward[\"1000\"]) {\r\n                var gg = Number(reward[\"1000\"]);\r\n                GameTools.GetMoney(gg, null, Laya.Handler.create(this, () => {\r\n                    ViewManager.Instance.ShowView(ViewType.LotteryView);\r\n                }));\r\n            }\r\n            else {\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.LotteryView);\r\n                }));\r\n            }\r\n        }));\r\n    }\r\n    RegButton() {\r\n        this.VideoGetBtn.clickHandler = new Laya.Handler(this, this.ClickVideoGet);\r\n        this.CloseBtn.clickHandler = new Laya.Handler(this, this.ClickClose);\r\n    }\r\n    ClickClose() {\r\n        ViewManager.Instance.ShowView(ViewType.HomeView);\r\n    }\r\n    ClickVideoGet() {\r\n        this.VideoGetBtn.visible = false;\r\n        let param = [{ \"channel\": \"video\" }, { \"t\": AccountManager.Instance.ServerTime.toString() }];\r\n        ServerManager.Instance.SendHttp(TeamWave.Lottery, param, Laya.Handler.create(this, function (e) {\r\n            this._rotateDial(e);\r\n        }), Laya.Handler.create(this, () => {\r\n            WXSDK.ShowTxt(\"抽奖次数已经用完!\");\r\n        }), true);\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\n//# sourceMappingURL=LotteryView.js.map",
  "references": [
    "E:/LayaProject/DanceLine/RubikCube/src/ui/layaMaxUI.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Manager/PlayerManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/GameUtils/GameTools.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/AccountManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/PlayerData.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/GuangGao.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/View/ViewManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/ServerManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/GameUtils/Dictionary.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/WXSDK.ts"
  ],
  "map": "{\"version\":3,\"file\":\"LotteryView.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/View/LotteryView.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AACzC,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,QAAQ,GAAW,IAAI,CAAC;AAE9B,MAAM,OAAO,WAAY,SAAQ,EAAE,CAAC,aAAa;IAE7C;QACI,KAAK,EAAE,CAAC;QACR,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC;IAC3B,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,WAAW,CAAC,GAAG,IAAI,IAAI,EAAC;YACvB,OAAO,IAAI,WAAW,EAAE,CAAC;SAC5B;QAC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