{
  "code": "export class ShareUtil {\r\n    constructor() {\r\n    }\r\n    ShareUtil() {\r\n    }\r\n    beginShare(callBack) {\r\n        ShareUtil.beginShareTime = new Date().getTime();\r\n        console.log(\"分享点击时间=\" + ShareUtil.beginShareTime);\r\n        ShareUtil.isSharing = true;\r\n        ShareUtil.callback = callBack;\r\n    }\r\n    onRegister() {\r\n        if (Laya.Browser.window.wx == null) {\r\n            return;\r\n        }\r\n        Laya.Browser.window.wx.onShow(function (option) {\r\n            console.log(\"onshow share start\");\r\n            if (ShareUtil.isSharing) {\r\n                ShareUtil.isSharing = false;\r\n                let time = new Date().getTime();\r\n                console.log(\"分享回到游戏时间\" + time);\r\n                let wait = (time - ShareUtil.beginShareTime) / 1000;\r\n                console.log(\"分享停留时间为：\" + wait);\r\n                let shareSuccess = false;\r\n                let realSuccess = false;\r\n                if (wait >= 2) {\r\n                    if (wait < 4) {\r\n                        shareSuccess = (Math.random() > 0.7) ? false : true;\r\n                    }\r\n                    else {\r\n                        shareSuccess = true;\r\n                    }\r\n                }\r\n                else {\r\n                    shareSuccess = false;\r\n                }\r\n                if (shareSuccess == false) {\r\n                    Laya.Browser.window.wx.showToast({ title: \"请重试一次\" });\r\n                    ShareUtil.callback(false);\r\n                }\r\n                else {\r\n                    Laya.Browser.window.wx.showToast({ title: \"分享成功\" });\r\n                    ShareUtil.callback(true);\r\n                }\r\n            }\r\n        });\r\n    }\r\n}\r\nShareUtil.Instance = new ShareUtil();\r\nShareUtil.shareSuccessTime = 0;\r\nShareUtil.isSharing = false;\r\n//# sourceMappingURL=ShareUtil.js.map",
  "references": [],
  "map": "{\"version\":3,\"file\":\"ShareUtil.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/WXSDK/ShareUtil.ts\"],\"names\":[],\"mappings\":\"AAGC,MAAM,OAAO,SAAS;IAGnB;IAGA,CAAC;IACM,SAAS;IAGhB,CAAC;IAOM,UAAU,CAAC,QAAQ;QAEpB,SAAS,CAAC,cAAc,GAAG,IAAI,IA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