提交 b5d6a7e1 作者: wangjin

增加右上角分享开关

上级 2962402e
/**
* 鲸鱼游戏微信小游戏接入库
* @author 推广技术部
* @time: 2023-02-10
* @time: 2023-02-17
*
* 下单接口附带用户信息
* SDK增加右上角分享开关
*
*/
class WechatSDK {
private sdkVersion: string = "3.3";
private sdkVersion: string = "3.3.1";
public LaunchOptions: Object; // 启动参数对象
public SystemInfo: Object; // 设备信息
......@@ -18,6 +18,7 @@ class WechatSDK {
private clickCounter = 0; // 当前用户点击次数
private GameRecorder: any = null; // 录屏对象
private recorderBtn: any = null; // 对局回放分享按钮对象
private contrlShareMenu:number = 0; // 右上角分享开关
constructor() {
console.log("当前加载SDK版本号为:", this.sdkVersion);
this.sdkInit();
......@@ -78,6 +79,7 @@ class WechatSDK {
this.LoginData["pay_channel"] = data.default_pay_channel;
this.LoginData["ad_unit_id"] = data.ad_unit_id;
this.LoginData["game_club"] = data.game_club;
this.contrlShareMenu = data.share;
this.ActiReport(); // 上报激活
return this.sdkLogin();
};
......@@ -487,6 +489,7 @@ class WechatSDK {
});
}
public addShareEvent = (shareInfo: shareInfo, callback?) => {
if(!this.contrlShareMenu) return;
(wx as any).onShareAppMessage(() => {
if (callback) callback();
const ShareParams = {
......@@ -510,7 +513,7 @@ class WechatSDK {
};
return this.share(ShareParams);
}
public ShareGameInfo = (shareInfo?) => {
public ShareGameInfo = (shareInfo?:shareInfo) => {
// 参数,记录分享的用户openid
const ShareParams = {
title: shareInfo && shareInfo.title ? shareInfo.title : SDKConfig.shareTitle,
......@@ -829,8 +832,8 @@ declare interface shareInfo {
image?: string;
imageId?: string;
query?: string;
success: any;
fail: any;
success?: any;
fail?: any;
complete?: any;
}
declare interface RecorderInfo {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论