Commit 911b16ee authored by wildfirecode's avatar wildfirecode

1

parent 311b914f
...@@ -53,7 +53,8 @@ ...@@ -53,7 +53,8 @@
<script> <script>
// window['pageID'] = 'TeamShareScene'; // window['pageID'] = 'TeamShareScene';
// window['pageID'] = 'JoinShareScene'; // window['pageID'] = 'JoinShareScene';
// window['pageID'] = 'TransScene'; window['pageID'] = 'TransScene';
// window['pageID'] = 'Share2Scene';
window['TransLink']=''; window['TransLink']='';
window['projectId'] = "1"; window['projectId'] = "1";
window['playwayId'] = "join_1"; window['playwayId'] = "join_1";
......
...@@ -183,6 +183,9 @@ class Main extends MainBase { ...@@ -183,6 +183,9 @@ class Main extends MainBase {
// } // }
Waiting.instance.hide(); Waiting.instance.hide();
if (window['pageID'] == 'Share2Scene') {
SceneCtrl.instance.change(ModuleTypes.Share2Scene);
}
if (window['pageID'] == 'JoinShareScene') { if (window['pageID'] == 'JoinShareScene') {
SceneCtrl.instance.change(ModuleTypes.JoinShareScene); SceneCtrl.instance.change(ModuleTypes.JoinShareScene);
} }
......
...@@ -42,5 +42,25 @@ export default class JoinShareScene extends Scene { ...@@ -42,5 +42,25 @@ export default class JoinShareScene extends Scene {
export const deeplink = (activeUrl) => { export const deeplink = (activeUrl) => {
let state = false;
window.location.href = 'esports://openapp?url=http://aghzact.zjkczn.com/h5/defaultActive.html?activeUrl=' + encodeURIComponent(activeUrl); window.location.href = 'esports://openapp?url=http://aghzact.zjkczn.com/h5/defaultActive.html?activeUrl=' + encodeURIComponent(activeUrl);
state = true;
let timer = setTimeout(() => {
state = false;
window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.fan.asiangameshz';
}, 3000);
// 唤端成功清除定时器
document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'hidden') {
if (state) {
if (timer) {
clearTimeout(timer)
timer = null;
}
state = false;
}
}
});
} }
\ No newline at end of file
import Scene from "../views/Scene"; import Scene from "../views/Scene";
import iswx from "../iswx";
import GameConst from "../GameConst";
import { deeplink } from "./JoinShareScene";
export default class Share2Scene extends Scene { export default class Share2Scene extends Scene {
protected get skinKey() { return 'Share2' } protected get skinKey() { return 'Share2' }
...@@ -15,10 +18,15 @@ export default class Share2Scene extends Scene { ...@@ -15,10 +18,15 @@ export default class Share2Scene extends Scene {
} }
onTap_btn() { onTap_btn() {
if (iswx()) {
this['sharemask'].visible = true; this['sharemask'].visible = true;
this['sharemask'].once(egret.TouchEvent.TOUCH_TAP,()=>{ this['sharemask'].once(egret.TouchEvent.TOUCH_TAP, () => {
this['sharemask'].visible = false; this['sharemask'].visible = false;
},this); }, this);
}else {
const url = `${window['TransLink']}?shareCode=${GameConst.getQueryString("shareCode")}`
deeplink(url);
}
} }
initEvents() { initEvents() {
......
...@@ -94,7 +94,7 @@ export default class ShareStarterScene extends Scene { ...@@ -94,7 +94,7 @@ export default class ShareStarterScene extends Scene {
title: '寻找2022个亚运梦想活动火热进行中', title: '寻找2022个亚运梦想活动火热进行中',
content: '快来为我的亚运梦想充能吧', content: '快来为我的亚运梦想充能吧',
imgUrl: 'https://yun.duiba.com.cn/db_games/yyhlogo2.png', imgUrl: 'https://yun.duiba.com.cn/db_games/yyhlogo2.png',
url: window['TransLink']+'?shareCode=' + sharecode , type: '3' url: window['shareLink']+'?shareCode=' + sharecode , type: '3'
}); });
} catch (error) { } catch (error) {
......
...@@ -21,6 +21,16 @@ export default class TransScene extends Scene { ...@@ -21,6 +21,16 @@ export default class TransScene extends Scene {
constructor(data) { constructor(data) {
super(); super();
yzwNet.accept((success) => {
if (success) {
} else {
location.href = window['indexUrl'];
}
}, window['projectId'], GameConst.getQueryString("shareCode"));
this.initUI(data); this.initUI(data);
GCache.writeCache("isGuide2", true); GCache.writeCache("isGuide2", true);
GCache.writeCache("isGuide", true); GCache.writeCache("isGuide", true);
...@@ -139,13 +149,6 @@ export default class TransScene extends Scene { ...@@ -139,13 +149,6 @@ export default class TransScene extends Scene {
} }
onTap_btn() { onTap_btn() {
if (iswx()) {
this['sharemask'].visible = true;
this['sharemask'].once(egret.TouchEvent.TOUCH_TAP, () => {
this['sharemask'].visible = false;
}, this);
return;
}
this['title'].visible = false; this['title'].visible = false;
...@@ -156,15 +159,15 @@ export default class TransScene extends Scene { ...@@ -156,15 +159,15 @@ export default class TransScene extends Scene {
panel.once('onDestroy', () => { panel.once('onDestroy', () => {
this['shareTips'].visible = true; this['shareTips'].visible = true;
//进入页面后发送确认消息 //进入页面后发送确认消息
yzwNet.accept((success) => { // yzwNet.accept((success) => {
if (success) { // if (success) {
yzwNet.openPass(() => { yzwNet.openPass(() => {
this.addShareEvent(); this.addShareEvent();
}, window['projectId'], GameConst.getQueryString("shareCode")) }, window['projectId'], GameConst.getQueryString("shareCode"))
} else { // } else {
location.href = window['indexUrl']; // location.href = window['indexUrl'];
} // }
}, window['projectId'], GameConst.getQueryString("shareCode")); // }, window['projectId'], GameConst.getQueryString("shareCode"));
setTimeout(() => { setTimeout(() => {
this.onshake(); this.onshake();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment