Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
e4143880
Commit
e4143880
authored
Dec 11, 2019
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
94873383
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
119 additions
and
46 deletions
+119
-46
workspace.xml
.idea/workspace.xml
+16
-5
NetName.ts
egret/libs/tw/enum/NetName.ts
+1
-0
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+22
-2
GameModel.ts
egret/libs/tw/model/common/GameModel.ts
+1
-1
Main.ts
egret/src/Main.ts
+7
-0
RulePanel.ts
egret/src/Panels/RulePanel/RulePanel.ts
+1
-4
TaskPanel.ts
egret/src/Panels/TaskPanel.ts
+1
-2
WareHousePanel.ts
egret/src/Panels/WareHousePanel.ts
+16
-2
IndexUI.ts
egret/src/Scenes/IndexScene/IndexUI.ts
+8
-8
LandMgr.ts
egret/src/Scenes/IndexScene/LandMgr.ts
+17
-3
Crop.ts
egret/src/Scenes/IndexScene/Objs/Crop.ts
+9
-4
getRule.ts
egret/src/ctrls/net/getRule.ts
+1
-1
config.js
mock/config.js
+10
-10
getRule.json
mock/projectX/getRule.json
+5
-0
getUserSpList.json
mock/projectX/getUserSpList.json
+4
-4
No files found.
.idea/workspace.xml
View file @
e4143880
...
@@ -3,9 +3,19 @@
...
@@ -3,9 +3,19 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"9464afa6-0efb-46c2-9cfd-05475acd81df"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"9464afa6-0efb-46c2-9cfd-05475acd81df"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/index.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/index.html"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/libs/tw/enum/NetName.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/libs/tw/enum/NetName.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/libs/tw/manager/NetManager.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/libs/tw/model/common/GameModel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/libs/tw/model/common/GameModel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Main.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Main.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Panels/RulePanel/RulePanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Panels/TaskPanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/mock/joyousManor/taskInfo.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/mock/joyousManor/taskInfo.json"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Panels/WareHousePanel.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexUI.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/IndexUI.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/LandMgr.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/Scenes/IndexScene/Objs/Crop.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/egret/src/ctrls/net/getRule.ts"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/egret/src/ctrls/net/getRule.ts"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/mock/config.js"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/mock/config.js"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/mock/projectX/getUserSpList.json"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/mock/projectX/getUserSpList.json"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
@@ -81,7 +91,8 @@
...
@@ -81,7 +91,8 @@
<workItem
from=
"1575511989902"
duration=
"370000"
/>
<workItem
from=
"1575511989902"
duration=
"370000"
/>
<workItem
from=
"1575512375307"
duration=
"22831000"
/>
<workItem
from=
"1575512375307"
duration=
"22831000"
/>
<workItem
from=
"1575602130550"
duration=
"39482000"
/>
<workItem
from=
"1575602130550"
duration=
"39482000"
/>
<workItem
from=
"1575855730362"
duration=
"62277000"
/>
<workItem
from=
"1575855730362"
duration=
"63686000"
/>
<workItem
from=
"1576028222753"
duration=
"4125000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
@@ -117,10 +128,10 @@
...
@@ -117,10 +128,10 @@
<screen
x=
"36"
y=
"23"
width=
"1644"
height=
"1027"
/>
<screen
x=
"36"
y=
"23"
width=
"1644"
height=
"1027"
/>
</state>
</state>
<state
x=
"586"
y=
"160"
key=
"refactoring.ChangeSignatureDialog/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027"
timestamp=
"1575965663028"
/>
<state
x=
"586"
y=
"160"
key=
"refactoring.ChangeSignatureDialog/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027"
timestamp=
"1575965663028"
/>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup"
timestamp=
"157
5978457319
"
>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup"
timestamp=
"157
6032324115
"
>
<screen
x=
"36"
y=
"23"
width=
"1644"
height=
"1027"
/>
<screen
x=
"36"
y=
"23"
width=
"1644"
height=
"1027"
/>
</state>
</state>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027"
timestamp=
"157
5978457319
"
/>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup/36.23.1644.1027/1680.-229.1920.1177@36.23.1644.1027"
timestamp=
"157
6032324115
"
/>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup/36.23.1644.1027@36.23.1644.1027"
timestamp=
"1575960048181"
/>
<state
x=
"523"
y=
"250"
width=
"670"
height=
"676"
key=
"search.everywhere.popup/36.23.1644.1027@36.23.1644.1027"
timestamp=
"1575960048181"
/>
</component>
</component>
</project>
</project>
\ No newline at end of file
egret/libs/tw/enum/NetName.ts
View file @
e4143880
...
@@ -128,6 +128,7 @@ export enum NetName {
...
@@ -128,6 +128,7 @@ export enum NetName {
GET_COUPON_INFO
,
GET_COUPON_INFO
,
QUERY_RECORDS
,
QUERY_RECORDS
,
GET_PROJECTUSERINFO
,
GET_PROJECTUSERINFO
,
GET_RULE
,
GET_LANDINFO
,
GET_LANDINFO
,
DO_PLANT
,
DO_PLANT
,
...
...
egret/libs/tw/manager/NetManager.ts
View file @
e4143880
...
@@ -530,10 +530,10 @@ export class NetManager extends ABNetManager {
...
@@ -530,10 +530,10 @@ export class NetManager extends ABNetManager {
/**
/**
* 获取规则
* 获取规则
*/
*/
public
getRule
(
callback
:
Function
):
void
{
public
getRule
Ng
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
GAME_RULE
,
name
:
NetName
.
GAME_RULE
,
uri
:
'/ngapi/getRule'
,
uri
:
'/ngapi/getRule
Ng
'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'html'
,
dataType
:
'html'
,
param
:
{
param
:
{
...
@@ -2450,6 +2450,10 @@ export class NetManager extends ABNetManager {
...
@@ -2450,6 +2450,10 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 获得用户信息
* @param callback
*/
public
getProjectUserInfo
(
callback
:
Function
)
{
public
getProjectUserInfo
(
callback
:
Function
)
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
GET_PROJECTUSERINFO
,
name
:
NetName
.
GET_PROJECTUSERINFO
,
...
@@ -2462,6 +2466,22 @@ export class NetManager extends ABNetManager {
...
@@ -2462,6 +2466,22 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 获得规则
* @param callback
*/
public
getRule
(
callback
:
Function
)
{
const
net
:
INetData
=
{
name
:
NetName
.
GET_RULE
,
uri
:
'/projectx/{projectId}/projectRule.query'
,
type
:
'get'
,
dataType
:
'json'
,
param
:
{},
callback
:
callback
};
this
.
send
(
net
);
}
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//// 工行欢趣庄园
//// 工行欢趣庄园
...
...
egret/libs/tw/model/common/GameModel.ts
View file @
e4143880
...
@@ -11,7 +11,7 @@ export class GameModel extends ActivityModel {
...
@@ -11,7 +11,7 @@ export class GameModel extends ActivityModel {
if
(
DataManager
.
ins
.
getRuleData
)
{
if
(
DataManager
.
ins
.
getRuleData
)
{
callback
(
true
);
callback
(
true
);
}
else
{
}
else
{
NetManager
.
ins
.
getRule
(
callback
);
NetManager
.
ins
.
getRule
Ng
(
callback
);
}
}
}
}
...
...
egret/src/Main.ts
View file @
e4143880
...
@@ -14,6 +14,7 @@ import { initstatistics } from "./comm/statistics";
...
@@ -14,6 +14,7 @@ import { initstatistics } from "./comm/statistics";
import
{
docEvent
}
from
"./comm/DocumentEvent"
;
import
{
docEvent
}
from
"./comm/DocumentEvent"
;
import
{
Panels
,
Scenes
,
Tops
}
from
"./types/Scenes"
;
import
{
Panels
,
Scenes
,
Tops
}
from
"./types/Scenes"
;
import
Bar
from
"./components/Bar"
;
import
Bar
from
"./components/Bar"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
let
MainStage
:
egret
.
Stage
=
null
;
let
MainStage
:
egret
.
Stage
=
null
;
export
{
MainStage
};
export
{
MainStage
};
...
@@ -90,6 +91,12 @@ class Main extends eui.UILayer {
...
@@ -90,6 +91,12 @@ class Main extends eui.UILayer {
// initstatistics(); // 页面停留时长(接口)
// initstatistics(); // 页面停留时长(接口)
docEvent
();
// document事件(显示,隐藏,重载)
docEvent
();
// document事件(显示,隐藏,重载)
NetManager
.
ins
.
getRule
((
success
,
res
)
=>
{
if
(
!
success
){
return
;
}
});
let
bar
=
new
Bar
();
let
bar
=
new
Bar
();
this
.
addChild
(
bar
);
this
.
addChild
(
bar
);
this
.
getGameRes
().
then
(()
=>
{
this
.
getGameRes
().
then
(()
=>
{
...
...
egret/src/Panels/RulePanel/RulePanel.ts
View file @
e4143880
...
@@ -10,8 +10,6 @@ export default class RulePanel extends Panel {
...
@@ -10,8 +10,6 @@ export default class RulePanel extends Panel {
public
get
skinKey
()
{
public
get
skinKey
()
{
return
'RulePanel'
return
'RulePanel'
}
}
// public get groupName() { return 'prize_panel' }
constructor
(
data
?)
{
constructor
(
data
?)
{
super
(
data
);
super
(
data
);
...
@@ -30,8 +28,7 @@ export default class RulePanel extends Panel {
...
@@ -30,8 +28,7 @@ export default class RulePanel extends Panel {
}
}
private
initUI
():
void
{
private
initUI
():
void
{
// let rule = DataManager.ins.ajaxElementData.rule;
let
rule
=
DataManager
.
ins
.
getData
(
NetName
.
GET_RULE
).
data
||
''
;
let
rule
=
window
[
'rule'
];
this
.
ruleLabel
.
textFlow
=
new
HtmlTextParser
().
parse
(
rule
);
this
.
ruleLabel
.
textFlow
=
new
HtmlTextParser
().
parse
(
rule
);
}
}
}
}
\ No newline at end of file
egret/src/Panels/TaskPanel.ts
View file @
e4143880
...
@@ -109,6 +109,7 @@ class TaskItem extends eui.ItemRenderer {
...
@@ -109,6 +109,7 @@ class TaskItem extends eui.ItemRenderer {
this
.
textFood
.
text
=
'×'
+
this
.
data
.
spFood1RewardNum
;
this
.
textFood
.
text
=
'×'
+
this
.
data
.
spFood1RewardNum
;
this
.
textWater
.
text
=
'×'
+
this
.
data
.
spFood2RewardNum
;
this
.
textWater
.
text
=
'×'
+
this
.
data
.
spFood2RewardNum
;
/// TODO 0奖励隐藏的临时低效方案,待优化
if
(
this
.
data
.
spFood1RewardNum
<=
0
)
{
if
(
this
.
data
.
spFood1RewardNum
<=
0
)
{
this
.
foodGroup
.
visible
=
false
;
this
.
foodGroup
.
visible
=
false
;
this
.
waterGroup
.
x
=
this
.
foodGroup
.
x
;
this
.
waterGroup
.
x
=
this
.
foodGroup
.
x
;
...
@@ -120,8 +121,6 @@ class TaskItem extends eui.ItemRenderer {
...
@@ -120,8 +121,6 @@ class TaskItem extends eui.ItemRenderer {
}
}
private
setBtn
()
{
private
setBtn
()
{
/// TODO 根据需要设置btn监听事件
this
.
btn_label
.
text
=
(
this
.
data
.
status
==
0
)
?
taskUi
[
this
.
data
.
id
].
btnLabel
:
'已领取'
;
this
.
btn_label
.
text
=
(
this
.
data
.
status
==
0
)
?
taskUi
[
this
.
data
.
id
].
btnLabel
:
'已领取'
;
this
.
btn_label
.
textColor
=
(
this
.
data
.
status
==
0
)
?
0xffffff
:
0x9a9a9a
;
this
.
btn_label
.
textColor
=
(
this
.
data
.
status
==
0
)
?
0xffffff
:
0x9a9a9a
;
this
.
btn_bg
.
visible
=
(
this
.
data
.
status
==
0
);
this
.
btn_bg
.
visible
=
(
this
.
data
.
status
==
0
);
...
...
egret/src/Panels/WareHousePanel.ts
View file @
e4143880
...
@@ -105,13 +105,27 @@ export default class WareHousePanel extends Panel {
...
@@ -105,13 +105,27 @@ export default class WareHousePanel extends Panel {
}
}
private
getWareHouseInfo
()
{
private
getWareHouseInfo
()
{
/// TODO 调用接口根据返回数据设置添加显示列表
NetManager
.
ins
.
queryUserSpList
((
success
,
res
)
=>
{
NetManager
.
ins
.
queryUserSpList
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
console
.
log
(
res
);
const
data
=
res
.
data
;
const
data
=
res
.
data
;
/// TODO 0库存隐藏的临时低效方案,待优化
if
(
data
.
sp_1
<=
0
&&
data
.
sp_2
<=
0
)
{
this
.
cropGroup
.
visible
=
false
;
this
.
noneImg
.
visible
=
true
;
}
else
{
this
.
noneImg
.
visible
=
false
;
if
(
data
.
sp_1
<=
0
)
{
this
[
`
${
spData
.
sp_1
.
name
}
_group`
].
visible
=
false
;
this
[
`
${
spData
.
sp_2
.
name
}
_group`
].
x
=
this
[
`
${
spData
.
sp_1
.
name
}
_group`
].
x
;
}
if
(
data
.
sp_2
<=
0
)
{
this
[
`
${
spData
.
sp_2
.
name
}
_group`
].
visible
=
false
;
}
}
for
(
let
k
in
spData
)
{
for
(
let
k
in
spData
)
{
this
[
`
${
spData
[
k
].
name
}
_label`
].
text
=
`数量:
${
data
[
k
]}
`
;
this
[
`
${
spData
[
k
].
name
}
_label`
].
text
=
`数量:
${
data
[
k
]}
`
;
this
[
`
${
spData
[
k
].
name
}
_sell_btn`
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
[
`
${
spData
[
k
].
name
}
_sell_btn`
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
...
...
egret/src/Scenes/IndexScene/IndexUI.ts
View file @
e4143880
...
@@ -45,8 +45,8 @@ export default class IndexUI extends ComponentBase {
...
@@ -45,8 +45,8 @@ export default class IndexUI extends ComponentBase {
[
this
.
warehouseBtn
,
this
.
onTap
,
this
],
[
this
.
warehouseBtn
,
this
.
onTap
,
this
],
]).
concat
([
// OptionPanel
]).
concat
([
// OptionPanel
[
this
.
foodGroup
,
this
.
onTapOption
,
this
],
[
this
.
foodGroup
,
this
.
onTapOption
,
this
],
[
this
[
'waterGroup'
]
,
this
.
onTapOption
,
this
],
[
this
.
waterGroup
,
this
.
onTapOption
,
this
],
[
this
[
'speedGroup'
]
,
this
.
onTapOption
,
this
],
[
this
.
speedGroup
,
this
.
onTapOption
,
this
],
])
])
}
}
...
@@ -55,10 +55,10 @@ export default class IndexUI extends ComponentBase {
...
@@ -55,10 +55,10 @@ export default class IndexUI extends ComponentBase {
case
this
.
foodGroup
:
case
this
.
foodGroup
:
showToast
(
'点击饿了的动物才能进行喂食哦'
);
showToast
(
'点击饿了的动物才能进行喂食哦'
);
break
;
break
;
case
this
[
'waterGroup'
]
:
case
this
.
waterGroup
:
showToast
(
'点击渴了的植物才能浇水哦'
);
showToast
(
'点击渴了的植物才能浇水哦'
);
break
;
break
;
case
this
[
'speedGroup'
]
:
case
this
.
speedGroup
:
break
;
break
;
default
:
default
:
...
@@ -147,16 +147,16 @@ export default class IndexUI extends ComponentBase {
...
@@ -147,16 +147,16 @@ export default class IndexUI extends ComponentBase {
return
;
return
;
}
}
const
data
=
res
.
data
;
const
data
=
res
.
data
;
this
.
userGold
.
text
=
`
${
data
.
unitName
}
:
${
data
.
credits
}
`
;
this
.
userGold
.
text
=
`
${
data
.
unitName
}
:
${
data
.
c
onsumerC
redits
}
`
;
this
.
userName
.
text
=
'欢趣使者'
;
})
})
}
}
destroy
()
{
destroy
()
{
super
.
destroy
();
super
.
destroy
();
IndexDispatcher
.
removeEvent
(
'warehouseEffect'
,
this
.
warehouseEffect
,
this
);
IndexDispatcher
.
removeEvent
(
'warehouseEffect'
,
this
.
warehouseEffect
,
this
);
IndexDispatcher
.
removeEvent
(
'getPropInfo'
,
this
.
getPropInfo
,
this
)
IndexDispatcher
.
removeEvent
(
'getPropInfo'
,
this
.
getPropInfo
,
this
)
;
IndexDispatcher
.
removeEvent
(
'addGold'
,
this
.
addGold
,
this
);
;
IndexDispatcher
.
removeEvent
(
'addGold'
,
this
.
addGold
,
this
);
}
}
get
skinKey
()
{
get
skinKey
()
{
...
...
egret/src/Scenes/IndexScene/LandMgr.ts
View file @
e4143880
...
@@ -5,10 +5,24 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
...
@@ -5,10 +5,24 @@ import { GDispatcher } from "../../../libs/tc/util/GDispatcher";
import
{
loadSvga
}
from
"../../comm/loadSvga"
;
import
{
loadSvga
}
from
"../../comm/loadSvga"
;
import
{
getSvga
}
from
"../../utils"
;
import
{
getSvga
}
from
"../../utils"
;
/**
* 示意图
* ////////////
* /////1 1//// ////////////
* /////1 1//// /////2 2////
* //////////// /////2 2////
* ////////////
* ////////////
* /////3 3//// ////////////
* /////3 3//// /////4 4////
* //////////// /////4 4////
* ////////////
*/
const
landPos
=
[
// 地块位置(注意顺序,影响层级)
const
landPos
=
[
// 地块位置(注意顺序,影响层级)
{
x
:
1
80
,
y
:
674
},
{
x
:
1
70
,
y
:
669
},
{
x
:
396
,
y
:
778
},
{
x
:
396
,
y
:
778
},
{
x
:
4
8
,
y
:
856
},
{
x
:
4
3
,
y
:
851
},
{
x
:
288
,
y
:
972
},
{
x
:
288
,
y
:
972
},
];
];
...
@@ -64,7 +78,7 @@ export default class LandMgr {
...
@@ -64,7 +78,7 @@ export default class LandMgr {
loadSvga
(
getSvga
(
'流水动效'
)).
then
(
loadSvga
(
getSvga
(
'流水动效'
)).
then
(
(
mv
:
egret
.
MovieClip
)
=>
{
(
mv
:
egret
.
MovieClip
)
=>
{
mv
.
x
=
550
;
mv
.
x
=
550
;
mv
.
y
=
8
50
;
mv
.
y
=
8
65
;
mv
.
touchEnabled
=
false
;
mv
.
touchEnabled
=
false
;
IndexIns
().
gameLayer
.
addChildAt
(
mv
,
3
);
IndexIns
().
gameLayer
.
addChildAt
(
mv
,
3
);
}
}
...
...
egret/src/Scenes/IndexScene/Objs/Crop.ts
View file @
e4143880
...
@@ -72,6 +72,7 @@ export default class Crop extends eui.Component {
...
@@ -72,6 +72,7 @@ export default class Crop extends eui.Component {
}
}
private
reset
()
{
private
reset
()
{
this
.
progressBar
&&
egret
.
Tween
.
removeTweens
(
this
.
progressBar
);
IndexIns
().
progressMgr
.
removeProgress
(
this
.
data
.
index
);
IndexIns
().
progressMgr
.
removeProgress
(
this
.
data
.
index
);
this
.
progressBar
=
null
;
this
.
progressBar
=
null
;
}
}
...
@@ -143,6 +144,7 @@ export default class Crop extends eui.Component {
...
@@ -143,6 +144,7 @@ export default class Crop extends eui.Component {
case
OPTION
.
PROGRESS
:
case
OPTION
.
PROGRESS
:
this
.
touchEnabled
=
true
;
this
.
touchEnabled
=
true
;
this
.
addProgress
(
this
.
data
.
data
.
feedLeftSeconds
);
this
.
addProgress
(
this
.
data
.
data
.
feedLeftSeconds
);
egret
.
Tween
.
removeTweens
(
this
.
progressBar
);
egret
.
Tween
.
get
(
this
.
progressBar
).
wait
(
2000
).
to
({
alpha
:
0
},
200
,
egret
.
Ease
.
quartInOut
);
egret
.
Tween
.
get
(
this
.
progressBar
).
wait
(
2000
).
to
({
alpha
:
0
},
200
,
egret
.
Ease
.
quartInOut
);
break
;
break
;
case
OPTION
.
NONE
:
case
OPTION
.
NONE
:
...
@@ -243,10 +245,12 @@ export default class Crop extends eui.Component {
...
@@ -243,10 +245,12 @@ export default class Crop extends eui.Component {
}
}
break
;
break
;
case
OPTION
.
PROGRESS
:
case
OPTION
.
PROGRESS
:
egret
.
Tween
.
removeTweens
(
this
.
progressBar
);
this
.
progressBar
&&
(
function
()
{
egret
.
Tween
.
get
(
this
.
progressBar
).
to
({
alpha
:
1
},
200
,
egret
.
Ease
.
quartInOut
).
call
(()
=>
{
egret
.
Tween
.
removeTweens
(
this
.
progressBar
);
egret
.
Tween
.
get
(
this
.
progressBar
).
wait
(
2000
).
to
({
alpha
:
0
},
200
,
egret
.
Ease
.
quartInOut
);
egret
.
Tween
.
get
(
this
.
progressBar
).
to
({
alpha
:
1
},
200
,
egret
.
Ease
.
quartInOut
).
call
(()
=>
{
});
egret
.
Tween
.
get
(
this
.
progressBar
).
wait
(
2000
).
to
({
alpha
:
0
},
200
,
egret
.
Ease
.
quartInOut
);
})
}.
bind
(
this
)());
break
;
break
;
}
}
}
}
...
@@ -326,6 +330,7 @@ export default class Crop extends eui.Component {
...
@@ -326,6 +330,7 @@ export default class Crop extends eui.Component {
}
}
private
addProgress
(
nTime
)
{
private
addProgress
(
nTime
)
{
// this.progressBar &&
this
.
progressBar
=
IndexIns
().
progressMgr
.
addProgress
({
this
.
progressBar
=
IndexIns
().
progressMgr
.
addProgress
({
index
:
this
.
data
.
index
,
index
:
this
.
data
.
index
,
x
:
this
.
data
.
x
+
88
,
x
:
this
.
data
.
x
+
88
,
...
...
egret/src/ctrls/net/getRule.ts
View file @
e4143880
...
@@ -13,7 +13,7 @@ export default
...
@@ -13,7 +13,7 @@ export default
if
(
DataManager
.
ins
.
getRuleData
)
{
if
(
DataManager
.
ins
.
getRuleData
)
{
_callback
(
true
);
_callback
(
true
);
}
else
{
}
else
{
NetManager
.
ins
.
getRule
(
_callback
);
NetManager
.
ins
.
getRule
Ng
(
_callback
);
}
}
})
})
mock/config.js
View file @
e4143880
...
@@ -31,7 +31,7 @@ const config = {
...
@@ -31,7 +31,7 @@ const config = {
data
:
'./json/getOptions.json'
data
:
'./json/getOptions.json'
},
},
'/ngapi/getRule'
:
{
'/ngapi/getRule'
:
{
data
:
'./json/getRule.json'
data
:
'./json/getRule
Ng
.json'
},
},
'/activityVist/addTimesForActivity'
:
{
'/activityVist/addTimesForActivity'
:
{
data
:
'./json/addTimesForActivity.json'
data
:
'./json/addTimesForActivity.json'
...
@@ -269,18 +269,19 @@ const config = {
...
@@ -269,18 +269,19 @@ const config = {
'/hdtool/rank/rankInfo'
:
{
'/hdtool/rank/rankInfo'
:
{
data
:
'./json/rankInfo.json'
data
:
'./json/rankInfo.json'
},
},
'/projectx/{projectId}/getUserSpList.query'
:
{
// 任务信息
'/projectx/{projectId}/getUserSpList.query'
:
{
// 任务信息
data
:
'./projectX/getUserSpList.json'
data
:
'./projectX/getUserSpList.json'
},
},
'/projectx/{projectId}/prize.query'
:
{
'/projectx/{projectId}/prize.query'
:
{
data
:
'./projectX/queryPrizeInfo.json'
data
:
'./projectX/queryPrizeInfo.json'
},
},
'/ctool/getProjectUserInfo'
:{
'/ctool/getProjectUserInfo'
:
{
data
:
'./projectX/getProjectUserInfo.json'
data
:
'./projectX/getProjectUserInfo.json'
},
'/projectx/{projectId}/projectRule.query'
:
{
// 查询游戏规则
data
:
'./projectX/getRule.json'
},
},
// '/projectx/{projectId}/join_1/landInfo.do': { // 土地信息
// data: './joyousManor/getLandInfo.json'
// },
// 欢趣庄园
// 欢趣庄园
'/projectx/{projectId}/join_1/landInfo.do'
:
{
// 土地信息
'/projectx/{projectId}/join_1/landInfo.do'
:
{
// 土地信息
...
@@ -307,8 +308,8 @@ const config = {
...
@@ -307,8 +308,8 @@ const config = {
'/projectx/{projectId}/join_5/taskInfo.do'
:
{
// 任务信息
'/projectx/{projectId}/join_5/taskInfo.do'
:
{
// 任务信息
data
:
'./joyousManor/taskInfo.json'
data
:
'./joyousManor/taskInfo.json'
},
},
'/projectx/{projectId}/join_4/priceInfo.do'
:{
'/projectx/{projectId}/join_4/priceInfo.do'
:
{
data
:
'./joyousManor/priceInfo.json'
data
:
'./joyousManor/priceInfo.json'
},
},
};
};
...
@@ -323,9 +324,8 @@ let strategyId = '';
...
@@ -323,9 +324,8 @@ let strategyId = '';
for
(
let
item
in
config
)
{
for
(
let
item
in
config
)
{
if
(
config
.
hasOwnProperty
(
item
))
{
if
(
config
.
hasOwnProperty
(
item
))
{
if
(
item
.
indexOf
(
"{projectId}"
)
!==
-
1
||
item
.
indexOf
(
"{strategyId}"
)
!==
-
1
)
{
if
(
item
.
indexOf
(
"{projectId}"
)
!==
-
1
)
{
let
newKey
=
item
.
replace
(
"{projectId}"
,
projectId
);
let
newKey
=
item
.
replace
(
"{projectId}"
,
projectId
);
newKey
=
newKey
.
replace
(
"{strategyId}"
,
strategyId
);
config
[
newKey
]
=
config
[
item
];
config
[
newKey
]
=
config
[
item
];
delete
config
[
item
];
delete
config
[
item
];
item
=
newKey
;
item
=
newKey
;
...
...
mock/projectX/getRule.json
0 → 100644
View file @
e4143880
{
"success"
:
true
,
"message"
:
"OK"
,
"data"
:
"规则规则规则"
}
\ No newline at end of file
mock/projectX/getUserSpList.json
View file @
e4143880
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
"message"
:
null
,
"message"
:
null
,
"code"
:
null
,
"code"
:
null
,
"data"
:
{
"data"
:
{
"sp_1"
:
1
,
"sp_1"
:
0
,
"sp_2"
:
10
0
,
"sp_2"
:
0
,
"sp_food_1"
:
1
,
"sp_food_1"
:
1
00
,
"sp_food_2"
:
1
,
"sp_food_2"
:
1
00
,
"sp_task_1"
:
10
,
"sp_task_1"
:
10
,
"sp_task_2"
:
100
"sp_task_2"
:
100
}
}
...
...
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