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
eb2d8a6a
Commit
eb2d8a6a
authored
Dec 10, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
11f42d42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
78 deletions
+63
-78
index.html
egret/index.html
+1
-0
Main.ts
egret/src/Main.ts
+28
-28
ShareStarterScene.ts
egret/src/yazuwei/ShareStarterScene.ts
+0
-1
TransScene.ts
egret/src/yazuwei/TransScene.ts
+34
-49
No files found.
egret/index.html
View file @
eb2d8a6a
...
...
@@ -54,6 +54,7 @@
// window['pageID'] = 'TeamShareScene';
// window['pageID'] = 'JoinShareScene';
// window['pageID'] = 'Share2Scene';
window
[
'pageID'
]
=
'TransScene'
;
window
[
'projectId'
]
=
"1"
;
window
[
'playwayId'
]
=
"join_1"
;
window
[
"appId"
]
=
""
;
...
...
egret/src/Main.ts
View file @
eb2d8a6a
...
...
@@ -170,35 +170,35 @@ class Main extends MainBase {
// Waiting.instance.hide();
// return;
//
if (window['pageID']) {
//
if (GameConst.getQueryString("InviteSource")) {
//
yzwNet.homeBaseInfo((s) => {
//
if (!s) {
//
ToastCtrl.instance.show(DataManager.ins.getData("homeBaseInfo").message)
//
// ToastCtrl.instance.show("网络异常请重试~");
//
return;
//
}
//
}, window['projectId'], GameConst.getQueryString("InviteSource"))
//
}
//
Waiting.instance.hide();
if
(
window
[
'pageID'
])
{
if
(
GameConst
.
getQueryString
(
"InviteSource"
))
{
yzwNet
.
homeBaseInfo
((
s
)
=>
{
if
(
!
s
)
{
ToastCtrl
.
instance
.
show
(
DataManager
.
ins
.
getData
(
"homeBaseInfo"
).
message
)
// ToastCtrl.instance.show("网络异常请重试~");
return
;
}
},
window
[
'projectId'
],
GameConst
.
getQueryString
(
"InviteSource"
))
}
Waiting
.
instance
.
hide
();
//
if (window['pageID'] == 'JoinShareScene') {
//
SceneCtrl.instance.change(ModuleTypes.JoinShareScene);
//
}
//
if (window['pageID'] == 'TeamShareScene') {
//
SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
//
}
//
if (window['pageID'] == 'Share2Scene') {
//
SceneCtrl.instance.change(ModuleTypes.Share2Scene);
//
}
//
if (window['pageID'] == 'TeamShareScene') {
//
SceneCtrl.instance.change(ModuleTypes.TeamShareScene);
//
}
//
if (window['pageID'] == 'TransScene') {
//
SceneCtrl.instance.change(ModuleTypes.TransScene);
//
}
//
return;
//
}
if
(
window
[
'pageID'
]
==
'JoinShareScene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
JoinShareScene
);
}
if
(
window
[
'pageID'
]
==
'TeamShareScene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
TeamShareScene
);
}
if
(
window
[
'pageID'
]
==
'Share2Scene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
Share2Scene
);
}
if
(
window
[
'pageID'
]
==
'TeamShareScene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
TeamShareScene
);
}
if
(
window
[
'pageID'
]
==
'TransScene'
)
{
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
TransScene
);
}
return
;
}
loadSvgaRes
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
);
...
...
egret/src/yazuwei/ShareStarterScene.ts
View file @
eb2d8a6a
...
...
@@ -25,7 +25,6 @@ export default class ShareStarterScene extends Scene {
this
.
height
=
this
.
stage
.
stageHeight
;
},
this
);
this
.
_bg
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/bg.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
this
.
_bg
.
visible
=
false
;
this
.
_standby
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
...
...
egret/src/yazuwei/TransScene.ts
View file @
eb2d8a6a
...
...
@@ -4,13 +4,13 @@ import { loadSvgaRes, loadSvga } from "../loadSvga";
import
{
wait
}
from
"../GameConst"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
yzwNet
}
from
"../NetConst"
;
export
default
class
TransScene
extends
Scene
{
_bg
:
SVGA
.
EgretMovieClip
;
_standby
:
SVGA
.
EgretMovieClip
;
_trans
:
SVGA
.
EgretMovieClip
;
_isInviterSide
=
false
;
_shareCode
;
protected
get
skinKey
()
{
return
'Trans'
}
constructor
(
data
)
{
...
...
@@ -19,12 +19,9 @@ export default class TransScene extends Scene {
}
async
initUI
(
data
)
{
// await Promise.all([
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress.svga'),
// loadSvgaRes(getResPath() + 'resource/assets/svgas/progress2.svga'),
// ]);
//要区分是分享者,还是被分享者
this
.
once
(
egret
.
Event
.
ADDED_TO_STAGE
,
()
=>
{
this
.
height
=
this
.
stage
.
stageHeight
;
},
this
);
this
.
_bg
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/bg.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
this
.
_bg
.
visible
=
false
;
this
.
_standby
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/standby.svga'
,
this
[
'group'
])
as
SVGA
.
EgretMovieClip
;
...
...
@@ -42,41 +39,8 @@ export default class TransScene extends Scene {
this
.
addAni
(
this
[
'matchingTips'
]);
this
.
addAni
(
this
[
'shareTips'
]);
// this['matchingTips'];
// this['shareTips'];
const
sharecode
=
0
;
if
(
this
.
_isInviterSide
)
{
//邀请者
this
[
'matchingTips'
].
visible
=
true
;
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
;
if
(
data
==
1
)
{
//被邀请者确认邀请
this
[
'waitTips'
].
visible
=
true
;
this
[
'matchingTips'
].
visible
=
false
;
}
if
(
data
==
2
)
{
//用户取消
//暂时无法取消
}
return
data
===
null
||
data
===
0
||
data
==
1
||
data
==
2
;
})
}
else
{
this
.
setRightPhone
();
//邀请者
this
[
'shareTips'
].
visible
=
true
;
//进入页面后发送确认消息
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
1
,
(
success
)
=>
{
if
(
success
)
{
this
.
addShareEvent
();
}
});
}
this
.
setRightPhone
();
//邀请者
}
addAni
(
d
)
{
...
...
@@ -94,12 +58,7 @@ export default class TransScene extends Scene {
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
)
{
}
});
this
.
onshake
();
}
lastX
=
x
;
lastY
=
y
;
...
...
@@ -107,6 +66,16 @@ export default class TransScene extends Scene {
}
}
onshake
(){
this
[
'shareTips'
].
visible
=
false
;
let
sharecode
=
DataManager
.
ins
.
getData
(
'genInvite'
).
data
;
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
3
,
(
success
)
=>
{
if
(
success
)
{
this
.
changeToTrans
();
}
});
}
setRightPhone
()
{
this
.
_standby
.
x
=
-
750
;
this
.
_trans
.
x
=
-
750
;
...
...
@@ -142,10 +111,26 @@ export default class TransScene extends Scene {
}
onTap_btn
()
{
this
[
'btn'
].
visible
=
false
;
console
.
log
(
'onTap_btn'
);
this
[
'shareTips'
].
visible
=
true
;
//进入页面后发送确认消息
yzwNet
.
genInvite
(()
=>
{
let
sharecode
=
DataManager
.
ins
.
getData
(
'genInvite'
).
data
;
NetManager
.
ins
.
yyh_updateAnimationState
(
sharecode
,
1
,
(
success
)
=>
{
if
(
success
)
{
this
.
addShareEvent
();
}
});
},
window
[
'projectId'
]);
setTimeout
(()
=>
{
this
.
onshake
();
},
3000
);
}
initEvents
()
{
//
this.onTap(this['btn'], this.onTap_btn);
this
.
onTap
(
this
[
'btn'
],
this
.
onTap_btn
);
}
}
\ 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