Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
466829ea
Commit
466829ea
authored
Nov 28, 2019
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
32145380
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
436 additions
and
143 deletions
+436
-143
index.html
egret/index.html
+3
-9
index1.html
egret/index1.html
+213
-0
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+163
-132
HbNoPrize.ts
egret/src/HongbaoRain/HbNoPrize.ts
+2
-2
Main.ts
egret/src/Main.ts
+2
-0
statistics.ts
egret/src/statistics.ts
+53
-0
No files found.
egret/index.html
View file @
466829ea
...
...
@@ -62,8 +62,7 @@
iqiyi
&&
iqiyi
.
share
({
title
:
'尖叫之夜门票、现金红包限时抢,手慢无!'
,
//标题
desc
:
'立即参与'
,
//描述
imgUrl
:
''
,
//图片
link
:
'https://www.baidu.com/'
,
//链接
link
:
'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'
+
'&signEnt='
+
encodeURIComponent
(
5
),
//链接
success
:
function
(
res
)
{
resolve
(
res
);
},
...
...
@@ -77,15 +76,11 @@
});
}
// 初始化分享数据(native右上角分享)
iqiyi
.
onShare
({
title
:
'尖叫之夜门票、现金红包限时抢,手慢无!'
,
desc
:
'立即参与'
,
// imgUrl: 'http://partner.vip.qiyi.com/mobact2rd/public/img/default.jpg',
// link: 'https://m.iqiyi.com/',
link
:
window
.
location
.
href
,
// dialogTitle: 'onShare 分享选择浮层在这里',
// gifUrl: 'http://qq.yh31.com/tp/zjbq/201711142021166458.gif',
link
:
'http://activity.m.duibatest.com.cn/hdtool/index?id=23282&appKey=jlg88lyxz7siqtmr&openBs=openbs'
+
'&signEnt='
+
encodeURIComponent
(
5
),
dialogTitle
:
'onShare 分享选择浮层在这里'
,
success
:
function
()
{
setResult
(
'分享成功'
);
},
...
...
@@ -96,7 +91,6 @@
setResult
(
'分享取消'
);
}
});
</script>
<script>
// 网鱼网咖图标额外奖励插件
...
...
egret/index1.html
0 → 100644
View file @
466829ea
This diff is collapsed.
Click to expand it.
egret/libs/tw/manager/NetManager.ts
View file @
466829ea
This diff is collapsed.
Click to expand it.
egret/src/HongbaoRain/HbNoPrize.ts
View file @
466829ea
...
...
@@ -23,7 +23,7 @@ export default class HbNoPrize extends Panel {
protected
start
()
{
super
.
start
();
NetManager
.
ins
.
showLog
(
getlogItem
(
13
));
NetManager
.
ins
.
showLog
(
getlogItem
(
35
));
this
.
initUI
();
}
...
...
@@ -42,7 +42,7 @@ export default class HbNoPrize extends Panel {
}
private
onTouchTap
(
e
:
egret
.
TouchEvent
)
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
13
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
35
));
PanelCtrl
.
instance
.
btnDelay
(
e
.
target
);
switch
(
e
.
target
)
{
case
this
.
ok_btn
:
// 去我的奖品页
...
...
egret/src/Main.ts
View file @
466829ea
...
...
@@ -22,6 +22,7 @@ import HbPrize from "./HongbaoRain/HbPrize";
import
HbNoPrize
from
"./HongbaoRain/HbNoPrize"
;
import
HbGame
from
"./HongbaoRain/HbGame"
;
import
NoNetWorkPanel
from
"./Panels/NoNetWorkPanel"
;
import
{
initstatistics
}
from
"./statistics"
;
//////
...
...
@@ -122,6 +123,7 @@ class Main extends eui.UILayer {
// this.getGameRes();
// });
this
.
getGameRes
();
initstatistics
();
}
//加载游戏中的资源
...
...
egret/src/statistics.ts
0 → 100644
View file @
466829ea
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
let
startTimer
=
new
Date
().
getTime
();
let
endTimer
;
//设置隐藏属性和改变可见属性的事件的名称
let
hidden
,
visibilityChange
;
if
(
typeof
document
.
hidden
!==
'undefined'
)
{
hidden
=
'hidden'
;
visibilityChange
=
'visibilitychange'
;
}
else
if
(
typeof
document
[
'msHidden'
]
!==
'undefined'
)
{
hidden
=
'msHidden'
;
visibilityChange
=
'msvisibilitychange'
;
}
else
if
(
typeof
document
[
'webkitHidden'
]
!==
'undefined'
)
{
hidden
=
'webkitHidden'
;
visibilityChange
=
'webkitvisibilitychange'
;
}
const
handleVisibilityChange
=
(
e
)
=>
{
if
(
document
.
visibilityState
==
"visible"
)
{
startTimer
=
new
Date
().
getTime
();
console
.
log
(
'starttimer'
,
startTimer
)
}
if
(
document
.
visibilityState
==
"hidden"
)
{
endTimer
=
new
Date
().
getTime
();
console
.
log
(
'endTimer'
,
endTimer
)
sendData
();
}
};
const
sendData
=
()
=>
{
const
t0
=
endTimer
-
startTimer
;
console
.
log
(
'停留时间是'
,
t0
);
// if (localStorage.getItem('xxl_first_statistics') == null) {
// NetManager.ins.remainDuration(t0, true);
// localStorage.setItem('xxl_first_statistics', '1');
// } else {
NetManager
.
ins
.
remainDuration
(
t0
,
false
);
// }
}
export
const
initstatistics
=
()
=>
{
document
.
addEventListener
(
visibilityChange
,
handleVisibilityChange
,
false
);
document
.
body
[
'onbeforeunload'
]
=
()
=>
{
endTimer
=
new
Date
().
getTime
();
return
sendData
();
}
}
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