Commit a03c4e5b authored by zjz1994's avatar zjz1994

代码暂存

parent 25a6e4d2
......@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { snpmAdStatic } from "../statics/snpmAdStatic";
import WebView from "../webview/WebView";
export default class AdSmallComp extends ComponentBase {
......@@ -40,7 +41,11 @@ export default class AdSmallComp extends ComponentBase {
snpmAdStatic.snpmAdReport("click","bottom",result);
wait(50).then(() => {
if (result.url != 0) window.location.href = decodeURI(result.url);
if (result.url != 0){
var webview = WebView.getInstance();
webview.setSrc(result.url);
webview.show();
}
});
}, this);
}
......
......@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import { getlogItem } from "../Main";
import wait from "../../libs/new_tc/wait";
import { snpmAdStatic } from "../statics/snpmAdStatic";
import WebView from "../webview/WebView";
export default class ADPanel extends Panel {
start(data) {
......@@ -30,7 +31,9 @@ export default class ADPanel extends Panel {
snpmAdStatic.snpmAdReport("click","dialog",result);
NetManager.ins.clickLog1(getlogItem(25));
wait(100).then(()=>{
window.location.href = decodeURI(result.url);
var webview = WebView.getInstance();
webview.setSrc(result.url);
webview.show();
});
}, this);
}
......
......@@ -6,6 +6,7 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import { Buried } from "../../../libs/tw/util/Buried";
import { DataManager } from "../../../libs/tw/manager/DataManager";
import { NetName } from "../../../libs/tw/enum/NetName";
import WebView from "../../webview/WebView";
export default class TaskCenter extends Panel {
public closeBtn: eui.Button;
......@@ -156,7 +157,10 @@ class TaskCenterItem extends eui.ItemRenderer {
this.btnGroup.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(this.getlogItem());
// 跳转任务链接
window.location.href = this.data.appIncompletelink;
// window.location.href = this.data.appIncompletelink;
var webview = WebView.getInstance();
webview.setSrc(this.data.appIncompletelink);
webview.show();
}, this);
} else { // 已完成
this.btnImg.source = 'TaskCenter_' + 'done' + 'Btn_png';
......
......@@ -6,6 +6,7 @@ import { getlogItem } from "../../Main";
import getHomeData from "../../getHomeData";
import { changeMapScene } from "../../startScene/StartScene";
import SceneCtrl from "../../../libs/new_wx/ctrls/sceneCtrl";
import WebView from "../../webview/WebView";
export default class TaskCenterPrize extends Panel {
public closeBtn:eui.Button;
......@@ -42,7 +43,11 @@ export default class TaskCenterPrize extends Panel {
}
PanelCtrl.instance.show("StartPanel", getHomeData().levels.length + 1);
} else {
window.location.href = taskData.appIncompletelink;
// window.location.href = taskData.appIncompletelink;
var webview = WebView.getInstance();
webview.setSrc(taskData.appIncompletelink);
webview.show();
super.hidePanel();
}
}, this);
......
import { NetManager } from "../libs/tw/manager/NetManager";
//换用webview实现了,废弃
let startTimer = new Date().getTime();
let endTimer;
//设置隐藏属性和改变可见属性的事件的名称
......@@ -40,14 +40,15 @@ const sendData = () => {
}
export const initstatistics = () => {
document.addEventListener(
visibilityChange,
handleVisibilityChange,
false
);
//使用webview来处理时间,废弃
// document.addEventListener(
// visibilityChange,
// handleVisibilityChange,
// false
// );
document.body['onbeforeunload']=()=>{
endTimer = new Date().getTime();
return sendData();
}
// document.body['onbeforeunload']=()=>{
// endTimer = new Date().getTime();
// return sendData();
// }
}
import { NetManager } from "../../libs/tw/manager/NetManager";
/**
* WebView
* 适配FIXED_WIDTH、FIXED_HEIGHT、NO_BORDER、SHOW_ALL四种缩放模式
......@@ -30,6 +32,11 @@ export default class WebView extends egret.DisplayObjectContainer {
closebtn:HTMLImageElement=null;
nshowurl:string;
showtime:number;
endtime:number;
/**
* @param src
*/
......@@ -89,18 +96,29 @@ export default class WebView extends egret.DisplayObjectContainer {
this.destroy();
}
public setSrc(src:string){
console.log("跳转地址",src);
if(this.nshowurl&&this.nshowurl==src){
}else{
this._iframe.src = "";
this.nshowurl = src;
this._iframe.src=src;
}
}
public show():void {
this._iframe.style.display='block';
this._iframeWrapper.style.display='block';
this.showtime = Date.now();
}
public destroy():void {
if(this._iframeWrapper){
this._iframeWrapper.style.display="none";
}
this.endtime = Date.now();
var passtime = this.endtime - this.showtime;
NetManager.ins.remainDuration(passtime,false);
}
// public get width():number {
// return this._width;
......
......@@ -7,14 +7,14 @@
{
"subActivityId": "SUB446971598063218688",
"subActivityName": "狮狮连萌下单",
"status": "1",
"status": "0",
"taskStatus": "0",
"remark": "下单得1000元宝",
"taskTitle": "狮狮连萌下单任务",
"taskViceTitle": "狮狮连萌下单任务",
"icon": "//yun.dui88.com/images/201910/s0yhv1nlil.jpeg",
"limit": "1",
"done": "1",
"done": "0",
"appIncompleteText": "去看看",
"appCompleteText": "已完成",
"appIncompletelink": "http://cprexg.m.cnsuning.com/snWhale.html#/fight",
......
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