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";
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
);
}
...
...
egret/src/panels/ADPanel.ts
View file @
a03c4e5b
...
...
@@ -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
);
}
...
...
egret/src/panels/TaskCenter/TaskCenter.ts
View file @
a03c4e5b
...
...
@@ -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'
;
...
...
egret/src/panels/TaskCenter/TaskCenterPrize.ts
View file @
a03c4e5b
...
...
@@ -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
);
...
...
egret/src/statistics.ts
View file @
a03c4e5b
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();
//
}
}
egret/src/webview/WebView.ts
View file @
a03c4e5b
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;
...
...
mock/happyclear/getTaskInfo.json
View file @
a03c4e5b
...
...
@@ -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"
,
...
...
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