提交 aa6355a2 作者: wj

更新SDK

上级 4fb3b6c4
...@@ -88,7 +88,7 @@ class TTSDK { ...@@ -88,7 +88,7 @@ class TTSDK {
return { return {
...filters, ...filters,
os: this.SDKCOMMDATA["os"], // 返回系统类型IOS或者android os: this.SDKCOMMDATA["os"], // 返回系统类型IOS或者android
login_code: "", login_code: this.LoginData["encrypted"], // 返回加密后的session_key(后端加密:http://docs.shdxw.net/#docs/backend/session_key)
scene: this.LaunchOptions["scene"], // 用户来源场景值 scene: this.LaunchOptions["scene"], // 用户来源场景值
from_appid: this.LaunchOptions["appId"] || this.LaunchOptions["appid"], from_appid: this.LaunchOptions["appId"] || this.LaunchOptions["appid"],
launchOptions: this.LaunchOptions, launchOptions: this.LaunchOptions,
...@@ -450,7 +450,7 @@ class TTSDK { ...@@ -450,7 +450,7 @@ class TTSDK {
(tt as any).showShareMenu({ withShareTicket: true }); (tt as any).showShareMenu({ withShareTicket: true });
}; };
public ShareGame = (shareInfo: ShareInfo) => { public ShareGameInfo = (shareInfo: ShareInfo) => {
// 参数,记录分享的用户openid // 参数,记录分享的用户openid
const ShareParams = { const ShareParams = {
title: shareInfo.title, title: shareInfo.title,
...@@ -458,9 +458,9 @@ class TTSDK { ...@@ -458,9 +458,9 @@ class TTSDK {
imageUrlId: shareInfo.imageId, imageUrlId: shareInfo.imageId,
query: "fromOpenId=" + this.LoginData["openid"] + "&from=share&tag=0&" + (shareInfo.query ? shareInfo.query : ""), query: "fromOpenId=" + this.LoginData["openid"] + "&from=share&tag=0&" + (shareInfo.query ? shareInfo.query : ""),
}; };
return this._share(ShareParams); return this.share(ShareParams);
}; };
private _share = (DATA: any): Promise<any> => { private share = (DATA: any): Promise<any> => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
(tt as any).shareAppMessage({ (tt as any).shareAppMessage({
...DATA, ...DATA,
...@@ -543,6 +543,12 @@ class TTSDK { ...@@ -543,6 +543,12 @@ class TTSDK {
}); });
} }
// 退出小游戏
public exitApp = () => {
(tt as any).exitMiniProgram();
};
// SDK接口通用参数 // SDK接口通用参数
private SDKCOMMDATA: any = { private SDKCOMMDATA: any = {
source: "TOUTIAO", source: "TOUTIAO",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论