| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import JsbSystem from "./JsbSystem";
- /**
- * @description 数据管理类
- * @author 邹勇
- */
- export default class DataSystem {
- constructor() {
- }
- /**
- * 数数注册事件
- */
- public setTAEventRegister() {
- JsbSystem.setTAEventRegister();
- }
- /**
- * 数数打点
- * @param eventId 事件Id
- * @param des 事件内容
- */
- public sendDataEvent(eventId: string, des: string) {
- console.log("===[DataSystem", eventId, des);
- if (eventId && des) {
- JsbSystem.sendEvent(eventId, des);
- }
- }
- /**
- * 数数打点
- * @param eventId 事件Id
- * @param des 事件内容
- */
- public sendDataEventValue(eventId: string, des: string, value: number) {
- console.log("===[DataSystem", eventId, des, value);
- if (eventId && des) {
- JsbSystem.sendEventValue(eventId, des, value);
- }
- }
- /**
- * 设置人物属性
- * @param type 0 set 1 add
- * @param property 属性名
- * @param value 浮点数值
- */
- public setTAEventUser(type: number, property: string, value: number) {
- JsbSystem.setTAEventUser(type, property, value);
- }
- /**
- * 设置人物属性
- * @param type 0 set 1 add
- * @param property 属性名
- * @param value 字符串数值
- */
- public setTAEventUserStr(type: number, property: string, value: string) {
- JsbSystem.setTAEventUserStr(type, property, value);
- }
- /**
- * 星云打点
- */
- public sendXYEvent(eventId: string, des: string) {
- if (eventId && des) {
- let data = {
- "uin": gData.loginData.uin,
- "isFirstDay": gData.gameData.gameData.loginDays == 1 ? 1 : 0,
- "umengChannel": gData.appData.umengChannel,
- "deviceType": gData.appData.deviceType,
- "androidVerison": gData.appData.androidVersion,
- "version": gData.appData.appVersion,
- "point": eventId,
- "description": des,
- "tfChannel": gData.appData.tfChannel
- }
- mk.http.sendData('cp', data);
- }
- }
- }
|