3168210e-92b3-4bb7-aed6-c7d8089061ca.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. "use strict";
  2. cc._RF.push(module, '31682EOkrNLt67Wx9gIkGHK', 'YZ_Tool_Bili');
  3. // common-plugin/Scripts/YZ_Tool_Bili.ts
  4. "use strict";
  5. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  6. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  7. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  8. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  9. return c > 3 && r && Object.defineProperty(target, key, r), r;
  10. };
  11. Object.defineProperty(exports, "__esModule", { value: true });
  12. var PlatUtils_1 = require("./PlatUtils");
  13. var Utils_1 = require("./Utils");
  14. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  15. /**
  16. * 哔哩工具类
  17. */
  18. var YZ_Tool_Bili = /** @class */ (function () {
  19. function YZ_Tool_Bili() {
  20. this._sysInfo = {};
  21. /**
  22. * 服务器配置信息
  23. */
  24. this._serverConfig = null;
  25. }
  26. Object.defineProperty(YZ_Tool_Bili.prototype, "SysInfo", {
  27. get: function () {
  28. return this._sysInfo;
  29. },
  30. enumerable: false,
  31. configurable: true
  32. });
  33. Object.defineProperty(YZ_Tool_Bili.prototype, "ServerConfig", {
  34. get: function () {
  35. return this._serverConfig;
  36. },
  37. enumerable: false,
  38. configurable: true
  39. });
  40. /**
  41. *
  42. * @param data 配置数据
  43. */
  44. YZ_Tool_Bili.prototype.init = function (data) {
  45. if (PlatUtils_1.default.IsBili) {
  46. // if (data) {
  47. // let configObj: any = JSON.parse(data);
  48. // if (configObj && configObj.uc) {
  49. // ST_DefaultServerConfig = JSON.stringify(configObj.uc);
  50. // }
  51. // }
  52. Utils_1.utils.showLog("哔哩 平台初始化完成 >>");
  53. this.initSystemInfo();
  54. Utils_1.utils.emitServerInitEvent();
  55. }
  56. };
  57. /**
  58. * 分享
  59. * @param callback 回调
  60. */
  61. YZ_Tool_Bili.prototype.share = function (callback) {
  62. if (callback === void 0) { callback = null; }
  63. //@ts-ignore
  64. bl.shareAppMessage({
  65. title: Utils_1.utils.config.otherconfig.shareTitle,
  66. imageUrl: Utils_1.utils.config.otherconfig.shareImgUrl,
  67. success: function () {
  68. Utils_1.utils.showLog("bili 分享成功!");
  69. callback && callback(true);
  70. },
  71. fail: function () {
  72. Utils_1.utils.showLog("bili 分享失败!");
  73. callback && callback(false, "分享失败!");
  74. }
  75. });
  76. };
  77. /**
  78. * 初始化获取系统信息参数
  79. */
  80. YZ_Tool_Bili.prototype.initSystemInfo = function () {
  81. if (PlatUtils_1.default.IsBili) {
  82. //@ts-ignore
  83. this._sysInfo = bl.getSystemInfoSync();
  84. }
  85. };
  86. YZ_Tool_Bili = __decorate([
  87. ccclass
  88. ], YZ_Tool_Bili);
  89. return YZ_Tool_Bili;
  90. }());
  91. exports.default = YZ_Tool_Bili;
  92. cc._RF.pop();