|
@@ -1,7 +1,8 @@
|
|
|
const LoginApi = require('./LoginApi');
|
|
|
const ShareAction = require('../utils/ShareAction');
|
|
|
const AlertManager = require('../utils/AlertManager');
|
|
|
-// const SkillApi = require("../net/SkillApi");
|
|
|
+const {GameNotificationKey, WechatShareType } = require('../utils/GameEnum');
|
|
|
+const SkillApi = require("../net/SkillApi");
|
|
|
|
|
|
class WeChat {
|
|
|
|
|
@@ -195,7 +196,7 @@ class WeChat {
|
|
|
}
|
|
|
|
|
|
shareAction(type, success, fail) {
|
|
|
- if (CC_WECHATGAME) {
|
|
|
+ if (CC_WECHATGAME || window.tt != undefined) {
|
|
|
GameGlobal.isIgnoreShareStatus = false;
|
|
|
GameGlobal.clickShare = true;
|
|
|
GameGlobal.gameShareType = type;
|
|
@@ -211,6 +212,17 @@ class WeChat {
|
|
|
success: (res) => {
|
|
|
console.log('分享成功');
|
|
|
success && success();
|
|
|
+ if (GameGlobal.clickShare) {
|
|
|
+ GameEvent.fire(GameNotificationKey.ShowShareAction, GameGlobal.gameShareType, true);
|
|
|
+ GameGlobal.clickShare = false;
|
|
|
+ GameGlobal.gameShareType = WechatShareType.None;
|
|
|
+ GameGlobal.isIgnoreShareStatus = false;
|
|
|
+ SkillApi.report(2, (responseData) => {
|
|
|
+
|
|
|
+ },(error) => {
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
fail: () => {
|
|
|
console.log('分享失败或取消');
|