DataSystem.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import JsbSystem from "./JsbSystem";
  2. /**
  3. * @description 数据管理类
  4. * @author 邹勇
  5. */
  6. export default class DataSystem {
  7. constructor() {
  8. }
  9. /**
  10. * 数数注册事件
  11. */
  12. public setTAEventRegister() {
  13. JsbSystem.setTAEventRegister();
  14. }
  15. /**
  16. * 数数打点
  17. * @param eventId 事件Id
  18. * @param des 事件内容
  19. */
  20. public sendDataEvent(eventId: string, des: string) {
  21. console.log("===[DataSystem", eventId, des);
  22. if (eventId && des) {
  23. JsbSystem.sendEvent(eventId, des);
  24. }
  25. }
  26. /**
  27. * 设置人物属性
  28. * @param type 0 set 1 add
  29. * @param property 属性名
  30. * @param value 浮点数值
  31. */
  32. public setTAEventUser(type: number, property: string, value: number) {
  33. JsbSystem.setTAEventUser(type, property, value);
  34. }
  35. /**
  36. * 设置人物属性
  37. * @param type 0 set 1 add
  38. * @param property 属性名
  39. * @param value 字符串数值
  40. */
  41. public setTAEventUserStr(type: number, property: string, value: string) {
  42. JsbSystem.setTAEventUserStr(type, property, value);
  43. }
  44. /**
  45. * 星云打点
  46. */
  47. public sendXYEvent(eventId: string, des: string) {
  48. if (eventId && des) {
  49. let data = {
  50. "uin": gData.loginData.uin,
  51. "isFirstDay": gData.gameData.gameData.loginDays == 1 ? 1 : 0,
  52. "umengChannel": gData.appData.umengChannel,
  53. "deviceType": gData.appData.deviceType,
  54. "androidVerison": gData.appData.androidVersion,
  55. "version": gData.appData.appVersion,
  56. "point": eventId,
  57. "description": des,
  58. "tfChannel": gData.appData.tfChannel
  59. }
  60. mk.http.sendData('cp', data);
  61. }
  62. }
  63. }