Commit 4f83d660 authored by 任建锋's avatar 任建锋

--

parent 6a9041fb
import { NetManager } from './../../libs/tw/manager/NetManager';
import { Buried } from './../../libs/tw/util/Buried';
import Scene from "../views/Scene";
import GameConst from "../GameConst";
import TopLayerCtrl from '../ctrls/topLayerCtrl';
import { ModuleTypes } from '../types/sceneTypes';
export default class HelpScene extends Scene {
public get skinKey() { return "Help" }
public get groupName() { return "help_Scene" }
public helpBtn:eui.Button;
public shareTips:eui.Group;
private shareCode: string;
onSkinComplete() {
super.onSkinComplete();
this["loop"].play(0)
this["loop"].items.forEach((item) => {
item.tween.loop = true;
})
this.shareCode = GameConst.getQueryString("shareCode");
// console.log(shareCode)
this.initBuired();
this.shareTips.visible=false;
}
exposure = []
dpm = []
dcm = []
initBuired() {
Buried.init();
this.dpm["21"] = Buried.connectDpm(110, 21, 1);
this.dcm["21"] = Buried.connectDcm(202, 0, 0);
this.exposure["21"] = Buried.createExposure(this.dpm["21"], this.dcm["21"]);
NetManager.ins.showLog(this.exposure["21"]);
}
initEvents() {
super.initEvents();
this.helpBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_helpBtn, this);
}
is_weixn_qq(){
var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)) {
return "weixin";
}else if(ua.match(/mqqbrowser/i)) {
return false;
}else if (ua.match(/QQ/i)) {
return "QQ";
}else if (ua.match(/dingtalk/i)) {
return "dingtalk";
}else if (ua.match(/WeiBo/i)) {
return "WeiBo";
}else if (ua.match(/youku/i)) {
return "youku";
}
return false;
}
onTap_helpBtn() {
NetManager.ins.clickLog(this.exposure["21"])
// window.location.href = `${window["shareUrl"]}&sharecode=${this.shareCode}`
if(this.is_weixn_qq()){
//TopLayerCtrl.instance.show(ModuleTypes.TOAST_PANEL, { msg: "请复制当前网页在浏览器打开~" });
this.shareTips.visible=true;
return;
}else{
setTimeout(()=>{
window.location.href = 'http://t.shuqi.com/?#!/ac/in/ct/download';
},1000)
}
console.log("this.shareCode")
console.log(this.shareCode)
console.log(`${window["shareUrl"]}&shareCode=${this.shareCode}`)
if (GameConst.isIOS()) {
console.log("ios")
console.log( window["shareUrl"])
window.location.href = 'shuqireader://internal?module=bookstore&action=openwebview&minver=2.5.0.0&params=' + encodeURIComponent(JSON.stringify({
url:`${window["shareUrl"]}&shareCode=${this.shareCode}`
}));
} else {
console.log("安卓")
console.log( window["shareUrl"])
window.location.href = 'shuqi://openapp?params=' + encodeURIComponent(JSON.stringify({
pageName: 'browser',
params: {
// pageTitle: '书旗叠小七',
targetUrl: `${window["shareUrl"]}&shareCode=${this.shareCode}`
}
}));
}
}
removeEvents() {
super.removeEvents();
this.helpBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_helpBtn, this);
}
}
\ No newline at end of file
......@@ -57,6 +57,8 @@ export default class HelpScene extends Scene {
return "dingtalk";
}else if (ua.match(/WeiBo/i)) {
return "WeiBo";
}else if (ua.match(/youku/i)) {
return "youku";
}
return false;
}
......
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