{
  "code": "import ShareCanvas from \"./ShareCanva\";\r\nimport { Main } from \"../Main\";\r\nexport default class JionTool {\r\n    constructor() {\r\n    }\r\n    static Init() {\r\n        if (!Main.OnWx)\r\n            return;\r\n        this._wx = Laya.Browser.window.wx;\r\n        this.setWH();\r\n        this.shareCanvas = new ShareCanvas();\r\n        this.shareCanvas.InitData();\r\n    }\r\n    static showFriendRank(keyName = \"score\") {\r\n        if (Main.OnWx)\r\n            this.postMessage(keyName, \"show_friend_rank\");\r\n    }\r\n    static showWorldRank(keyName, data) {\r\n        if (Main.OnWx)\r\n            this.postMessage(keyName, \"show_world_rank\", data);\r\n    }\r\n    static upPage() {\r\n        if (Main.OnWx)\r\n            this.postMessage(\"\", \"show_up_page\");\r\n    }\r\n    static nextPage() {\r\n        if (Main.OnWx)\r\n            this.postMessage(\"\", \"show_next_page\");\r\n    }\r\n    static settlement(value, callBack = null, keyName = \"score\") {\r\n        if (Main.OnWx)\r\n            this.setUserCloudStorage(keyName, value.toString(), callBack);\r\n    }\r\n    static showShareCanvas() {\r\n        if (Main.OnWx)\r\n            this.shareCanvas.show();\r\n    }\r\n    static hideShareCanvas() {\r\n        if (Main.OnWx)\r\n            this.shareCanvas.hide();\r\n    }\r\n    static sendMoveDelta(delta) {\r\n        if (Main.OnWx)\r\n            this.postMessage(\"\", \"move_rank\", delta);\r\n    }\r\n    static updateCtx() {\r\n        if (Main.OnWx)\r\n            this.postMessage(\"\", \"update_ctx\");\r\n    }\r\n    static setWH() {\r\n        if (!Main.OnWx)\r\n            return;\r\n        let width = Laya.stage.width;\r\n        let height = Laya.stage.height;\r\n        let data = { width: width, height: height };\r\n        console.error(width, height);\r\n        this.postMessage(\"\", \"canvase_width_height\", data);\r\n    }\r\n    static postMessage(keyName, action, data) {\r\n        this._wx.postMessage({\r\n            keyName: keyName,\r\n            action: action,\r\n            data: data\r\n        });\r\n    }\r\n    static setUserCloudStorage(keyName, value, callBack = null) {\r\n        let obj = [{\r\n                key: keyName,\r\n                value: value\r\n            }];\r\n        this._wx.setUserCloudStorage({\r\n            KVDataList: obj,\r\n            success: function (res) {\r\n                console.log(\"数据上传成功\" + res);\r\n                if (callBack) {\r\n                    callBack();\r\n                }\r\n            },\r\n            fail: function (res) {\r\n                console.log(\"数据上传失败\" + res);\r\n                if (callBack) {\r\n                    callBack();\r\n                }\r\n            }\r\n        });\r\n    }\r\n}\r\n",
  "references": [
    "C:/Users/admin/Desktop/runner/src/W_Rank/ShareCanva.ts",
    "C:/Users/admin/Desktop/runner/src/Main.ts"
  ]
}
