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
8b75ca38
Commit
8b75ca38
authored
Dec 07, 2019
by
wangzhujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
464acbfa
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
227 additions
and
36 deletions
+227
-36
Main.ts
egret/src/Main.ts
+2
-1
NetConst.ts
egret/src/NetConst.ts
+2
-2
StartScene.ts
egret/src/startScene/StartScene.ts
+42
-25
sceneTypes.ts
egret/src/types/sceneTypes.ts
+1
-1
PKPrizePanel.ts
egret/src/yazuwei/PKPrizePanel.ts
+56
-0
PKRulePanel.ts
egret/src/yazuwei/PKRulePanel.ts
+49
-4
PKScene.ts
egret/src/yazuwei/PKScene.ts
+35
-1
PlacePanel.ts
egret/src/yazuwei/PlacePanel.ts
+20
-2
getTreasureBox.json
mock/yzw/getTreasureBox.json
+14
-0
unlockArea.json
mock/yzw/unlockArea.json
+6
-0
No files found.
egret/src/Main.ts
View file @
8b75ca38
...
...
@@ -34,6 +34,7 @@ import RecordMapScene from './yazuwei/RecordMapScene';
import
NoCreditsPanel
from
'./yazuwei/NoCreditsPanel'
;
import
PKScene
from
'./yazuwei/PKScene'
;
import
PKRulePanel
from
'./yazuwei/PKRulePanel'
;
import
PKPrizePanel
from
'./yazuwei/PKPrizePanel'
;
class
Main
extends
MainBase
{
...
...
@@ -66,7 +67,7 @@ class Main extends MainBase {
PanelCtrl
.
instance
.
registerClass
(
ModuleTypes
.
PLACE_PANEL
,
PlacePanel
)
PanelCtrl
.
instance
.
registerClass
(
ModuleTypes
.
NOCREDITS_PANEL
,
NoCreditsPanel
)
PanelCtrl
.
instance
.
registerClass
(
ModuleTypes
.
PKRULE_PANEL
,
PKRulePanel
);
PanelCtrl
.
instance
.
registerClass
(
ModuleTypes
.
PKPRIZE_PANEL
,
PKPrizePanel
)
// NetManager.ins.onNotSuccess = (msg) => {
// showAlertPanel(msg)
...
...
egret/src/NetConst.ts
View file @
8b75ca38
...
...
@@ -82,12 +82,12 @@ export class yzwNet{
* 1.4解锁地区
* @param callback 回调
*/
public
static
collect
(
callback
,
projectId
){
public
static
unlockArea
(
callback
,
projectId
){
let
param
:
any
=
{
}
const
net
:
INetData
=
{
name
:
'
collect
'
,
name
:
'
unlockArea
'
,
uri
:
`/projectx/
${
projectId
}
/join_1/unlockArea.do`
,
type
:
'get'
,
dataType
:
'json'
,
...
...
egret/src/startScene/StartScene.ts
View file @
8b75ca38
...
...
@@ -31,10 +31,13 @@ export default class StartScene extends Scene {
protected
get
skinKey
()
{
return
'Start'
}
private
level
;
private
startdata
;
constructor
(
data
){
super
();
this
.
startdata
=
data
;
this
.
level
=
data
.
currentLevel
this
.
initUI
(
data
);
this
.
hand
.
visible
=
false
;
}
onSkinComplete
()
{
...
...
@@ -51,7 +54,8 @@ export default class StartScene extends Scene {
onEnterFrame
(){
}
initUI
(
data
)
{
this
.
hand
.
visible
=
false
;
this
.
peolab
.
text
=
"总共有"
+
data
.
activityJoinNum
+
"人参与活动"
;
this
.
scorelab
.
text
=
"我的分数:"
+
data
.
currentScore
;
if
(
!
GCache
.
readCache
(
"isGuide"
)){
GCache
.
writeCache
(
"isGuide"
,
true
);
this
.
openGuide
();
...
...
@@ -61,38 +65,43 @@ export default class StartScene extends Scene {
this
.
hand
.
visible
=
true
;
this
.
onTap
(
this
.
unlockBtn
,
this
.
GuideFive
);
}
this
.
peolab
.
text
=
"总共有"
+
data
.
activityJoinNum
+
"人参与活动"
;
this
.
scorelab
.
text
=
"我的分数:"
+
data
.
currentScore
;
if
(
data
.
currentLevel
>
0
){
this
.
needscore
.
visible
=
true
;
this
.
needscore
.
text
=
"需要达到"
+
data
.
nextLevelScore
+
"分数"
if
(
data
.
nextLevelScore
>
data
.
currentScore
){
this
.
onTap
(
this
.
unlockBtn
,
this
.
noCredits
);
this
.
unlockBtn
.
icon
=
"lockBtn_png"
;
this
.
needscore
.
textColor
=
0x99b3ca
;
}
else
{
if
(
data
.
currentLevel
>
0
){
this
.
needscore
.
visible
=
true
;
this
.
needscore
.
text
=
"需要达到"
+
data
.
nextLevelScore
+
"分数"
if
(
data
.
nextLevelScore
>
data
.
currentScore
){
this
.
onTap
(
this
.
unlockBtn
,
this
.
noCredits
);
this
.
unlockBtn
.
icon
=
"lockBtn_png"
;
this
.
needscore
.
textColor
=
0x99b3ca
;
}
else
{
this
.
unlockBtn
.
icon
=
"getBtn_png"
this
.
needscore
.
textColor
=
0x343a75
;
this
.
onTap
(
this
.
unlockBtn
,
this
.
unlockArea
);
}
this
.
showMap
(
data
.
currentLevel
)
if
(
data
.
currentLevel
==
8
){
this
.
unlockBtn
.
touchEnabled
=
false
;
this
.
unlockBtn
.
touchChildren
=
false
;
this
.
unlockBtn
.
icon
=
"waitBtn_png"
this
.
needscore
.
visible
=
false
;
}
}
else
{
this
.
unlockBtn
.
icon
=
"
ge
tBtn_png"
this
.
needscore
.
textColor
=
0x343a75
;
this
.
unlockBtn
.
icon
=
"
star
tBtn_png"
this
.
onTap
(
this
.
unlockBtn
,
this
.
unlockArea
)
;
}
this
.
showMap
(
data
.
currentLevel
)
if
(
data
.
currentLevel
==
8
){
this
.
unlockBtn
.
touchEnabled
=
false
;
this
.
unlockBtn
.
touchChildren
=
false
;
this
.
unlockBtn
.
icon
=
"getBtn_png"
}
}
else
{
this
.
unlockBtn
.
icon
=
"startBtn_png"
}
}
noCredits
(){
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
NOCREDITS_PANEL
)
}
private
arr
=
[
"hz"
,
"am"
,
"xg"
,
"tb"
,
"rb"
,
"hg"
,
"cx"
,
"mg"
]
showMap
(
num
){
const
arr
=
[
"hz"
,
"am"
,
"xg"
,
"tb"
,
"rb"
,
"hg"
,
"cx"
,
"mg"
]
for
(
let
i
=
0
;
i
<
num
;
i
++
){
this
[
arr
[
i
]].
source
=
this
[
arr
[
i
]].
source
.
substring
(
2
);
this
[
this
.
arr
[
i
]].
source
=
this
[
this
.
arr
[
i
]].
source
.
substring
(
2
);
}
}
openGuide
(){
...
...
@@ -133,7 +142,14 @@ export default class StartScene extends Scene {
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
RECORD_SCENE
,
this
.
level
)
}
unlockArea
(){
yzwNet
.
unlockArea
((
s
)
=>
{
if
(
!
s
){
ToastCtrl
.
instance
.
show
(
"网络异常请重试~"
);
return
}
this
[
this
.
arr
[
this
.
level
]].
source
=
this
[
this
.
arr
[
this
.
level
]].
source
.
substring
(
2
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PLACE_PANEL
,
this
.
level
+
1
);
},
window
[
'projectId'
]);
}
initEvents
(){
...
...
@@ -152,7 +168,8 @@ export default class StartScene extends Scene {
return
}
let
data
=
DataManager
.
ins
.
getData
(
"getPkBaseInfo"
).
data
;
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
PK_SCENE
,
data
);
let
pkdata
=
{
data
:
data
,
startdata
:
this
.
startdata
}
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
PK_SCENE
,
pkdata
);
},
window
[
'projectId'
]);
}
setColor
(
group
)
{
...
...
egret/src/types/sceneTypes.ts
View file @
8b75ca38
...
...
@@ -34,7 +34,7 @@ export enum ModuleTypes {
NOCREDITS_PANEL
,
PK_SCENE
,
PKRULE_PANEL
,
PKPRIZE_PANEL
,
TOAST
...
...
egret/src/yazuwei/PKPrizePanel.ts
0 → 100644
View file @
8b75ca38
import
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
Panel
from
"../views/Panel"
;
import
NetConst
from
'../NetConst'
;
import
Waiting
from
'../waiting/Waiting'
;
import
{
HtmlTextParser
}
from
'../rulePanel/HtmlTextParser'
;
export
default
class
PKRulePanel
extends
Panel
{
public
labContent
:
eui
.
Label
;
public
scroller
:
eui
.
Scroller
;
public
textstring
:
string
=
""
;
public
endstr
:
string
=
""
;
start
()
{
Waiting
.
instance
.
hide
()
if
(
window
[
'PKruleTxt'
])
{
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
window
[
'PKruleTxt'
]);
this
.
labContent
.
textColor
=
0xb1d1e7
;;
}
else
{
if
(
!
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
||
!
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
.
rule
)
{
NetConst
.
ajaxElement
(()
=>
{
// DataManager
this
.
addRule
();
});
}
else
{
this
.
addRule
();
}
}
}
group
:
eui
.
Group
;
private
addRule
()
{
const
text
=
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
.
rule
;
this
.
textstring
=
text
;
this
.
replaceWord
();
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
this
.
textstring
);
this
.
labContent
.
textColor
=
parseInt
(
"fcffb4"
,
16
);
}
replaceWord
(){
if
(
this
.
textstring
.
search
(
"</p>"
)
==
-
1
)
{
if
(
this
.
endstr
){
this
.
textstring
=
this
.
endstr
;
}
}
else
{
this
.
textstring
=
this
.
textstring
.
replace
(
"</p>"
,
"</p><br>"
);
this
.
endstr
=
this
.
endstr
.
concat
(
this
.
textstring
.
slice
(
0
,
this
.
textstring
.
search
(
"</p>"
)
+
8
));
this
.
textstring
=
this
.
textstring
.
slice
(
this
.
textstring
.
search
(
"</p>"
)
+
8
,
this
.
textstring
.
length
);
this
.
replaceWord
();
}
}
get
skinKey
()
{
return
'PKRule'
}
}
\ No newline at end of file
egret/src/yazuwei/PKRulePanel.ts
View file @
8b75ca38
import
{
NetManager
}
from
'./../../libs/tw/manager/NetManager'
;
import
{
DataManager
}
from
'./../../libs/tw/manager/DataManager'
;
import
Panel
from
"../views/Panel"
;
import
NetConst
from
'../NetConst'
;
import
Waiting
from
'../waiting/Waiting'
;
import
{
HtmlTextParser
}
from
'../rulePanel/HtmlTextParser'
;
export
default
class
PKRulePanel
extends
Panel
{
public
labContent
:
eui
.
Label
;
public
scroller
:
eui
.
Scroller
;
public
textstring
:
string
=
""
;
public
endstr
:
string
=
""
;
export
default
class
PKRulePanel
extends
Panel
{
start
()
{
Waiting
.
instance
.
hide
()
if
(
window
[
'PKruleTxt'
])
{
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
window
[
'PKruleTxt'
]);
this
.
labContent
.
textColor
=
0xb1d1e7
;;
}
else
{
if
(
!
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
||
!
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
.
rule
)
{
NetConst
.
ajaxElement
(()
=>
{
// DataManager
this
.
addRule
();
});
}
else
{
this
.
addRule
();
}
}
}
protected
get
skinKey
(){
return
'PKRule'
}
constructor
(){
super
()
group
:
eui
.
Group
;
private
addRule
()
{
const
text
=
DataManager
.
ins
.
getData
(
"gameAjaxElement"
).
data
.
rule
;
this
.
textstring
=
text
;
this
.
replaceWord
();
this
.
labContent
.
textFlow
=
(
new
HtmlTextParser
).
parser
(
this
.
textstring
);
this
.
labContent
.
textColor
=
parseInt
(
"fcffb4"
,
16
);
}
replaceWord
(){
if
(
this
.
textstring
.
search
(
"</p>"
)
==
-
1
)
{
if
(
this
.
endstr
){
this
.
textstring
=
this
.
endstr
;
}
}
else
{
this
.
textstring
=
this
.
textstring
.
replace
(
"</p>"
,
"</p><br>"
);
this
.
endstr
=
this
.
endstr
.
concat
(
this
.
textstring
.
slice
(
0
,
this
.
textstring
.
search
(
"</p>"
)
+
8
));
this
.
textstring
=
this
.
textstring
.
slice
(
this
.
textstring
.
search
(
"</p>"
)
+
8
,
this
.
textstring
.
length
);
this
.
replaceWord
();
}
}
get
skinKey
()
{
return
'PKRule'
}
}
\ No newline at end of file
egret/src/yazuwei/PKScene.ts
View file @
8b75ca38
import
Scene
from
"../views/Scene"
;
import
PanelCtrl
from
"../ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
{
yzwNet
}
from
"../NetConst"
;
import
ToastCtrl
from
"../ctrls/toastCtrl"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
PKScene
extends
Scene
{
protected
get
skinKey
(){
return
'PK'
}
...
...
@@ -30,7 +33,15 @@ export default class PKScene extends Scene{
constructor
(
data
){
super
();
this
.
initUI
(
data
);
let
_data
=
data
.
data
;
this
.
initUI
(
_data
);
let
startdata
=
data
.
startdata
;
if
(
startdata
.
treasureBoxNum
>
0
){
this
.
onTap
(
this
.
box
,
this
.
onTap_OpenBox
);
}
else
{
this
.
setColor
(
this
.
box
);
this
.
box
.
touchEnabled
=
false
;
}
}
initUI
(
data
){
this
.
addEventListener
(
egret
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
...
...
@@ -54,6 +65,14 @@ export default class PKScene extends Scene{
}
this
.
myline
.
anchorOffsetY
=
this
.
myline
.
height
this
.
otherline
.
anchorOffsetY
=
this
.
otherline
.
height
this
.
myline
.
y
=
1624
;
this
.
otherline
.
y
=
1624
;
this
.
myteam
.
y
=
this
.
myline
.
y
-
this
.
myline
.
height
-
70
;
this
.
myteamnum
.
y
=
this
.
myline
.
y
-
this
.
myline
.
height
-
35
;
this
.
otherteam
.
y
=
this
.
otherline
.
y
-
this
.
otherline
.
height
-
70
;
this
.
otherteamnum
.
y
=
this
.
otherline
.
y
-
this
.
otherline
.
height
-
35
;
console
.
log
(
this
.
myteam
.
y
)
for
(
let
i
=
1
;
i
<
data
.
myTeamMembers
.
length
+
1
;
i
++
){
this
[
"team"
+
i
][
"onnum"
].
text
=
"+"
+
data
.
myTeamMembers
[
i
-
1
].
steps
;
this
[
"team"
+
i
][
"onphone"
].
text
=
data
.
myTeamMembers
[
i
-
1
].
phone
;
...
...
@@ -79,6 +98,9 @@ export default class PKScene extends Scene{
this
.
setColor
(
this
[
"team"
+
i
][
"headimg"
]);
this
[
"team"
+
i
][
"notonphone"
].
text
=
data
.
myTeamMembers
[
i
-
1
].
phone
;
}
if
(
data
.
myTeamMembers
[
i
-
1
].
myFlag
==
1
){
this
[
"team"
+
i
][
"onphone"
].
text
=
"我"
}
}
for
(
let
n
=
5
;
n
>
data
.
myTeamMembers
.
length
;
n
--
){
this
[
"team"
+
n
][
"notonline"
].
visible
=
false
;
...
...
@@ -110,6 +132,18 @@ export default class PKScene extends Scene{
initEvents
(){
this
.
onTap
(
this
.
ruleBtn
,()
=>
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PKRULE_PANEL
)});
}
onTap_OpenBox
(){
yzwNet
.
getTreasureBox
((
s
)
=>
{
if
(
!
s
){
ToastCtrl
.
instance
.
show
(
"网络异常请重试~"
);
return
}
let
data
=
DataManager
.
ins
.
getData
(
"getTreasureBox"
).
data
;
this
.
setColor
(
this
.
box
)
this
.
clearTap
(
this
.
box
,
this
.
onTap_OpenBox
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
PKPRIZE_PANEL
,
data
)
},
window
[
'projectId'
])
}
setColor
(
group
)
{
let
colorMatrix
=
[
0.3
,
0.3
,
0.3
,
0
,
0
,
...
...
egret/src/yazuwei/PlacePanel.ts
View file @
8b75ca38
import
Panel
from
"../views/Panel"
;
import
{
yzwNet
}
from
"../NetConst"
;
import
ToastCtrl
from
"../ctrls/toastCtrl"
;
import
Waiting
from
"../waiting/Waiting"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
SceneCtrl
from
"../ctrls/sceneCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
export
default
class
PlacePanel
extends
Panel
{
protected
get
skinKey
(){
return
'Place'
}
...
...
@@ -32,10 +38,22 @@ export default class PlacePanel extends Panel{
initEvents
(){
super
.
initEvents
();
this
.
onTap
(
this
.
closeBtn
,
()
=>
{
this
.
hidePanel
();}
)
this
.
onTap
(
this
.
knowBtn
,
()
=>
{
this
.
hidePanel
();}
)
this
.
onTap
(
this
.
closeBtn
,
this
.
backStart
)
this
.
onTap
(
this
.
knowBtn
,
this
.
backStart
)
}
backStart
(){
yzwNet
.
homeBaseInfo
((
s
)
=>
{
if
(
!
s
){
ToastCtrl
.
instance
.
show
(
"网络异常请重试~"
);
return
;
}
Waiting
.
instance
.
hide
();
let
data
=
DataManager
.
ins
.
getData
(
"homeBaseInfo"
).
data
;
this
.
hidePanel
()
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
START_SCENE
,
data
);
},
window
[
'projectId'
])
}
}
\ No newline at end of file
mock/yzw/getTreasureBox.json
0 → 100644
View file @
8b75ca38
{
"code"
:
null
,
"data"
:{
"image"
:
"//yun.dui88.com/projectxh5/credits-250-250.png"
,
"optionId"
:
"o0e116a8d"
,
"prizeId"
:
"credits_30"
,
"prizeName"
:
"能量30"
,
"prizeType"
:
2
,
"url"
:
"/aaw/projectx/takePrize?projectOrderNo=2190"
,
"userRecordId"
:
2190
},
"message"
:
null
,
"success"
:
true
}
\ No newline at end of file
mock/yzw/unlockArea.json
0 → 100644
View file @
8b75ca38
{
"code"
:
null
,
"data"
:
null
,
"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