GamePlatform.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0}),
  5. (i.ShareKeyConst =
  6. i.GamePlatform =
  7. i.WxImgId2 =
  8. i.WxImg2 =
  9. i.WxImgId1 =
  10. i.WechatInviteRandom1ImageURL =
  11. i.WechatHelpImageURLId =
  12. i.WechatHelpImageURL =
  13. i.WechatPreviewImageURLId =
  14. i.WechatPreviewImageURL =
  15. i.RankInviteImageUrlId =
  16. i.RankInviteImageURL =
  17. i.RankInviteTitle =
  18. i.WechatInvite =
  19. void 0);
  20. const s = t("App"),
  21. o = t("WxMiniGameUtil");
  22. (i.WechatInvite = 11),
  23. (i.RankInviteTitle = "一起加入拯救空岛之旅?"),
  24. (i.RankInviteImageURL = "https://wxclient.gzqidong.cn/resource/Upload/resource/1658730380901250732.png"),
  25. (i.RankInviteImageUrlId = "GJgQ5fOBQMubGkU/lK02SQ=="),
  26. (i.WechatPreviewImageURL = "http://mine.gzqidong.cn/uploads/images/QQ图片20230331174708.jpg"),
  27. (i.WechatPreviewImageURLId = "1C5ovAl7THud2O+nTegwzQ=="),
  28. (i.WechatHelpImageURL = "https://wxclient.gzqidong.cn/resource/Upload/resource/16587304421140728410.png"),
  29. (i.WechatHelpImageURLId = "jdsRgWqrTA+Awya4YGih1g=="),
  30. (i.WechatInviteRandom1ImageURL = "http://mine.gzqidong.cn/uploads/images/QQ图片20230331174708.jpg"),
  31. (i.WxImgId1 = "605ZLNk+RIm5xPHkjtlmTA=="),
  32. (i.WxImg2 = "https://wxclient.gzqidong.cn/resource/Upload/resource/1675246963653691576.jpg"),
  33. (i.WxImgId2 = "QSFGUmDpQB65Mu5d1oZFzQ==");
  34. class a {
  35. static isWeixinMiniGame() {
  36. return "undefined" != typeof wx;
  37. }
  38. static getServerUID() {
  39. return s.default.GameDataMsr.playerInfo.id;
  40. }
  41. static getOpenId() {
  42. return s.default.GameDataMsr.playerInfo.openid;
  43. }
  44. static isFriendShare() {
  45. var t = !1,
  46. e = wx.getLaunchOptionsSync();
  47. return (t = e && e.query && e.query.shareMessageToFriendScene === i.WechatInvite.toString() ? !0 : t);
  48. }
  49. static onMainSceneLoaded() {
  50. a.isWeixinMiniGame() &&
  51. (wx.getLaunchOptionsSync(),
  52. wx.setMessageToFriendQuery({shareMessageToFriendScene: i.WechatInvite}),
  53. o.WxMiniGameUtil.tryGetInfo());
  54. }
  55. static randomShareData() {
  56. var t = new Array();
  57. return (
  58. 1 == s.default.RandomUtils.limitInteger(0, 2)
  59. ? (t.push(i.WechatInviteRandom1ImageURL), t.push(i.WxImgId1))
  60. : (t.push(i.WechatInviteRandom1ImageURL), t.push(i.WxImgId2)),
  61. t.push("你离亿万富翁,只差一座金矿!"),
  62. t
  63. );
  64. }
  65. }
  66. (i.GamePlatform = a), (i.ShareKeyConst = {fur: "fur", bubble: "bubble", shop: "shop", task: "task"});