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
c123732e
Commit
c123732e
authored
Sep 26, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6eac03bb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
92 additions
and
6 deletions
+92
-6
index.html
egret/index.html
+1
-1
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-1
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+21
-0
StartSkin.exml
egret/resource/skins/StartSkin.exml
+1
-1
SignItem.ts
egret/src/panels/SignItem.ts
+1
-1
StartScene.ts
egret/src/startScene/StartScene.ts
+13
-2
statistics.ts
egret/src/statistics.ts
+53
-0
No files found.
egret/index.html
View file @
c123732e
...
...
@@ -48,7 +48,7 @@
<script
src=
"libs/pad-zeropadding.js"
></script>
<img
id=
"pic"
style=
"width:100%;position: absolute;z-index: 999;display: none;"
/>
<script>
localStorage
.
clear
();
//
localStorage.clear();
window
[
'total_level'
]
=
18
+
13
*
4
;
window
[
'last_level'
]
=
69
;
//必须大于等于total_level
...
...
egret/libs/new_wx/MainBase.ts
View file @
c123732e
...
...
@@ -39,6 +39,7 @@ import SignPrizePanel from "../../src/panels/SignPrizePanel";
import
getHomeData
,
{
BLOOD_NUMS_MAX
}
from
"../../src/getHomeData"
;
import
BloodPanel2
from
"../../src/panels/BloodPanel2"
;
import
ExchangePanel
from
"../../src/panels/ExchangePanel"
;
import
{
initstatistics
}
from
"../../src/statistics"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
...
...
@@ -292,7 +293,7 @@ export default class MainBase extends eui.UILayer {
check
();
});
initstatistics
();
document
.
addEventListener
(
"visibilitychange"
,
()
=>
{
if
(
document
.
visibilityState
==
"visible"
)
{
...
...
egret/libs/tw/manager/NetManager.ts
View file @
c123732e
...
...
@@ -1774,6 +1774,27 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
}
public
remainDuration
(
remain
,
first
,
from
?):
void
{
const
net
:
INetData
=
{
name
:
'remainDuration'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/api/remainDuration '
,
type
:
'get'
,
dataType
:
'jsonp'
,
param
:
{
id
:
DataManager
.
ins
.
customCfgData
.
hdToolId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityType
:
'hdtool'
,
remain
:
remain
,
first
:
first
,
from
:
from
},
callback
:
null
,
hideMsg
:
true
};
this
.
send
(
net
);
}
/**
* 消息响应
* @param net
...
...
egret/resource/skins/StartSkin.exml
View file @
c123732e
...
...
@@ -15,6 +15,6 @@
<e:Image
id=
"progressmask2"
y=
"9.14"
x=
"16"
source=
"mask2_png"
width=
"444"
height=
"60"
scaleX=
"1"
/>
</e:Group>
<e:Image
source=
"头顶树丛_png"
x=
"0"
y=
"0"
/>
<e:Label
text=
"正在加载中,请稍后"
y=
"985"
textColor=
"0x244b00"
horizontalCenter=
"0
"
/>
<e:Label
id=
"tips"
text=
"正在加载中,请稍后"
y=
"993"
textColor=
"0x244b00"
horizontalCenter=
"0"
size=
"24
"
/>
<e:Label
id=
"percentTxt"
text=
"63%"
y=
"1110"
textColor=
"0x244B00"
horizontalCenter=
"0.5"
/>
</e:Skin>
\ No newline at end of file
egret/src/panels/SignItem.ts
View file @
c123732e
...
...
@@ -24,7 +24,7 @@ export default class SignItem extends eui.ItemRenderer {
this
[
'line1'
].
visible
=
this
.
data
.
index
!=
6
;
this
[
'line2'
].
visible
=!
this
[
'line1'
].
visible
;
this
[
'light'
].
visible
=
this
.
data
.
signed
;
this
[
'title'
].
text
=
`
第
${
this
.
data
.
index
+
1
}
天`
;
this
[
'title'
].
text
=
`
连续签到
${
this
.
data
.
index
+
1
}
天`
;
this
[
'amount'
].
text
=
this
.
data
.
config
.
nums
;
if
(
this
.
data
.
config
.
nums
<=
0
)
...
...
egret/src/startScene/StartScene.ts
View file @
c123732e
...
...
@@ -6,7 +6,16 @@ import { loadSvga } from "../loadSvga";
import
MapBottomPart
from
"../mapScene/MapBottomPart"
;
import
MapRpeatPart
from
"../mapScene/MapRpeatPart"
;
import
MapTopPart
from
"../mapScene/MapTopPart"
;
import
setGlow
from
"../setGlow"
;
const
list
=
[
'小提示:凑齐5个萌狮连消,可以开启大招哦!'
,
'小提示:连续爆炸,得分会成倍增加~'
,
'小提示:发光的小动物可以消除一整片区域哦!'
,
'小提示:带箭头的小动物可以连消一行或一列~'
,
'小提示:冰块对小动物不利,消除他们势在必行!'
,
'万千烦恼丝,一起全消掉!'
,
'连萌梦境,即将开启~'
]
export
default
class
StartScene
extends
Scene
{
private
STOP_PERCENT
=
99
;
private
_current
=
0
;
...
...
@@ -22,7 +31,9 @@ export default class StartScene extends Scene {
this
[
'progressmask2'
].
scaleX
=
0
;
this
[
'percentTxt'
].
text
=
`0%`
;
const
index
=
Math
.
floor
(
Math
.
random
()
*
list
.
length
);
this
[
'tips'
].
text
=
list
[
index
];
// setGlow(this['tips'], 0xffffff, 1);
if
(
data
&&
Array
.
isArray
(
data
))
{
this
[
'container3'
].
addChild
(
data
[
0
]);
this
[
'container2'
].
addChild
(
data
[
1
]);
...
...
egret/src/statistics.ts
0 → 100644
View file @
c123732e
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