| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- 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);
- }
- /**
- * 设置人物uin
- */
- public setTAUserID(id: string) {
- JsbSystem.setTAUserID(id);
- }
- /**
- * 星云打点
- */
- 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);
- }
- }
- }
|