Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yyh
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
yyh
Commits
50d3cc60
Commit
50d3cc60
authored
Dec 09, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
504260b7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
19 deletions
+59
-19
TransSkin.exml
egret/resource/skins/TransSkin.exml
+1
-1
Main.ts
egret/src/Main.ts
+6
-6
TransScene.ts
egret/src/yazuwei/TransScene.ts
+45
-11
pollingAnimationState.json
mock/yzw/pollingAnimationState.json
+1
-1
updateAnimationState.json
mock/yzw/updateAnimationState.json
+6
-0
No files found.
egret/resource/skins/TransSkin.exml
View file @
50d3cc60
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<e:Group
id=
"group"
x=
"0"
verticalCenter=
"0"
>
<e:Group
id=
"group"
x=
"0"
verticalCenter=
"0"
>
<e:Image
source=
"trans_bg_jpg"
x=
"0"
y=
"0"
scaleX=
"1"
scaleY=
"1"
/>
<e:Image
source=
"trans_bg_jpg"
x=
"0"
y=
"0"
scaleX=
"1"
scaleY=
"1"
/>
<e:Image
id=
"waitTips"
source=
"transfer _toast1_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
visible=
"false"
/>
<e:Image
id=
"waitTips"
source=
"transfer _toast1_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
visible=
"false"
/>
<e:Image
id=
"matchingTips"
source=
"transfer _toast2_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
/>
<e:Image
id=
"matchingTips"
source=
"transfer _toast2_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
visible=
"false"
/>
<e:Image
id=
"shareTips"
source=
"transfer _toast3_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
visible=
"false"
/>
<e:Image
id=
"shareTips"
source=
"transfer _toast3_png"
horizontalCenter=
"0"
x=
"129"
scaleX=
"1"
scaleY=
"1"
verticalCenter=
"0"
visible=
"false"
/>
</e:Group>
</e:Group>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/Main.ts
View file @
50d3cc60
...
@@ -164,8 +164,9 @@ class Main extends MainBase {
...
@@ -164,8 +164,9 @@ class Main extends MainBase {
// 创建游戏场景
// 创建游戏场景
protected
createGameScene
()
{
protected
createGameScene
()
{
super
.
createGameScene
();
super
.
createGameScene
();
// SceneCtrl.instance.change(ModuleTypes.TransScene);
// SceneCtrl.instance.change(ModuleTypes.TransScene);
//
//
PanelCtrl.instance.show(ModuleTypes.SloganPanel);
// PanelCtrl.instance.show(ModuleTypes.SloganPanel);
// Waiting.instance.hide();
// Waiting.instance.hide();
// return;
// return;
...
@@ -188,12 +189,11 @@ class Main extends MainBase {
...
@@ -188,12 +189,11 @@ class Main extends MainBase {
ToastCtrl
.
instance
.
show
(
"网络异常请重试~"
);
ToastCtrl
.
instance
.
show
(
"网络异常请重试~"
);
return
;
return
;
}
}
},
window
[
'projectId'
],
GameConst
.
getQueryString
(
"InviteSource"
))
Waiting
.
instance
.
hide
();
Waiting
.
instance
.
hide
();
let
data
=
DataManager
.
ins
.
getData
(
"homeBaseInfo"
).
data
;
let
data
=
DataManager
.
ins
.
getData
(
"homeBaseInfo"
).
data
;
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
,
data
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
,
data
);
},
window
[
'projectId'
],
GameConst
.
getQueryString
(
"InviteSource"
))
}
else
{
}
else
{
yzwNet
.
homeBaseInfo
((
s
)
=>
{
yzwNet
.
homeBaseInfo
((
s
)
=>
{
if
(
!
s
){
if
(
!
s
){
...
...
egret/src/yazuwei/TransScene.ts
View file @
50d3cc60
...
@@ -10,6 +10,7 @@ export default class TransScene extends Scene {
...
@@ -10,6 +10,7 @@ export default class TransScene extends Scene {
_standby
:
SVGA
.
EgretMovieClip
;
_standby
:
SVGA
.
EgretMovieClip
;
_trans
:
SVGA
.
EgretMovieClip
;
_trans
:
SVGA
.
EgretMovieClip
;
_isInviterSide
=
false
;
_isInviterSide
=
false
;
_shareCode
;
protected
get
skinKey
()
{
return
'Trans'
}
protected
get
skinKey
()
{
return
'Trans'
}
constructor
(
data
)
{
constructor
(
data
)
{
...
@@ -37,41 +38,74 @@ export default class TransScene extends Scene {
...
@@ -37,41 +38,74 @@ export default class TransScene extends Scene {
this
[
'group'
].
addChild
(
this
[
'matchingTips'
]);
this
[
'group'
].
addChild
(
this
[
'matchingTips'
]);
this
[
'group'
].
addChild
(
this
[
'shareTips'
]);
this
[
'group'
].
addChild
(
this
[
'shareTips'
]);
this
.
addAni
(
this
[
'waitTips'
]);
this
.
addAni
(
this
[
'matchingTips'
]);
this
.
addAni
(
this
[
'shareTips'
]);
// this['matchingTips'];
// this['matchingTips'];
// this['shareTips'];
// this['shareTips'];
const
sharecode
=
0
;
const
sharecode
=
0
;
if
(
this
.
_isInviterSide
)
{
//邀请者
if
(
this
.
_isInviterSide
)
{
//邀请者
this
[
'matchingTips'
].
visible
=
true
;
this
[
'matchingTips'
].
visible
=
true
;
NetManager
.
ins
.
yyh_pollingAnimationState
((
success
)
=>
{
NetManager
.
ins
.
yyh_pollingAnimationState
((
success
)
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
if
(
data
==
3
)
{
//摇一摇
this
.
changeToTrans
();
this
[
'waitTips'
].
visible
=
false
;
this
[
'matchingTips'
].
visible
=
false
;
this
[
'shareTips'
].
visible
=
false
;
}
},
sharecode
,
()
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
if
(
data
==
1
)
{
//被邀请者确认邀请
if
(
data
==
1
)
{
//被邀请者确认邀请
this
[
'waitTips'
].
visible
=
true
;
this
[
'waitTips'
].
visible
=
true
;
this
[
'matchingTips'
].
visible
=
false
;
}
}
if
(
data
==
2
)
{
//用户取消
if
(
data
==
2
)
{
//用户取消
//暂时无法取消
//暂时无法取消
}
}
if
(
data
==
3
)
{
//摇一摇
return
data
===
null
||
data
===
0
||
data
==
1
||
data
==
2
;
this
.
changeToTrans
();
}
},
sharecode
,
()
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'yyh_pollingAnimationState'
).
data
;
return
data
===
null
||
data
===
0
;
})
})
}
else
{
}
else
{
this
.
setRightPhone
();
//邀请者
this
.
setRightPhone
();
//邀请者
this
[
'shareTips'
].
visible
=
true
;
//进入页面后发送确认消息
//进入页面后发送确认消息
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
1
,(
success
)
=>
{
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
1
,
(
success
)
=>
{
if
(
success
)
{
if
(
success
)
{
this
.
addShareEvent
();
this
.
addShareEvent
();
}
}
});
});
}
}
}
}
addShareEvent
(){
addAni
(
d
)
{
egret
.
Tween
.
get
(
d
,
{
loop
:
true
})
.
to
({
alpha
:
0
},
500
).
wait
(
500
)
.
to
({
alpha
:
1
},
500
).
wait
(
500
);
}
addShareEvent
()
{
if
(
window
.
DeviceMotionEvent
)
{
var
speed
=
25
;
var
x
=
0
,
y
=
0
,
z
=
0
,
lastX
=
0
,
lastY
=
0
,
lastZ
=
0
;
window
.
addEventListener
(
'devicemotion'
,
(
event
)
=>
{
var
acceleration
=
event
.
accelerationIncludingGravity
;
x
=
acceleration
.
x
;
y
=
acceleration
.
y
;
if
(
Math
.
abs
(
x
-
lastX
)
>
speed
||
Math
.
abs
(
y
-
lastY
)
>
speed
)
{
this
[
'shareTips'
].
visible
=
false
;
NetManager
.
ins
.
yyh_updateAnimationState
(
this
.
_shareCode
,
3
,
(
success
)
=>
{
if
(
success
)
{
}
}
});
}
lastX
=
x
;
lastY
=
y
;
},
false
);
}
}
setRightPhone
()
{
setRightPhone
()
{
this
.
_standby
.
x
=
-
750
;
this
.
_standby
.
x
=
-
750
;
...
...
mock/yzw/pollingAnimationState.json
View file @
50d3cc60
{
{
"code"
:
null
,
"code"
:
null
,
"data"
:
2
,
"data"
:
3
,
"message"
:
null
,
"message"
:
null
,
"success"
:
true
"success"
:
true
}
}
\ No newline at end of file
mock/yzw/updateAnimationState.json
0 → 100644
View file @
50d3cc60
{
"code"
:
null
,
"data"
:
123456
,
"message"
:
null
,
"success"
:
true
}
\ No newline at end of file
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