Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
a03c4e5b
Commit
a03c4e5b
authored
May 21, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
25a6e4d2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
17 deletions
+53
-17
AdSmallComp.ts
egret/src/mapScene/AdSmallComp.ts
+6
-1
ADPanel.ts
egret/src/panels/ADPanel.ts
+4
-1
TaskCenter.ts
egret/src/panels/TaskCenter/TaskCenter.ts
+5
-1
TaskCenterPrize.ts
egret/src/panels/TaskCenter/TaskCenterPrize.ts
+6
-1
statistics.ts
egret/src/statistics.ts
+11
-10
WebView.ts
egret/src/webview/WebView.ts
+19
-1
getTaskInfo.json
mock/happyclear/getTaskInfo.json
+2
-2
No files found.
egret/src/mapScene/AdSmallComp.ts
View file @
a03c4e5b
...
@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
...
@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import
{
getlogItem
}
from
"../Main"
;
import
{
getlogItem
}
from
"../Main"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
snpmAdStatic
}
from
"../statics/snpmAdStatic"
;
import
{
snpmAdStatic
}
from
"../statics/snpmAdStatic"
;
import
WebView
from
"../webview/WebView"
;
export
default
class
AdSmallComp
extends
ComponentBase
{
export
default
class
AdSmallComp
extends
ComponentBase
{
...
@@ -40,7 +41,11 @@ export default class AdSmallComp extends ComponentBase {
...
@@ -40,7 +41,11 @@ export default class AdSmallComp extends ComponentBase {
snpmAdStatic
.
snpmAdReport
(
"click"
,
"bottom"
,
result
);
snpmAdStatic
.
snpmAdReport
(
"click"
,
"bottom"
,
result
);
wait
(
50
).
then
(()
=>
{
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
);
},
this
);
}
}
...
...
egret/src/panels/ADPanel.ts
View file @
a03c4e5b
...
@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
...
@@ -4,6 +4,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
import
{
getlogItem
}
from
"../Main"
;
import
{
getlogItem
}
from
"../Main"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
wait
from
"../../libs/new_tc/wait"
;
import
{
snpmAdStatic
}
from
"../statics/snpmAdStatic"
;
import
{
snpmAdStatic
}
from
"../statics/snpmAdStatic"
;
import
WebView
from
"../webview/WebView"
;
export
default
class
ADPanel
extends
Panel
{
export
default
class
ADPanel
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
...
@@ -30,7 +31,9 @@ export default class ADPanel extends Panel {
...
@@ -30,7 +31,9 @@ export default class ADPanel extends Panel {
snpmAdStatic
.
snpmAdReport
(
"click"
,
"dialog"
,
result
);
snpmAdStatic
.
snpmAdReport
(
"click"
,
"dialog"
,
result
);
NetManager
.
ins
.
clickLog1
(
getlogItem
(
25
));
NetManager
.
ins
.
clickLog1
(
getlogItem
(
25
));
wait
(
100
).
then
(()
=>
{
wait
(
100
).
then
(()
=>
{
window
.
location
.
href
=
decodeURI
(
result
.
url
);
var
webview
=
WebView
.
getInstance
();
webview
.
setSrc
(
result
.
url
);
webview
.
show
();
});
});
},
this
);
},
this
);
}
}
...
...
egret/src/panels/TaskCenter/TaskCenter.ts
View file @
a03c4e5b
...
@@ -6,6 +6,7 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
...
@@ -6,6 +6,7 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import
{
Buried
}
from
"../../../libs/tw/util/Buried"
;
import
{
Buried
}
from
"../../../libs/tw/util/Buried"
;
import
{
DataManager
}
from
"../../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../../libs/tw/manager/DataManager"
;
import
{
NetName
}
from
"../../../libs/tw/enum/NetName"
;
import
{
NetName
}
from
"../../../libs/tw/enum/NetName"
;
import
WebView
from
"../../webview/WebView"
;
export
default
class
TaskCenter
extends
Panel
{
export
default
class
TaskCenter
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
...
@@ -156,7 +157,10 @@ class TaskCenterItem extends eui.ItemRenderer {
...
@@ -156,7 +157,10 @@ class TaskCenterItem extends eui.ItemRenderer {
this
.
btnGroup
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
btnGroup
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
clickLog
(
this
.
getlogItem
());
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
);
},
this
);
}
else
{
// 已完成
}
else
{
// 已完成
this
.
btnImg
.
source
=
'TaskCenter_'
+
'done'
+
'Btn_png'
;
this
.
btnImg
.
source
=
'TaskCenter_'
+
'done'
+
'Btn_png'
;
...
...
egret/src/panels/TaskCenter/TaskCenterPrize.ts
View file @
a03c4e5b
...
@@ -6,6 +6,7 @@ import { getlogItem } from "../../Main";
...
@@ -6,6 +6,7 @@ import { getlogItem } from "../../Main";
import
getHomeData
from
"../../getHomeData"
;
import
getHomeData
from
"../../getHomeData"
;
import
{
changeMapScene
}
from
"../../startScene/StartScene"
;
import
{
changeMapScene
}
from
"../../startScene/StartScene"
;
import
SceneCtrl
from
"../../../libs/new_wx/ctrls/sceneCtrl"
;
import
SceneCtrl
from
"../../../libs/new_wx/ctrls/sceneCtrl"
;
import
WebView
from
"../../webview/WebView"
;
export
default
class
TaskCenterPrize
extends
Panel
{
export
default
class
TaskCenterPrize
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
...
@@ -42,7 +43,11 @@ export default class TaskCenterPrize extends Panel {
...
@@ -42,7 +43,11 @@ export default class TaskCenterPrize extends Panel {
}
}
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
PanelCtrl
.
instance
.
show
(
"StartPanel"
,
getHomeData
().
levels
.
length
+
1
);
}
else
{
}
else
{
window
.
location
.
href
=
taskData
.
appIncompletelink
;
// window.location.href = taskData.appIncompletelink;
var
webview
=
WebView
.
getInstance
();
webview
.
setSrc
(
taskData
.
appIncompletelink
);
webview
.
show
();
super
.
hidePanel
();
super
.
hidePanel
();
}
}
},
this
);
},
this
);
...
...
egret/src/statistics.ts
View file @
a03c4e5b
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
//换用webview实现了,废弃
let
startTimer
=
new
Date
().
getTime
();
let
startTimer
=
new
Date
().
getTime
();
let
endTimer
;
let
endTimer
;
//设置隐藏属性和改变可见属性的事件的名称
//设置隐藏属性和改变可见属性的事件的名称
...
@@ -40,14 +40,15 @@ const sendData = () => {
...
@@ -40,14 +40,15 @@ const sendData = () => {
}
}
export
const
initstatistics
=
()
=>
{
export
const
initstatistics
=
()
=>
{
document
.
addEventListener
(
//使用webview来处理时间,废弃
visibilityChange
,
// document.addEventListener(
handleVisibilityChange
,
// visibilityChange,
false
// handleVisibilityChange,
);
// false
// );
document
.
body
[
'onbeforeunload'
]
=
()
=>
{
//
document.body['onbeforeunload']=()=>{
endTimer
=
new
Date
().
getTime
();
//
endTimer = new Date().getTime();
return
sendData
();
//
return sendData();
}
//
}
}
}
egret/src/webview/WebView.ts
View file @
a03c4e5b
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
/**
/**
* WebView
* WebView
* 适配FIXED_WIDTH、FIXED_HEIGHT、NO_BORDER、SHOW_ALL四种缩放模式
* 适配FIXED_WIDTH、FIXED_HEIGHT、NO_BORDER、SHOW_ALL四种缩放模式
...
@@ -30,6 +32,11 @@ export default class WebView extends egret.DisplayObjectContainer {
...
@@ -30,6 +32,11 @@ export default class WebView extends egret.DisplayObjectContainer {
closebtn
:
HTMLImageElement
=
null
;
closebtn
:
HTMLImageElement
=
null
;
nshowurl
:
string
;
showtime
:
number
;
endtime
:
number
;
/**
/**
* @param src
* @param src
*/
*/
...
@@ -89,18 +96,29 @@ export default class WebView extends egret.DisplayObjectContainer {
...
@@ -89,18 +96,29 @@ export default class WebView extends egret.DisplayObjectContainer {
this
.
destroy
();
this
.
destroy
();
}
}
public
setSrc
(
src
:
string
){
public
setSrc
(
src
:
string
){
console
.
log
(
"跳转地址"
,
src
);
if
(
this
.
nshowurl
&&
this
.
nshowurl
==
src
){
}
else
{
this
.
_iframe
.
src
=
""
;
this
.
nshowurl
=
src
;
this
.
_iframe
.
src
=
src
;
this
.
_iframe
.
src
=
src
;
}
}
}
public
show
():
void
{
public
show
():
void
{
this
.
_iframe
.
style
.
display
=
'block'
;
this
.
_iframe
.
style
.
display
=
'block'
;
this
.
_iframeWrapper
.
style
.
display
=
'block'
;
this
.
_iframeWrapper
.
style
.
display
=
'block'
;
this
.
showtime
=
Date
.
now
();
}
}
public
destroy
():
void
{
public
destroy
():
void
{
if
(
this
.
_iframeWrapper
){
if
(
this
.
_iframeWrapper
){
this
.
_iframeWrapper
.
style
.
display
=
"none"
;
this
.
_iframeWrapper
.
style
.
display
=
"none"
;
}
}
this
.
endtime
=
Date
.
now
();
var
passtime
=
this
.
endtime
-
this
.
showtime
;
NetManager
.
ins
.
remainDuration
(
passtime
,
false
);
}
}
// public get width():number {
// public get width():number {
// return this._width;
// return this._width;
...
...
mock/happyclear/getTaskInfo.json
View file @
a03c4e5b
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
{
{
"subActivityId"
:
"SUB446971598063218688"
,
"subActivityId"
:
"SUB446971598063218688"
,
"subActivityName"
:
"狮狮连萌下单"
,
"subActivityName"
:
"狮狮连萌下单"
,
"status"
:
"
1
"
,
"status"
:
"
0
"
,
"taskStatus"
:
"0"
,
"taskStatus"
:
"0"
,
"remark"
:
"下单得1000元宝"
,
"remark"
:
"下单得1000元宝"
,
"taskTitle"
:
"狮狮连萌下单任务"
,
"taskTitle"
:
"狮狮连萌下单任务"
,
"taskViceTitle"
:
"狮狮连萌下单任务"
,
"taskViceTitle"
:
"狮狮连萌下单任务"
,
"icon"
:
"//yun.dui88.com/images/201910/s0yhv1nlil.jpeg"
,
"icon"
:
"//yun.dui88.com/images/201910/s0yhv1nlil.jpeg"
,
"limit"
:
"1"
,
"limit"
:
"1"
,
"done"
:
"
1
"
,
"done"
:
"
0
"
,
"appIncompleteText"
:
"去看看"
,
"appIncompleteText"
:
"去看看"
,
"appCompleteText"
:
"已完成"
,
"appCompleteText"
:
"已完成"
,
"appIncompletelink"
:
"http://cprexg.m.cnsuning.com/snWhale.html#/fight"
,
"appIncompletelink"
:
"http://cprexg.m.cnsuning.com/snWhale.html#/fight"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment