diff --git a/sdk/shareTools.ts b/sdk/shareTools.ts index f5a76af..f21fb75 100644 --- a/sdk/shareTools.ts +++ b/sdk/shareTools.ts @@ -1,12 +1,8 @@ -import { WxHelper } from "../Base/WxHelper"; import WXSDK from "../wxsdk/WXSDK"; -import { OnlineKeys, SDKTools } from "./SDKTools"; - /* * 分享与视频工具类; */ export class ShareTools { - private static isFail: boolean = false; /** * 是否进入分享 onShow有插屏的话用这个判断 */ @@ -29,24 +25,6 @@ export class ShareTools { this.onShowAd = false; params && params.success && params.success(res); }).catch(async err => { - console.log("err", err) - if (err && err.code && err.code === 1006) { - if (Math.random() > SDKTools.getParamsInt(OnlineKeys.shareRandom, 1) && !this.isFail) { - this.isFail = true; - let modalRes = await WxHelper.showModal({ - title: '分享失败', - content: `${Math.random() > 0.5 ? '分享失败,请重新分享!' : '请分享其它群试试!'}`, - showCancel: true, - confirmText: '去分享' - }) - if (modalRes) { - ShareTools.share(shareKey, params, opts); - return - } - } else { - this.isFail = false; - } - } this.onShowAd = false; if (!params || !params.fail) { wx.showToast({ diff --git a/wxsdk/base/SDKConst.ts b/wxsdk/base/SDKConst.ts index 27a3616..975f9cf 100644 --- a/wxsdk/base/SDKConst.ts +++ b/wxsdk/base/SDKConst.ts @@ -4,7 +4,7 @@ export const GAMEDATA = { game_id: '10001',//游戏id channel_id: '10001',//渠道id 暂时和游戏id一致 version: '1.0.1', //版本号 中台控制正式还是测试服,尽量保持和小游戏版本一致 - appkey: 'd959274a83ea3b95bd1d9b765683eff6',//中台appkey + appkey: 'd959274a83ea3b95bd1d9b765683e777',//中台appkey interstitialAdId: 'adunit-4bd19de3c351233e',//插屏ID bannerId: 'adunit-25341fff11681315',//banner customId: 'adunit-193590de82ede6a4',//原生模板单个 @@ -33,8 +33,9 @@ export const GAMEDATA = { } + // sdk版本 -export const SDKVersion = 'v1.0.5'; +export const SDKVersion = 'v1.0.6'; // 是否打印 export const __LOG__ = false; // 是否mock @@ -88,6 +89,7 @@ export const HostKeys = { role: 'logstores/role/track', //创建角色 client_log: 'logstores/client_log/track', //客户端日志 consume: 'logstores/consume/track', //资源上报 + daystay: 'logstores/daystay/track', //300s停留上报 //登录 Login: 'api/login', //登录 diff --git a/wxsdk/http/SDKApi.ts b/wxsdk/http/SDKApi.ts index 8b3ec9f..ff6d0ce 100644 --- a/wxsdk/http/SDKApi.ts +++ b/wxsdk/http/SDKApi.ts @@ -67,6 +67,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); + + public static daystay = (...args) => SDKHttp.httpGet(DataService.I.DotApi, HostKeys.daystay, ...args); // OrderApi diff --git a/wxsdk/service/DataService.ts b/wxsdk/service/DataService.ts index 8ced411..085a3bf 100644 --- a/wxsdk/service/DataService.ts +++ b/wxsdk/service/DataService.ts @@ -4,6 +4,7 @@ import StorageUtils from "../utils/StorageUtils"; import { StorageKeys, GAMEDATA, LoginHost, GameHost, DotHost, OrderHost, GMHost } from "../base/SDKConst"; import { Gender, NetworkType } from "../base/SDKEnum"; import WxLaunch from "../wx/WxLaunch"; +import LogService from "./LogService"; /** * SDK数据管理类 @@ -539,6 +540,7 @@ export default class DataService { if (time >= 300 && dot == 0) { StorageUtils.I.set("pcsdk_today_online_time_300", 1, expiration); this.setPtm(1) + LogService.I.daystay(); clearInterval(this.timeInterval); // 定时重启 setTimeout(() => { diff --git a/wxsdk/service/LogService.ts b/wxsdk/service/LogService.ts index a82a9e0..affcb2c 100644 --- a/wxsdk/service/LogService.ts +++ b/wxsdk/service/LogService.ts @@ -501,6 +501,15 @@ export default class LogService { }) this.checkLogin(fun); } + /** + * 300s停留上报 + */ + daystay() { + let fun = () => SDKApi.daystay({ + ...this.buildParams(), + }) + this.checkLogin(fun); + } /** -- libgit2 0.21.0