Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
wfc13
Commits
c1901bd5
Commit
c1901bd5
authored
Aug 03, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1ba45eac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
11 deletions
+91
-11
panelCtrl.ts
project/module/ctrls/panelCtrl.ts
+2
-0
share_fail.ts
project/src/panels/share_fail.ts
+36
-0
share_success.ts
project/src/panels/share_success.ts
+36
-0
IndexScene.ts
project/src/template/IndexScene.ts
+17
-11
No files found.
project/module/ctrls/panelCtrl.ts
View file @
c1901bd5
...
@@ -159,6 +159,8 @@ export default class PanelCtrl {
...
@@ -159,6 +159,8 @@ export default class PanelCtrl {
}
}
}
}
get
current
(){
return
this
.
_current
}
destroy
()
{
destroy
()
{
PanelCtrl
.
_instance
=
null
;
PanelCtrl
.
_instance
=
null
;
this
.
stacks
=
null
;
this
.
stacks
=
null
;
...
...
project/src/panels/share_fail.ts
0 → 100644
View file @
c1901bd5
import
{
changeScene
}
from
"../../module/ctrls"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
getObject
from
"../getObject"
;
import
{
IndexScene
}
from
"../template/IndexScene"
;
import
{
Tools
}
from
"../Tools"
;
import
{
getWebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
ShareFailPanel
extends
Panel
{
initUi
()
{
super
.
initUi
();
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
skin
.
x
,
skin
.
y
);
}
get
groupNames
()
{
return
[
"share_fail"
]
}
get
skinName
()
{
return
"share_fail"
}
//两个按钮都是关闭作用
get
closeBtns
()
{
return
[
getObject
(
this
,
'share_fail_closebtn'
),
getObject
(
this
,
'share_fail_okbtn'
)];
}
async
start
(
data
)
{
super
.
start
();
}
hidePanel
(){
super
.
hidePanel
();
// changeScene(IndexScene);
}
}
\ No newline at end of file
project/src/panels/share_success.ts
0 → 100644
View file @
c1901bd5
import
{
changeScene
}
from
"../../module/ctrls"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
Panel
}
from
"../../module/views/Panel"
;
import
getObject
from
"../getObject"
;
import
{
IndexScene
}
from
"../template/IndexScene"
;
import
{
Tools
}
from
"../Tools"
;
import
{
getWebData
,
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
ShareSuccessPanel
extends
Panel
{
initUi
()
{
super
.
initUi
();
var
skin
=
RES
.
getSkinDataByName
(
this
.
skinName
);
this
.
position
.
set
(
skin
.
x
,
skin
.
y
);
}
get
groupNames
()
{
return
[
"share_success"
]
}
get
skinName
()
{
return
"share_success"
}
//两个按钮都是关闭作用
get
closeBtns
()
{
return
[
getObject
(
this
,
'share_success_closebtn'
),
getObject
(
this
,
'share_success_okbtn'
)];
}
async
start
(
data
)
{
super
.
start
();
}
hidePanel
(){
super
.
hidePanel
();
// changeScene(IndexScene);
}
}
\ No newline at end of file
project/src/template/IndexScene.ts
View file @
c1901bd5
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
'@spark/utils'
;
import
{
unwatchPageVisibility
,
watchPageVisibility
}
from
'@spark/utils'
;
import
{
changeScene
,
showPanel
}
from
"../../module/ctrls"
;
import
{
closeCurrentPanel
,
showPanel
}
from
"../../module/ctrls"
;
import
PanelCtrl
from
'../../module/ctrls/panelCtrl'
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
ShareFailPanel
}
from
'../panels/share_fail'
;
import
{
ShareSuccessPanel
}
from
'../panels/share_success'
;
import
{
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
import
{
sendWebNet
,
WebNetName
}
from
'../WebNet'
;
import
{
NewbieScene
}
from
'./NewbieScene'
;
export
class
IndexScene
extends
Scene
{
export
class
IndexScene
extends
Scene
{
get
groupNames
()
{
return
[
"index"
]
}
get
groupNames
()
{
return
[
"index"
]
}
get
skinName
()
{
return
"index"
}
get
skinName
()
{
return
"index"
}
...
@@ -14,24 +15,29 @@ export class IndexScene extends Scene {
...
@@ -14,24 +15,29 @@ export class IndexScene extends Scene {
async
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
super
.
start
();
console
.
log
(
this
);
//
console.log(this);
// setTimeout(() => {
// setTimeout(() => {
// changeScene(NewbieScene)
// changeScene(NewbieScene)
// }, 1000);
// }, 1000);
}
}
async
onPageVisibilityChange
(
visible
)
{
onPageVisibilityChange
=
async
(
visible
)
=>
{
console
.
log
(
'页面'
+
visible
?
'可见'
:
'不可见'
);
console
.
log
(
'页面'
+
visible
?
'可见'
:
'不可见'
);
if
(
visible
)
{
const
current
=
PanelCtrl
.
instance
.
current
;
if
(
visible
&&
!
current
)
{
var
res
=
await
sendWebNet
(
WebNetName
.
index
)
var
res
=
await
sendWebNet
(
WebNetName
.
canshare
)
if
(
res
&&
res
.
success
&&
res
.
data
)
{
if
(
res
&&
res
.
success
&&
res
.
data
)
{
// showPanel(PrizePanel);
showPanel
(
ShareSuccessPanel
);
}
else
{
setTimeout
(()
=>
{
// showPanel(PrizePanel);
showPanel
(
ShareFailPanel
);
},
3000
);
}
else
{
showPanel
(
ShareFailPanel
);
}
}
}
}
}
}
initEvents
()
{
initEvents
()
{
...
...
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