diff --git a/sdk/Analytics.ts b/sdk/Analytics.ts index 7cc8ff7..a92b8ed 100644 --- a/sdk/Analytics.ts +++ b/sdk/Analytics.ts @@ -85,6 +85,16 @@ export class Analytics { clientLog(content, level = LogLevel.debug) { return WXSDK.stat.clientLog(content, level) } + /** + * 资源上报 + * @param id 1体力 2经验 3钻石 + * @param typ 1增加 2减少 + * @param nums 增加或减少的数量 + * @param gsne 消耗场景 + */ + consume(id: number, typ: number, nums: number, gsne: string) { + return WXSDK.stat.consume(id, typ, nums, gsne) + } } diff --git a/wxsdk/base/SDKConst.ts b/wxsdk/base/SDKConst.ts index 3b34a63..59b191f 100644 --- a/wxsdk/base/SDKConst.ts +++ b/wxsdk/base/SDKConst.ts @@ -1,41 +1,11 @@ // 游戏配置数据 只需要改动这里的配置信息 // 游戏配置数据 只需要改动这里的配置信息 export const GAMEDATA = { - game_id: '10001',//游戏id - channel_id: '10001',//渠道id 暂时和游戏id一致 - version: '1.0.1', //版本号 中台控制正式还是测试服,尽量保持和小游戏版本一致 - appkey: 'd959274a83ea3b95bd1d9b765683eff6',//中台appkey - interstitialAdId: 'adunit-4bd19de3c351233e',//插屏ID - bannerId: 'adunit-25341fff11681315',//banner - gridId: 'adunit-491a39ffc9a330a5',//格子 - customId: 'adunit-193590de82ede6a4',//原生模板单个 - customIds: 'adunit-c905cad189ee8a74',//原生模板多个 - shareMessageToFriend: { // 暂时只支持一个场景值 - scene: 0, //定向分享场景值1-50 配>0的会初始化 - sharekey: 'shareMessageToFriendScene',//定向分享对应后台的分享key - share_id: 26,//定向分享对应后台的分享key - }, - default_share: { //默认分享数据在拉取不到中台分享数据的时候用 - content: '全新版本的连连消,等你来玩!',//分享标题 *找运营提供 - icon: 'xxxx',//分享图链接 *找运营提供 - id: '9999',//默认id 写死9999 - key: 'default',//默认分享key 写死default - title: '默认',//无需修改 - typ: 1,//分享类型 写死1 - videoid: '',//默认的视频广告id 填空就行 - }, - MidasPay: { // 米大师虚拟支付配置 *找运营提供 - OfferId: "9999999999", // 在米大师申请的应用id *找运营提供 - ZoneId: "1", // 分区ID,默认:1 - Mode: "game", // 默认:game - CurrencyType: "CNY", // 默认:CNY - Platform: '' // 申请接入时的平台 - } } // sdk版本 -export const SDKVersion = 'v1.0.4'; +export const SDKVersion = 'v1.0.5'; // 是否打印 export const __LOG__ = false; // 是否mock @@ -88,6 +58,7 @@ export const HostKeys = { level: 'logstores/level/track', //关卡打点 role: 'logstores/role/track', //创建角色 client_log: 'logstores/client_log/track', //客户端日志 + consume: 'logstores/consume/track', //资源上报 //登录 Login: 'api/login', //登录 @@ -111,7 +82,6 @@ export const HostKeys = { orderReport: 'api/order/v2/mimas', //订单信息上报 orderQuery: 'api/order/query', //订单信息查询 preorder: 'api/order/v2/preorder', //获取支付方式 - }; // 本地存储keys diff --git a/wxsdk/http/SDKApi.ts b/wxsdk/http/SDKApi.ts index 5a25668..8b3ec9f 100644 --- a/wxsdk/http/SDKApi.ts +++ b/wxsdk/http/SDKApi.ts @@ -66,6 +66,8 @@ export class SDKApi { public static client_log = (...args) => SDKHttp.httpGet(DataService.I.DotApi, HostKeys.client_log, ...args); + public static consume = (...args) => SDKHttp.httpGet(DataService.I.DotApi, HostKeys.consume, ...args); + // OrderApi public static pay = (...args) => SDKHttp.httpPost(DataService.I.OrderApi, HostKeys.orderReport, ...args); diff --git a/wxsdk/service/LogService.ts b/wxsdk/service/LogService.ts index cd89008..a82a9e0 100644 --- a/wxsdk/service/LogService.ts +++ b/wxsdk/service/LogService.ts @@ -483,7 +483,23 @@ export default class LogService { console.log(content); break; } - + } + /** + * 资源上报 + * @param id 1体力 2经验 3钻石 + * @param typ 1增加 2减少 + * @param nums 增加或减少的数量 + * @param gsne 消耗场景 + */ + consume(id: number, typ: number, nums: number, gsne: string) { + let fun = () => SDKApi.consume({ + ...this.buildParams(), + id, + typ, + nums, + gsne + }) + this.checkLogin(fun); } -- libgit2 0.21.0