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
5ef21c09
Commit
5ef21c09
authored
Oct 26, 2020
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
730dd9a3
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
504 additions
and
257 deletions
+504
-257
workspace.xml
.idea/workspace.xml
+55
-44
index.html
egret/index.html
+12
-0
NetName.ts
egret/libs/tw/enum/NetName.ts
+2
-1
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+54
-41
default.res.json
egret/resource/default.res.json
+44
-4
MainUISkin.exml
egret/resource/skins/MainUISkin.exml
+3
-3
ShopItemSkin.exml
egret/resource/skins/ShopItemSkin.exml
+8
-0
WareHouseSkin.exml
egret/resource/skins/WareHouseSkin.exml
+15
-3
NewUserPanel.ts
egret/src/Panels/NewUserPanel.ts
+20
-0
SellRecord.ts
egret/src/Panels/SellRecord.ts
+2
-7
TaskPanel.ts
egret/src/Panels/TaskPanel.ts
+13
-1
WareHousePanel.ts
egret/src/Panels/WareHousePanel.ts
+36
-25
Home.ts
egret/src/Scenes/Home.ts
+2
-0
Const.ts
egret/src/Scenes/MainScene/Const.ts
+60
-0
MainScene.ts
egret/src/Scenes/MainScene/MainScene.ts
+0
-4
MainUI.ts
egret/src/Scenes/MainScene/MainUI.ts
+22
-10
Land.ts
egret/src/Scenes/MainScene/Objs/Land.ts
+24
-10
ShopScene.ts
egret/src/Scenes/ShopScene/ShopScene.ts
+62
-62
config.js
mock/config.js
+4
-1
consumerInfo.json
mock/joyousManor/consumerInfo.json
+4
-2
getLandInfo.json
mock/joyousManor/getLandInfo.json
+8
-8
join_9.json
mock/joyousManor/join_9.json
+6
-0
priceInfo.json
mock/joyousManor/priceInfo.json
+4
-2
prizeInfo.json
mock/joyousManor/prizeInfo.json
+4
-2
propInfo.json
mock/joyousManor/propInfo.json
+11
-1
saleInfo.json
mock/joyousManor/saleInfo.json
+3
-3
taskInfo.json
mock/joyousManor/taskInfo.json
+17
-1
getUserSpList.json
mock/projectX/getUserSpList.json
+3
-1
mergeQuery.json
mock/projectX/mergeQuery.json
+6
-21
No files found.
.idea/workspace.xml
View file @
5ef21c09
This diff is collapsed.
Click to expand it.
egret/index.html
View file @
5ef21c09
...
@@ -75,6 +75,18 @@
...
@@ -75,6 +75,18 @@
label
:
'访问欢趣市集'
,
label
:
'访问欢趣市集'
,
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
},
},
5
:
{
icon
:
'浏览积分商城任务_png'
,
btnLabel
:
'去浏览'
,
label
:
'浏览积分商城'
,
link
:
'TODO 要填写'
// TODO 要填写
},
6
:
{
icon
:
'消费任务_png'
,
btnLabel
:
'去消费'
,
label
:
'去指定场景消费'
,
link
:
'TODO 要填写'
// TODO 要填写
},
};
};
window
[
'record'
]
=
'http://activity.m.duibadev.com.cn/projectx/pd4c18436/f67522bea.html'
;
window
[
'record'
]
=
'http://activity.m.duibadev.com.cn/projectx/pd4c18436/f67522bea.html'
;
window
[
'rule'
]
=
"活动时间:
\n
"
+
window
[
'rule'
]
=
"活动时间:
\n
"
+
...
...
egret/libs/tw/enum/NetName.ts
View file @
5ef21c09
...
@@ -146,5 +146,6 @@ export enum NetName {
...
@@ -146,5 +146,6 @@ export enum NetName {
PROP_EXCHANGE
,
PROP_EXCHANGE
,
PROPINFO
,
PROPINFO
,
USER_PROP
,
USER_PROP
,
NEW_USER_PRIZE
,
}
}
\ No newline at end of file
egret/libs/tw/manager/NetManager.ts
View file @
5ef21c09
...
@@ -13,7 +13,7 @@ export class NetManager extends ABNetManager {
...
@@ -13,7 +13,7 @@ export class NetManager extends ABNetManager {
private
static
instance
:
NetManager
;
private
static
instance
:
NetManager
;
public
static
get
ins
():
NetManager
{
public
static
get
ins
():
NetManager
{
if
(
!
this
.
instance
)
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
NetManager
();
this
.
instance
=
new
NetManager
();
}
}
return
this
.
instance
;
return
this
.
instance
;
...
@@ -23,7 +23,7 @@ export class NetManager extends ABNetManager {
...
@@ -23,7 +23,7 @@ export class NetManager extends ABNetManager {
constructor
()
{
constructor
()
{
super
();
super
();
if
(
this
.
isInit
)
{
if
(
this
.
isInit
)
{
throw
Error
(
TwLang
.
lang_001
);
throw
Error
(
TwLang
.
lang_001
);
}
}
this
.
isInit
=
true
;
this
.
isInit
=
true
;
...
@@ -97,7 +97,7 @@ export class NetManager extends ABNetManager {
...
@@ -97,7 +97,7 @@ export class NetManager extends ABNetManager {
*/
*/
public
addTimesForActivity
(
callback
:
Function
,
type
:
number
,
count
:
number
,
validType
:
number
):
void
{
public
addTimesForActivity
(
callback
:
Function
,
type
:
number
,
count
:
number
,
validType
:
number
):
void
{
let
activityId
:
number
;
let
activityId
:
number
;
if
(
type
==
1
)
{
if
(
type
==
1
)
{
activityId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
activityId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
}
else
{
}
else
{
activityId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
activityId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
...
@@ -108,7 +108,7 @@ export class NetManager extends ABNetManager {
...
@@ -108,7 +108,7 @@ export class NetManager extends ABNetManager {
activityType
:
"hdtool"
,
activityType
:
"hdtool"
,
activityId
:
activityId
activityId
:
activityId
};
};
if
(
validType
)
{
if
(
validType
)
{
param
.
validType
=
validType
;
param
.
validType
=
validType
;
}
}
...
@@ -172,12 +172,12 @@ export class NetManager extends ABNetManager {
...
@@ -172,12 +172,12 @@ export class NetManager extends ABNetManager {
public
openCollectGoodsPrize
(
callback
:
Function
,
collectRuleId
:
number
,
type
?:
number
):
void
{
public
openCollectGoodsPrize
(
callback
:
Function
,
collectRuleId
:
number
,
type
?:
number
):
void
{
let
actId
:
number
;
let
actId
:
number
;
let
param
:
any
;
let
param
:
any
;
if
(
type
==
1
)
{
if
(
type
==
1
)
{
actId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
actId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
actId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
actId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
}
}
if
(
type
)
{
if
(
type
)
{
param
=
{
collectRuleId
:
collectRuleId
,
actId
:
actId
}
param
=
{
collectRuleId
:
collectRuleId
,
actId
:
actId
}
}
else
{
}
else
{
param
=
{
collectRuleId
:
collectRuleId
};
param
=
{
collectRuleId
:
collectRuleId
};
...
@@ -279,7 +279,7 @@ export class NetManager extends ABNetManager {
...
@@ -279,7 +279,7 @@ export class NetManager extends ABNetManager {
public
doStart
(
callback
:
Function
,
isAgain
:
boolean
,
credits
?:
number
,
customizedType
?:
number
):
void
{
public
doStart
(
callback
:
Function
,
isAgain
:
boolean
,
credits
?:
number
,
customizedType
?:
number
):
void
{
let
addUrl
=
''
;
let
addUrl
=
''
;
if
(
isAgain
)
{
if
(
isAgain
)
{
addUrl
+=
'?dpm='
+
DataManager
.
ins
.
gameGetSubmitResultData
.
againExposure
.
dpm
;
addUrl
+=
'?dpm='
+
DataManager
.
ins
.
gameGetSubmitResultData
.
againExposure
.
dpm
;
}
}
...
@@ -288,11 +288,11 @@ export class NetManager extends ABNetManager {
...
@@ -288,11 +288,11 @@ export class NetManager extends ABNetManager {
oaId
:
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
oaId
:
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
};
};
if
(
credits
)
{
if
(
credits
)
{
param
.
credits
=
credits
;
param
.
credits
=
credits
;
}
}
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
;
param
.
customizedType
=
customizedType
;
}
}
...
@@ -320,7 +320,7 @@ export class NetManager extends ABNetManager {
...
@@ -320,7 +320,7 @@ export class NetManager extends ABNetManager {
const
param
:
any
=
{
const
param
:
any
=
{
orderId
:
orderId
orderId
:
orderId
};
};
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
param
.
customizedType
=
customizedType
}
}
...
@@ -469,10 +469,10 @@ export class NetManager extends ABNetManager {
...
@@ -469,10 +469,10 @@ export class NetManager extends ABNetManager {
sgin
:
sign
,
sgin
:
sign
,
dynamicData
:
dynamicData
dynamicData
:
dynamicData
};
};
if
(
checkScore
)
{
if
(
checkScore
)
{
param
.
checkScore
=
checkScore
;
param
.
checkScore
=
checkScore
;
}
}
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
;
param
.
customizedType
=
customizedType
;
}
}
...
@@ -800,7 +800,7 @@ export class NetManager extends ABNetManager {
...
@@ -800,7 +800,7 @@ export class NetManager extends ABNetManager {
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
oaId
:
DataManager
.
ins
.
customCfgData
.
oaId
oaId
:
DataManager
.
ins
.
customCfgData
.
oaId
};
};
if
(
collectRuleId
)
{
if
(
collectRuleId
)
{
param
.
collectRuleId
=
collectRuleId
;
param
.
collectRuleId
=
collectRuleId
;
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
...
@@ -1008,7 +1008,7 @@ export class NetManager extends ABNetManager {
...
@@ -1008,7 +1008,7 @@ export class NetManager extends ABNetManager {
*/
*/
public
doSign
(
callback
:
Function
,
signActivityId
:
number
,
activityId
?:
number
):
void
{
public
doSign
(
callback
:
Function
,
signActivityId
:
number
,
activityId
?:
number
):
void
{
var
data
:
any
;
var
data
:
any
;
if
(
activityId
)
{
if
(
activityId
)
{
data
=
{
data
=
{
id
:
signActivityId
,
id
:
signActivityId
,
activityId
:
activityId
activityId
:
activityId
...
@@ -1268,7 +1268,7 @@ export class NetManager extends ABNetManager {
...
@@ -1268,7 +1268,7 @@ export class NetManager extends ABNetManager {
*/
*/
public
toyExchanges
(
callback
:
Function
,
toyId
:
number
,
count
?:
number
):
void
{
public
toyExchanges
(
callback
:
Function
,
toyId
:
number
,
count
?:
number
):
void
{
let
param
:
any
=
{};
let
param
:
any
=
{};
if
(
count
)
{
if
(
count
)
{
param
=
{
param
=
{
toyId
:
toyId
,
toyId
:
toyId
,
count
:
count
count
:
count
...
@@ -1460,7 +1460,7 @@ export class NetManager extends ABNetManager {
...
@@ -1460,7 +1460,7 @@ export class NetManager extends ABNetManager {
// /**
// /**
// * 收入明细
// * 收入明细
// * @param callback
// * @param callback
// * @param activityId 活动ID
// * @param activityId 活动ID
// */
// */
// public getProfitDetail(callback: Function, activityId: number): void {
// public getProfitDetail(callback: Function, activityId: number): void {
...
@@ -1580,7 +1580,7 @@ export class NetManager extends ABNetManager {
...
@@ -1580,7 +1580,7 @@ export class NetManager extends ABNetManager {
public
getIndex
(
callback
:
Function
,
activityId
,
refreshReading
,
shareCode
?)
{
public
getIndex
(
callback
:
Function
,
activityId
,
refreshReading
,
shareCode
?)
{
let
param
;
let
param
;
if
(
shareCode
)
{
if
(
shareCode
)
{
param
=
{
param
=
{
activityId
:
activityId
,
activityId
:
activityId
,
refreshReading
:
refreshReading
,
refreshReading
:
refreshReading
,
...
@@ -2105,12 +2105,12 @@ export class NetManager extends ABNetManager {
...
@@ -2105,12 +2105,12 @@ export class NetManager extends ABNetManager {
};
};
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
realUrl
:
string
=
net
.
uri
;
let
realUrl
:
string
=
net
.
uri
;
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
gTime
=
'&_='
+
GTime
.
getTimestamp
();
gTime
=
'&_='
+
GTime
.
getTimestamp
();
}
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if
(
net
.
addUrl
)
{
if
(
net
.
addUrl
)
{
realUrl
+=
net
.
addUrl
;
realUrl
+=
net
.
addUrl
;
}
}
...
@@ -2141,7 +2141,7 @@ export class NetManager extends ABNetManager {
...
@@ -2141,7 +2141,7 @@ export class NetManager extends ABNetManager {
* @param net
* @param net
*/
*/
public
getToken
(
net
:
INetData
):
void
{
public
getToken
(
net
:
INetData
):
void
{
if
(
window
[
'getDuibaToken'
])
{
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
net
.
param
.
token
=
tokenObj
.
token
;
net
.
param
.
token
=
tokenObj
.
token
;
this
.
send
(
net
);
this
.
send
(
net
);
...
@@ -2172,12 +2172,12 @@ export class NetManager extends ABNetManager {
...
@@ -2172,12 +2172,12 @@ export class NetManager extends ABNetManager {
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
realUrl
:
string
=
net
.
uri
;
let
realUrl
:
string
=
net
.
uri
;
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
gTime
=
'&_='
+
GTime
.
getTimestamp
();
gTime
=
'&_='
+
GTime
.
getTimestamp
();
}
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if
(
net
.
addUrl
)
{
if
(
net
.
addUrl
)
{
realUrl
+=
net
.
addUrl
;
realUrl
+=
net
.
addUrl
;
}
}
...
@@ -2280,26 +2280,26 @@ export class NetManager extends ABNetManager {
...
@@ -2280,26 +2280,26 @@ export class NetManager extends ABNetManager {
protected
onResponse
(
net
:
INetData
,
result
:
any
):
void
{
protected
onResponse
(
net
:
INetData
,
result
:
any
):
void
{
//数据处理
//数据处理
const
data
:
Data
=
DataManager
.
ins
.
updateData
(
net
.
name
,
result
,
net
.
param
);
const
data
:
Data
=
DataManager
.
ins
.
updateData
(
net
.
name
,
result
,
net
.
param
);
if
(
net
.
pollingCheck
)
{
if
(
net
.
pollingCheck
)
{
console
.
log
(
'result====='
,
result
);
console
.
log
(
'result====='
,
result
);
console
.
log
(
'data====='
,
data
);
console
.
log
(
'data====='
,
data
);
}
}
//接口成功
//接口成功
if
(
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
if
(
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
net
.
pollingCount
-=
1
;
net
.
pollingCount
-=
1
;
//轮询接口特殊处理
//轮询接口特殊处理
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
send
(
net
);
this
.
send
(
net
);
},
500
);
},
500
);
}
else
if
(
net
.
callback
)
{
}
else
if
(
net
.
callback
)
{
if
(
net
.
pollingCheck
&&
!
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
if
(
net
.
pollingCheck
&&
!
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
net
.
callback
(
false
,
'pollingFaild'
);
net
.
callback
(
false
,
'pollingFaild'
);
}
else
{
}
else
{
net
.
callback
(
data
.
success
,
data
||
result
);
net
.
callback
(
data
.
success
,
data
||
result
);
}
}
}
}
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
,
result
.
message
||
result
.
desc
||
result
.
msg
,
result
);
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
,
result
.
message
||
result
.
desc
||
result
.
msg
,
result
);
onNotSuccess
(
data
,
net
.
name
);
onNotSuccess
(
data
,
net
.
name
);
}
}
...
@@ -2310,11 +2310,11 @@ export class NetManager extends ABNetManager {
...
@@ -2310,11 +2310,11 @@ export class NetManager extends ABNetManager {
* @param net
* @param net
*/
*/
protected
onError
(
net
:
INetData
):
void
{
protected
onError
(
net
:
INetData
):
void
{
if
(
net
.
callback
)
{
if
(
net
.
callback
)
{
net
.
callback
(
false
);
net
.
callback
(
false
);
}
}
if
(
!
net
.
hideMsg
)
{
if
(
!
net
.
hideMsg
)
{
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
);
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
);
onNotSuccess
();
onNotSuccess
();
}
}
...
@@ -2680,14 +2680,27 @@ export class NetManager extends ABNetManager {
...
@@ -2680,14 +2680,27 @@ export class NetManager extends ABNetManager {
public
getConsumerInfo
(
callback
:
Function
)
{
public
getConsumerInfo
(
callback
:
Function
)
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
Get_CONSUMERINFO
,
name
:
NetName
.
Get_CONSUMERINFO
,
uri
:
'/projectx/{projectId}/join_1/consumerInfo.do'
,
uri
:
'/projectx/{projectId}/join_1/consumerInfo.do'
,
type
:
'get'
,
type
:
'get'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{},
param
:
{},
callback
:
callback
callback
:
callback
}
}
;
this
.
send
(
net
);
}
public
newUserPrize
(
callback
:
Function
,
token
)
{
const
net
:
INetData
=
{
name
:
NetName
.
NEW_USER_PRIZE
,
uri
:
'/projectx/{projectId}/join_9/join.do'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
{
token
:
token
,
},
callback
:
callback
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
...
@@ -2723,7 +2736,7 @@ export class NetManager extends ABNetManager {
...
@@ -2723,7 +2736,7 @@ export class NetManager extends ABNetManager {
uri
:
'/projectx/{projectId}/join_6/join.do'
,
uri
:
'/projectx/{projectId}/join_6/join.do'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
hideMsg
:
true
,
hideMsg
:
true
,
param
:
{
param
:
{
strategyId
:
strategyId
strategyId
:
strategyId
},
},
...
@@ -2752,7 +2765,7 @@ export class NetManager extends ABNetManager {
...
@@ -2752,7 +2765,7 @@ export class NetManager extends ABNetManager {
uri
:
'/projectx/{projectId}/join_7/join.do'
,
uri
:
'/projectx/{projectId}/join_7/join.do'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
hideMsg
:
true
,
hideMsg
:
true
,
param
:
{
param
:
{
spId
:
spId
,
spId
:
spId
,
ticket
:
ticket
ticket
:
ticket
...
@@ -2795,4 +2808,4 @@ export class NetManager extends ABNetManager {
...
@@ -2795,4 +2808,4 @@ export class NetManager extends ABNetManager {
var
regular
=
"(
\\
S+)//(
\\
S+)/(
\\
S+)/(
\\
S+)/(
\\
S+)"
;
var
regular
=
"(
\\
S+)//(
\\
S+)/(
\\
S+)/(
\\
S+)/(
\\
S+)"
;
var
re
=
new
RegExp
(
regular
,
"g"
);
var
re
=
new
RegExp
(
regular
,
"g"
);
window
[
'projectId'
]
=
window
.
location
.
href
.
replace
(
re
,
"$4"
);
window
[
'projectId'
]
=
window
.
location
.
href
.
replace
(
re
,
"$4"
);
console
.
log
(
window
[
'projectId'
]);
console
.
log
(
window
[
'projectId'
]);
\ No newline at end of file
egret/resource/default.res.json
View file @
5ef21c09
...
@@ -25,15 +25,15 @@
...
@@ -25,15 +25,15 @@
"name"
:
"index_plant"
"name"
:
"index_plant"
},
},
{
{
"keys"
:
"task_bg_png,task_item_bg_png,饲料 拷贝_png,task_brn_bg_png,task_toast_png,签到 icon_png,消费 icon_png,生活日 icon_png,分享 icon_png,浇水2_png"
,
"keys"
:
"task_bg_png,task_item_bg_png,饲料 拷贝_png,task_brn_bg_png,task_toast_png,签到 icon_png,消费 icon_png,生活日 icon_png,分享 icon_png,浇水2_png
,浏览积分商城任务_png,消费任务_png
"
,
"name"
:
"task_panel"
"name"
:
"task_panel"
},
},
{
{
"keys"
:
"corn_bg_png,egg_bg_png,milk_bg_png,仓库_png,兑换_png,出售_png,出售记录_png,warehouse_none_png,wheat_bg_png"
,
"keys"
:
"corn_bg_png,egg_bg_png,milk_bg_png,仓库_png,兑换_png,出售_png,出售记录_png,warehouse_none_png,wheat_bg_png
,potato_bg_png,walnut_bg_png
"
,
"name"
:
"warehouse"
"name"
:
"warehouse"
},
},
{
{
"keys"
:
"sellTitle_wheat_png,sellTitle_egg_png,sell_btn_en_png,sell_btn_dis_png,sell_bg_png,out_line_png,+_en_png,+_dis_png,-_en_png,-_dis_png,sell_hand_png,sellTitle_milk_png,sellTitle_corn_png"
,
"keys"
:
"sellTitle_wheat_png,sellTitle_egg_png,sell_btn_en_png,sell_btn_dis_png,sell_bg_png,out_line_png,+_en_png,+_dis_png,-_en_png,-_dis_png,sell_hand_png,sellTitle_milk_png,sellTitle_corn_png
,sellTitle_potato_png,sellTitle_walnut_png
"
,
"name"
:
"sell_panel"
"name"
:
"sell_panel"
},
},
{
{
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
"name"
:
"bar"
"name"
:
"bar"
},
},
{
{
"keys"
:
"道具b_png,返回农场_png,货柜_png,商品b_png,shop_bg_png,商品w_png,道具w_png,灯_png,前景_png,shop_buy_png,shop_done_png,shop_food_png,shop_none_png,shop_speed_png,shop_water_png,shop_goods_egg_png,shop_goods_milk_png,shop_goods_wheat_png,shop_goods_corn_png,shop_goods_bg_png"
,
"keys"
:
"道具b_png,返回农场_png,货柜_png,商品b_png,shop_bg_png,商品w_png,道具w_png,灯_png,前景_png,shop_buy_png,shop_done_png,shop_food_png,shop_none_png,shop_speed_png,shop_water_png,shop_goods_egg_png,shop_goods_milk_png,shop_goods_wheat_png,shop_goods_corn_png,shop_goods_bg_png
,shop_goods_potato_png,shop_goods_walnut_png
"
,
"name"
:
"shop"
"name"
:
"shop"
},
},
{
{
...
@@ -864,6 +864,46 @@
...
@@ -864,6 +864,46 @@
"url"
:
"assets/index_scene/planting/option/option_potato.png"
,
"url"
:
"assets/index_scene/planting/option/option_potato.png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"name"
:
"option_potato_png"
"name"
:
"option_potato_png"
},
{
"url"
:
"assets/warehouse_panel/potato_bg.png"
,
"type"
:
"image"
,
"name"
:
"potato_bg_png"
},
{
"url"
:
"assets/warehouse_panel/walnut_bg.png"
,
"type"
:
"image"
,
"name"
:
"walnut_bg_png"
},
{
"url"
:
"assets/warehouse_panel/sell_panel/sellTitle_potato.png"
,
"type"
:
"image"
,
"name"
:
"sellTitle_potato_png"
},
{
"url"
:
"assets/warehouse_panel/sell_panel/sellTitle_walnut.png"
,
"type"
:
"image"
,
"name"
:
"sellTitle_walnut_png"
},
{
"url"
:
"assets/shop/shop_goods_potato.png"
,
"type"
:
"image"
,
"name"
:
"shop_goods_potato_png"
},
{
"url"
:
"assets/shop/shop_goods_walnut.png"
,
"type"
:
"image"
,
"name"
:
"shop_goods_walnut_png"
},
{
"url"
:
"assets/task_panel/浏览积分商城任务.png"
,
"type"
:
"image"
,
"name"
:
"浏览积分商城任务_png"
},
{
"url"
:
"assets/task_panel/消费任务.png"
,
"type"
:
"image"
,
"name"
:
"消费任务_png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/skins/MainUISkin.exml
View file @
5ef21c09
...
@@ -3,15 +3,15 @@
...
@@ -3,15 +3,15 @@
<w:Config
id=
"16e64c53e86"
/>
<w:Config
id=
"16e64c53e86"
/>
<e:Group
id=
"uiLayer"
left=
"0"
right=
"0"
horizontalCenter=
"0"
touchChildren=
"true"
touchEnabled=
"false"
top=
"0"
height=
"1624"
>
<e:Group
id=
"uiLayer"
left=
"0"
right=
"0"
horizontalCenter=
"0"
touchChildren=
"true"
touchEnabled=
"false"
top=
"0"
height=
"1624"
>
<e:Group
id=
"propPanel"
width=
"182"
height=
"198"
right=
"0"
verticalCenter=
"452"
touchChildren=
"true"
touchEnabled=
"false"
>
<e:Group
id=
"propPanel"
width=
"182"
height=
"198"
right=
"0"
verticalCenter=
"452"
touchChildren=
"true"
touchEnabled=
"false"
>
<e:Group
id=
"speedGroup"
x=
"11"
y=
"0"
width=
"171"
height=
"62
"
visible=
"false"
>
<e:Group
id=
"speedGroup"
y=
"0"
width=
"171"
height=
"62"
right=
"0
"
visible=
"false"
>
<e:Image
source=
"加速卡_png"
x=
"0"
y=
"0"
touchEnabled=
"false"
/>
<e:Image
source=
"加速卡_png"
x=
"0"
y=
"0"
touchEnabled=
"false"
/>
<e:Label
id=
"speedNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
right=
"0"
anchorOffsetX=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"4"
touchEnabled=
"false"
/>
<e:Label
id=
"speedNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
right=
"0"
anchorOffsetX=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"4"
touchEnabled=
"false"
/>
</e:Group>
</e:Group>
<e:Group
id=
"foodGroup"
x=
"12"
y=
"71"
width=
"170"
height=
"63"
touchEnabled=
"true"
touchChildren=
"false
"
visible=
"false"
>
<e:Group
id=
"foodGroup"
y=
"71"
width=
"170"
height=
"63"
touchEnabled=
"true"
touchChildren=
"false"
right=
"0
"
visible=
"false"
>
<e:Image
source=
"饲料_png"
x=
"0"
y=
"0"
/>
<e:Image
source=
"饲料_png"
x=
"0"
y=
"0"
/>
<e:Label
id=
"foodNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
right=
"0"
anchorOffsetX=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"3"
/>
<e:Label
id=
"foodNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
right=
"0"
anchorOffsetX=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"3"
/>
</e:Group>
</e:Group>
<e:Group
id=
"waterGroup"
x=
"0"
y=
"144"
touchEnabled=
"true"
touchChildren=
"false
"
visible=
"false"
>
<e:Group
id=
"waterGroup"
y=
"144"
touchEnabled=
"true"
touchChildren=
"false"
right=
"0
"
visible=
"false"
>
<e:Image
source=
"浇水_png"
x=
"0"
y=
"0"
/>
<e:Image
source=
"浇水_png"
x=
"0"
y=
"0"
/>
<e:Label
id=
"waterNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
anchorOffsetX=
"0"
right=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"0"
/>
<e:Label
id=
"waterNum"
text=
"× 0"
size=
"28"
scaleX=
"1"
scaleY=
"1"
anchorOffsetX=
"0"
right=
"0"
width=
"108"
anchorOffsetY=
"0"
height=
"50"
verticalAlign=
"middle"
verticalCenter=
"0"
/>
</e:Group>
</e:Group>
...
...
egret/resource/skins/ShopItemSkin.exml
View file @
5ef21c09
...
@@ -24,6 +24,14 @@
...
@@ -24,6 +24,14 @@
<e:Image
y=
"0"
horizontalCenter=
"0"
source=
"shop_goods_milk_png"
/>
<e:Image
y=
"0"
horizontalCenter=
"0"
source=
"shop_goods_milk_png"
/>
<e:Label
id=
"sp_4_label"
text=
"0/0"
y=
"48.8"
textColor=
"0x855933"
size=
"18"
horizontalCenter=
"0"
/>
<e:Label
id=
"sp_4_label"
text=
"0/0"
y=
"48.8"
textColor=
"0x855933"
size=
"18"
horizontalCenter=
"0"
/>
</e:Group>
</e:Group>
<e:Group
id=
"sp_5_group"
x=
"400"
y=
"64"
width=
"38"
height=
"67"
visible=
"false"
>
<e:Image
y=
"0"
horizontalCenter=
"0"
source=
"shop_goods_potato_png"
/>
<e:Label
id=
"sp_5_label"
text=
"0/0"
y=
"48.8"
textColor=
"0x855933"
size=
"18"
horizontalCenter=
"0"
/>
</e:Group>
<e:Group
id=
"sp_6_group"
x=
"410"
y=
"64"
width=
"38"
height=
"67"
visible=
"false"
>
<e:Image
y=
"0"
horizontalCenter=
"0"
source=
"shop_goods_walnut_png"
/>
<e:Label
id=
"sp_6_label"
text=
"0/0"
y=
"48.8"
textColor=
"0x855933"
size=
"18"
horizontalCenter=
"0"
/>
</e:Group>
<e:Label
id=
"stock_label"
text=
"剩余0份"
x=
"19"
y=
"176"
textColor=
"0xed3330"
size=
"18"
bold=
"true"
locked=
"true"
/>
<e:Label
id=
"stock_label"
text=
"剩余0份"
x=
"19"
y=
"176"
textColor=
"0xed3330"
size=
"18"
bold=
"true"
locked=
"true"
/>
<e:Rect
id=
"mk"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
left=
"0"
top=
"0"
right=
"0"
bottom=
"0"
ellipseWidth=
"22"
ellipseHeight=
"22"
fillColor=
"0x6c3907"
fillAlpha=
"0.6"
visible=
"false"
/>
<e:Rect
id=
"mk"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
left=
"0"
top=
"0"
right=
"0"
bottom=
"0"
ellipseWidth=
"22"
ellipseHeight=
"22"
fillColor=
"0x6c3907"
fillAlpha=
"0.6"
visible=
"false"
/>
</e:Group>
</e:Group>
...
...
egret/resource/skins/WareHouseSkin.exml
View file @
5ef21c09
...
@@ -12,24 +12,36 @@
...
@@ -12,24 +12,36 @@
<e:Label
id=
"egg_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9a9a9a"
/>
<e:Label
id=
"egg_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9a9a9a"
/>
<e:Image
id=
"egg_ex_btn"
source=
"兑换_png"
x=
"164"
y=
"240"
/>
<e:Image
id=
"egg_ex_btn"
source=
"兑换_png"
x=
"164"
y=
"240"
/>
</e:Group>
</e:Group>
<e:Group
id=
"wheat_group"
x=
"
354
"
y=
"0"
scaleX=
"1"
scaleY=
"1"
>
<e:Group
id=
"wheat_group"
x=
"
0
"
y=
"0"
scaleX=
"1"
scaleY=
"1"
>
<e:Image
id=
"wheat_bg"
source=
"wheat_bg_png"
x=
"0"
y=
"0"
/>
<e:Image
id=
"wheat_bg"
source=
"wheat_bg_png"
x=
"0"
y=
"0"
/>
<e:Image
id=
"wheat_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Image
id=
"wheat_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Label
id=
"wheat_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Label
id=
"wheat_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Image
id=
"wheat_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
<e:Image
id=
"wheat_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
</e:Group>
<e:Group
id=
"corn_group"
x=
"0"
y=
"
359
"
scaleX=
"1"
scaleY=
"1"
>
<e:Group
id=
"corn_group"
x=
"0"
y=
"
0
"
scaleX=
"1"
scaleY=
"1"
>
<e:Image
id=
"corn_bg"
x=
"0"
y=
"0"
source=
"corn_bg_png"
/>
<e:Image
id=
"corn_bg"
x=
"0"
y=
"0"
source=
"corn_bg_png"
/>
<e:Image
id=
"corn_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Image
id=
"corn_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Label
id=
"corn_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Label
id=
"corn_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Image
id=
"corn_ex_btn"
source=
"兑换_png"
x=
"164"
y=
"240"
/>
<e:Image
id=
"corn_ex_btn"
source=
"兑换_png"
x=
"164"
y=
"240"
/>
</e:Group>
</e:Group>
<e:Group
id=
"milk_group"
x=
"
354"
y=
"359
"
scaleX=
"1"
scaleY=
"1"
>
<e:Group
id=
"milk_group"
x=
"
0"
y=
"0
"
scaleX=
"1"
scaleY=
"1"
>
<e:Image
id=
"milk_bg"
x=
"0"
y=
"0"
source=
"milk_bg_png"
/>
<e:Image
id=
"milk_bg"
x=
"0"
y=
"0"
source=
"milk_bg_png"
/>
<e:Image
id=
"milk_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Image
id=
"milk_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Label
id=
"milk_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Label
id=
"milk_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Image
id=
"milk_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
<e:Image
id=
"milk_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
</e:Group>
<e:Group
id=
"potato_group"
x=
"0"
y=
"0"
scaleX=
"1"
scaleY=
"1"
>
<e:Image
id=
"potato_bg"
x=
"0"
y=
"0"
source=
"potato_bg_png"
/>
<e:Image
id=
"potato_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Label
id=
"potato_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Image
id=
"potato_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
<e:Group
id=
"walnut_group"
x=
"0"
y=
"0"
scaleX=
"1"
scaleY=
"1"
>
<e:Image
id=
"walnut_bg"
x=
"0"
y=
"0"
source=
"walnut_bg_png"
/>
<e:Image
id=
"walnut_sell_btn"
source=
"出售_png"
x=
"12"
y=
"240"
/>
<e:Label
id=
"walnut_label"
text=
"数量:0"
x=
"113"
y=
"195"
size=
"24"
textColor=
"0x9A9A9A"
/>
<e:Image
id=
"walnut_ex_btn"
source=
"兑换_png"
x=
"161"
y=
"240"
scaleX=
"1"
scaleY=
"1"
/>
</e:Group>
</e:Group>
</e:Group>
</e:Scroller>
</e:Scroller>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/Panels/NewUserPanel.ts
View file @
5ef21c09
import
Panel
from
"../views/Panel"
;
import
Panel
from
"../views/Panel"
;
import
TouchEvent
=
egret
.
TouchEvent
;
import
TouchEvent
=
egret
.
TouchEvent
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
showToast
}
from
"../comm/UtilsConst"
;
import
{
getToken
}
from
"../Scenes/MainScene/Const"
;
export
default
class
NewUserPanel
extends
Panel
{
export
default
class
NewUserPanel
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
...
@@ -32,4 +35,21 @@ export default class NewUserPanel extends Panel {
...
@@ -32,4 +35,21 @@ export default class NewUserPanel extends Panel {
this
.
btn
.
removeEventListener
(
TouchEvent
.
TOUCH_TAP
,
this
.
hidePanel
,
this
);
this
.
btn
.
removeEventListener
(
TouchEvent
.
TOUCH_TAP
,
this
.
hidePanel
,
this
);
}
}
public
hidePanel
()
{
getToken
().
then
((
token
)
=>
{
if
(
!
token
)
{
showToast
(
'网络异常,请刷新页面重试'
);
return
;
}
NetManager
.
ins
.
newUserPrize
((
res
,
success
)
=>
{
if
(
!
success
)
{
showToast
(
'网络异常,请稍后再试'
);
return
;
}
super
.
hidePanel
();
},
token
)
});
}
}
}
egret/src/Panels/SellRecord.ts
View file @
5ef21c09
import
Panel
from
"../views/Panel"
;
import
Panel
from
"../views/Panel"
;
import
{
getSkinPath
}
from
"../utils"
;
import
{
getSkinPath
}
from
"../utils"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
productData
}
from
"./WareHousePanel"
;
export
default
class
SellRecord
extends
Panel
{
export
default
class
SellRecord
extends
Panel
{
public
list
:
eui
.
List
;
public
list
:
eui
.
List
;
...
@@ -48,12 +49,6 @@ export default class SellRecord extends Panel {
...
@@ -48,12 +49,6 @@ export default class SellRecord extends Panel {
}
}
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
let
spData
=
{
'sp_1'
:
'个鸡蛋'
,
'sp_2'
:
'袋小麦'
,
'sp_3'
:
'个玉米'
,
'sp_4'
:
'瓶牛奶'
,
};
// 任务中心列表
// 任务中心列表
class
SellRecordItem
extends
eui
.
ItemRenderer
{
class
SellRecordItem
extends
eui
.
ItemRenderer
{
...
@@ -69,7 +64,7 @@ class SellRecordItem extends eui.ItemRenderer {
...
@@ -69,7 +64,7 @@ class SellRecordItem extends eui.ItemRenderer {
dataChanged
()
{
dataChanged
()
{
let
{
date
,
spCount
,
sp
,
credits
}
=
this
.
data
;
let
{
date
,
spCount
,
sp
,
credits
}
=
this
.
data
;
let
nd
=
new
Date
(
date
);
let
nd
=
new
Date
(
date
);
this
.
cropLabel
.
text
=
spCount
+
spData
[
sp
]
;
this
.
cropLabel
.
text
=
spCount
+
productData
[
sp
].
numLabel
+
productData
[
sp
].
nameLabel
;
this
.
dateLabel
.
text
=
`
${
nd
.
getFullYear
()}
.
${
nd
.
getMonth
()
+
1
}
.
${
nd
.
getDate
()}
`
;
this
.
dateLabel
.
text
=
`
${
nd
.
getFullYear
()}
.
${
nd
.
getMonth
()
+
1
}
.
${
nd
.
getDate
()}
`
;
this
.
creditsLabel
.
text
=
`
${
credits
}
个欢趣豆`
;
this
.
creditsLabel
.
text
=
`
${
credits
}
个欢趣豆`
;
}
}
...
...
egret/src/Panels/TaskPanel.ts
View file @
5ef21c09
...
@@ -29,6 +29,18 @@ let taskUi = {
...
@@ -29,6 +29,18 @@ let taskUi = {
label
:
'访问欢趣市集'
,
label
:
'访问欢趣市集'
,
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
},
},
5
:
{
icon
:
'消费 icon_png'
,
btnLabel
:
'去浏览'
,
label
:
'浏览积分商城'
,
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
},
6
:
{
icon
:
'消费 icon_png'
,
btnLabel
:
'去消费'
,
label
:
'去指定场景消费'
,
link
:
'https://gonghang.activity-1.m.duiba.com.cn/hdtool/index?id=3737984&dbnewopen'
},
};
};
export
default
class
TaskPanel
extends
Panel
{
export
default
class
TaskPanel
extends
Panel
{
...
@@ -161,7 +173,7 @@ class TaskItem extends eui.ItemRenderer {
...
@@ -161,7 +173,7 @@ class TaskItem extends eui.ItemRenderer {
}
else
{
}
else
{
MainDispatcher
.
dispatchEvent
(
'getTaskInfo'
);
MainDispatcher
.
dispatchEvent
(
'getTaskInfo'
);
MainIns
().
mainUI
.
getPropInfo
();
MainIns
().
mainUI
.
getPropInfo
();
window
.
location
.
href
=
window
[
'taskUi'
][
this
.
data
.
id
].
link
;
window
.
location
.
href
=
this
.
data
.
url
||
window
[
'taskUi'
][
this
.
data
.
id
].
link
;
}
}
},
this
.
data
.
id
);
},
this
.
data
.
id
);
},
this
);
},
this
);
...
...
egret/src/Panels/WareHousePanel.ts
View file @
5ef21c09
...
@@ -2,7 +2,7 @@ import Panel from "../views/Panel";
...
@@ -2,7 +2,7 @@ import Panel from "../views/Panel";
import
TopLayerCtrl
from
"../ctrls/topLayerCtrl"
;
import
TopLayerCtrl
from
"../ctrls/topLayerCtrl"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
{
ModuleTypes
}
from
"../types/sceneTypes"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
btnDelay
,
showToast
}
from
"../comm/UtilsConst"
;
import
{
btnDelay
}
from
"../comm/UtilsConst"
;
import
{
MainDispatcher
}
from
"../Scenes/MainScene/MainScene"
;
import
{
MainDispatcher
}
from
"../Scenes/MainScene/MainScene"
;
import
{
getlogItem
}
from
"../comm/getlogItem"
;
import
{
getlogItem
}
from
"../comm/getlogItem"
;
import
{
G_GetHomeDataByKey
,
G_UpdateHomeData
,
HOME
}
from
"../Scenes/Home"
;
import
{
G_GetHomeDataByKey
,
G_UpdateHomeData
,
HOME
}
from
"../Scenes/Home"
;
...
@@ -22,7 +22,6 @@ export let productData = {
...
@@ -22,7 +22,6 @@ export let productData = {
name
:
'wheat'
,
name
:
'wheat'
,
nameLabel
:
'麦粉'
,
nameLabel
:
'麦粉'
,
numLabel
:
'袋'
,
numLabel
:
'袋'
,
titleImg
:
'sellTitle_wheat_png'
,
price
:
0
,
price
:
0
,
},
},
'sp_3'
:
{
// 玉米
'sp_3'
:
{
// 玉米
...
@@ -30,7 +29,6 @@ export let productData = {
...
@@ -30,7 +29,6 @@ export let productData = {
name
:
'corn'
,
name
:
'corn'
,
nameLabel
:
'玉米'
,
nameLabel
:
'玉米'
,
numLabel
:
'个'
,
numLabel
:
'个'
,
titleImg
:
'sellTitle_corn_png'
,
price
:
0
,
price
:
0
,
},
},
'sp_4'
:
{
// 牛奶
'sp_4'
:
{
// 牛奶
...
@@ -38,18 +36,24 @@ export let productData = {
...
@@ -38,18 +36,24 @@ export let productData = {
name
:
'milk'
,
name
:
'milk'
,
nameLabel
:
'牛奶'
,
nameLabel
:
'牛奶'
,
numLabel
:
'瓶'
,
numLabel
:
'瓶'
,
titleImg
:
'sellTitle_milk_png'
,
price
:
0
,
},
'sp_5'
:
{
// 土豆
key
:
'sp_5'
,
name
:
'potato'
,
nameLabel
:
'土豆'
,
numLabel
:
'袋'
,
price
:
0
,
},
'sp_6'
:
{
// 核桃
key
:
'sp_6'
,
name
:
'walnut'
,
nameLabel
:
'核桃'
,
numLabel
:
'袋'
,
price
:
0
,
price
:
0
,
}
}
};
};
const
posArr
=
[
[
0
,
0
],
[
354
,
0
],
[
0
,
359
],
[
354
,
359
],
];
export
default
class
WareHousePanel
extends
Panel
{
export
default
class
WareHousePanel
extends
Panel
{
public
closeBtn
:
eui
.
Image
;
public
closeBtn
:
eui
.
Image
;
public
record_btn
:
eui
.
Image
;
public
record_btn
:
eui
.
Image
;
...
@@ -81,7 +85,7 @@ export default class WareHousePanel extends Panel {
...
@@ -81,7 +85,7 @@ export default class WareHousePanel extends Panel {
}
}
private
onTap
(
e
:
egret
.
TouchEvent
)
{
private
onTap
(
e
:
egret
.
TouchEvent
)
{
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
record_btn
:
// 售卖记录
case
this
.
record_btn
:
// 售卖记录
btnDelay
(
this
.
record_btn
);
btnDelay
(
this
.
record_btn
);
TopLayerCtrl
.
instance
.
show
(
ModuleTypes
.
SELL_RECORD
,
{},
.
3
);
TopLayerCtrl
.
instance
.
show
(
ModuleTypes
.
SELL_RECORD
,
{},
.
3
);
...
@@ -95,11 +99,11 @@ export default class WareHousePanel extends Panel {
...
@@ -95,11 +99,11 @@ export default class WareHousePanel extends Panel {
protected
start
()
{
protected
start
()
{
super
.
start
();
super
.
start
();
NetManager
.
ins
.
priceInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
priceInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
const
data
=
res
.
data
;
const
data
=
res
.
data
;
for
(
let
k
in
productData
)
{
for
(
let
k
in
productData
)
{
productData
[
k
].
price
=
data
[
k
];
productData
[
k
].
price
=
data
[
k
];
}
}
});
});
...
@@ -131,31 +135,38 @@ export default class WareHousePanel extends Panel {
...
@@ -131,31 +135,38 @@ export default class WareHousePanel extends Panel {
const
data
=
this
.
data
;
const
data
=
this
.
data
;
let
showKey
=
[];
let
showKey
=
[];
for
(
let
k
in
productData
)
{
for
(
let
k
in
productData
)
{
if
(
data
[
k
]
<=
0
)
{
const
name
=
productData
[
k
].
name
;
this
[
`
${
productData
[
k
].
name
}
_group`
].
visible
=
false
;
const
group
=
this
[
`
${
name
}
_group`
];
const
label
=
this
[
`
${
name
}
_label`
];
const
sellBtn
=
this
[
`
${
name
}
_sell_btn`
];
const
exBtn
=
this
[
`
${
name
}
_ex_btn`
];
if
(
!
data
[
k
]
||
data
[
k
]
<=
0
)
{
group
.
visible
=
false
;
}
else
{
}
else
{
showKey
.
push
(
k
);
showKey
.
push
(
k
);
NetManager
.
ins
.
showLog
(
getlogItem
(
16
));
NetManager
.
ins
.
showLog
(
getlogItem
(
16
));
NetManager
.
ins
.
showLog
(
getlogItem
(
17
));
NetManager
.
ins
.
showLog
(
getlogItem
(
17
));
this
[
`
${
productData
[
k
].
name
}
_label`
]
.
text
=
`数量:
${
data
[
k
]}
`
;
label
.
text
=
`数量:
${
data
[
k
]}
`
;
this
[
`
${
productData
[
k
].
name
}
_sell_btn`
]
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
sellBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
16
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
16
));
btnDelay
(
this
[
`
${
productData
[
k
].
name
}
_sell_btn`
]
);
btnDelay
(
sellBtn
);
TopLayerCtrl
.
instance
.
show
(
ModuleTypes
.
SELL_PANEL
,
{
key
:
k
,
total
:
data
[
k
]},
.
4
);
TopLayerCtrl
.
instance
.
show
(
ModuleTypes
.
SELL_PANEL
,
{
key
:
k
,
total
:
data
[
k
]},
.
4
);
});
});
this
[
`
${
productData
[
k
].
name
}
_ex_btn`
]
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
exBtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
NetManager
.
ins
.
clickLog
(
getlogItem
(
17
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
17
));
btnDelay
(
this
[
`
${
productData
[
k
].
name
}
_ex_btn`
]
);
btnDelay
(
exBtn
);
// showToast('欢趣商店待开放,过段日子再来吧~');
// showToast('欢趣商店待开放,过段日子再来吧~');
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
SHOP_SCENE
);
SceneCtrl
.
instance
.
change
(
ModuleTypes
.
SHOP_SCENE
);
});
});
}
}
}
}
for
(
let
i
=
0
;
i
<
showKey
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
showKey
.
length
;
i
++
)
{
this
[
`
${
productData
[
showKey
[
i
]].
name
}
_group`
].
x
=
posArr
[
i
][
0
];
const
group
=
this
[
`
${
productData
[
showKey
[
i
]].
name
}
_group`
];
this
[
`
${
productData
[
showKey
[
i
]].
name
}
_group`
].
y
=
posArr
[
i
][
1
];
group
.
x
=
i
%
2
*
354
;
group
.
y
=
~~
(
i
/
2
)
*
359
;
}
}
this
.
crops
.
visible
=
(
showKey
.
length
>
0
);
this
.
crops
.
visible
=
(
showKey
.
length
>
0
);
this
.
noneImg
.
visible
=
!
(
showKey
.
length
>
0
);
this
.
noneImg
.
visible
=
!
(
showKey
.
length
>
0
);
...
...
egret/src/Scenes/Home.ts
View file @
5ef21c09
...
@@ -16,6 +16,8 @@ let HomeData = {
...
@@ -16,6 +16,8 @@ let HomeData = {
sp_2
:
0
,
// 小麦粉
sp_2
:
0
,
// 小麦粉
sp_3
:
0
,
// 玉米
sp_3
:
0
,
// 玉米
sp_4
:
0
,
// 牛奶
sp_4
:
0
,
// 牛奶
sp_5
:
0
,
// 土豆
sp_6
:
0
,
// 核桃
},
},
medals
:
{
medals
:
{
sp_achv_1
:
{
sp_achv_1
:
{
...
...
egret/src/Scenes/MainScene/Const.ts
View file @
5ef21c09
import
{
showToast
}
from
"../../comm/UtilsConst"
;
export
enum
CROP_TYPE
{
export
enum
CROP_TYPE
{
NONE
=
0
,
// 啥也没有
NONE
=
0
,
// 啥也没有
...
@@ -60,4 +61,63 @@ export let petData = {
...
@@ -60,4 +61,63 @@ export let petData = {
option
:
'feed'
,
option
:
'feed'
,
catherImg
:
'牛奶'
,
catherImg
:
'牛奶'
,
},
},
5
:
{
// 土豆
key
:
'potato'
,
name
:
'土豆'
,
type
:
'plant'
,
pos
:
[
-
70
,
-
135
],
propId
:
'sp_food_2'
,
optionSvga
:
'ready_water'
,
option
:
'water'
,
catherImg
:
'土豆'
,
},
6
:
{
// 核桃
key
:
'walnut'
,
name
:
'核桃'
,
type
:
'plant'
,
pos
:
[
-
70
,
-
140
],
propId
:
'sp_food_2'
,
optionSvga
:
'ready_water'
,
option
:
'water'
,
catherImg
:
'核桃'
,
},
};
};
export
function
getToken
()
{
console
.
log
(
'尝试获取token'
);
return
new
Promise
((
s
,
j
)
=>
{
if
(
window
.
location
.
port
==
'8080'
)
{
s
(
'dev-token'
)
}
else
{
if
(
window
[
'getPxToken'
])
{
window
[
'getPxToken'
](
function
(
e
,
token
)
{
switch
(
e
)
{
case
'net error'
:
showToast
(
`getToken:
${
e
}
`
)
s
(
null
)
break
;
case
'need login'
:
showToast
(
`getToken:
${
e
}
`
)
s
(
null
)
break
;
case
'state invalid'
:
showToast
(
`getToken:
${
e
}
`
)
s
(
null
)
break
;
default
:
if
(
token
)
{
s
(
token
)
}
else
{
showToast
(
`getToken: invalid key`
)
s
(
null
)
}
break
;
}
});
}
else
{
showToast
(
`getToken: no ready`
)
s
(
null
)
}
}
})
}
egret/src/Scenes/MainScene/MainScene.ts
View file @
5ef21c09
...
@@ -4,10 +4,6 @@ import LandMgr from "./LandMgr";
...
@@ -4,10 +4,6 @@ import LandMgr from "./LandMgr";
import
OptionPanel
,
{
M_HideOption
}
from
"./Objs/OptionPanel"
;
import
OptionPanel
,
{
M_HideOption
}
from
"./Objs/OptionPanel"
;
import
Dispatcher
from
"../../comm/Dispatcher"
;
import
Dispatcher
from
"../../comm/Dispatcher"
;
import
ProgressMgr
from
"./ProgressMgr"
;
import
ProgressMgr
from
"./ProgressMgr"
;
import
PanelCtrl
from
"../../ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../../types/sceneTypes"
;
import
RulePanel
from
"../../Panels/RulePanel"
;
import
IntroducePanel
from
"../../Panels/IntroducePanel"
;
////////////////// Instance //////////////////
////////////////// Instance //////////////////
let
instance
:
MainScene
=
null
;
let
instance
:
MainScene
=
null
;
...
...
egret/src/Scenes/MainScene/MainUI.ts
View file @
5ef21c09
...
@@ -12,6 +12,9 @@ import { getlogItem } from "../../comm/getlogItem";
...
@@ -12,6 +12,9 @@ import { getlogItem } from "../../comm/getlogItem";
import
SceneCtrl
from
"../../ctrls/sceneCtrl"
;
import
SceneCtrl
from
"../../ctrls/sceneCtrl"
;
import
{
G_GetHomeDataByKey
,
G_SetHomeDataByKey
,
G_UpdateHomeData
,
HOME
}
from
"../Home"
;
import
{
G_GetHomeDataByKey
,
G_SetHomeDataByKey
,
G_UpdateHomeData
,
HOME
}
from
"../Home"
;
import
RulePanel
from
"../../Panels/RulePanel"
;
import
RulePanel
from
"../../Panels/RulePanel"
;
import
WareHousePanel
from
"../../Panels/WareHousePanel"
;
import
NewUserPanel
from
"../../Panels/NewUserPanel"
;
import
OldUserPanel
from
"../../Panels/OldUserPanel"
;
export
let
propData
=
{
export
let
propData
=
{
sp_food_1
:
{
name
:
'food'
,},
sp_food_1
:
{
name
:
'food'
,},
...
@@ -43,7 +46,7 @@ export default class MainUI extends ComponentBase {
...
@@ -43,7 +46,7 @@ export default class MainUI extends ComponentBase {
public
tipLabelMask
:
eui
.
Rect
;
public
tipLabelMask
:
eui
.
Rect
;
public
recordBtn
:
eui
.
Button
;
public
recordBtn
:
eui
.
Button
;
public
shopBtn
:
eui
.
Button
;
public
shopBtn
:
eui
.
Button
;
public
rule
:
eui
.
Image
;
public
rule
:
eui
.
Image
;
private
tip1
;
private
tip1
;
...
@@ -72,7 +75,7 @@ export default class MainUI extends ComponentBase {
...
@@ -72,7 +75,7 @@ export default class MainUI extends ComponentBase {
private
onTapOption
(
e
:
egret
.
TouchEvent
)
{
private
onTapOption
(
e
:
egret
.
TouchEvent
)
{
btnDelay
(
e
.
target
);
btnDelay
(
e
.
target
);
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
foodGroup
:
// 食物数量区域
case
this
.
foodGroup
:
// 食物数量区域
NetManager
.
ins
.
clickLog
(
getlogItem
(
6
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
6
));
showToast
(
'点击饿了的动物才能进行喂食哦'
);
showToast
(
'点击饿了的动物才能进行喂食哦'
);
...
@@ -93,7 +96,7 @@ export default class MainUI extends ComponentBase {
...
@@ -93,7 +96,7 @@ export default class MainUI extends ComponentBase {
/// TODO 定义详细操作
/// TODO 定义详细操作
private
onTap
(
e
:
egret
.
TouchEvent
)
{
private
onTap
(
e
:
egret
.
TouchEvent
)
{
btnDelay
(
e
.
target
);
btnDelay
(
e
.
target
);
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
taskBtn
:
// 任务按钮
case
this
.
taskBtn
:
// 任务按钮
NetManager
.
ins
.
clickLog
(
getlogItem
(
3
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
3
));
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
TASK_PANEL
);
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
TASK_PANEL
);
...
@@ -102,7 +105,7 @@ export default class MainUI extends ComponentBase {
...
@@ -102,7 +105,7 @@ export default class MainUI extends ComponentBase {
case
this
.
warehouseBtn
:
// 仓库按钮
case
this
.
warehouseBtn
:
// 仓库按钮
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
4
));
G_UpdateHomeData
().
then
(()
=>
{
G_UpdateHomeData
().
then
(()
=>
{
PanelCtrl
.
instance
.
show
(
ModuleTypes
.
WAREHOUSE_PANEL
,
G_GetHomeDataByKey
(
HOME
.
PRODUCT
));
PanelCtrl
.
instance
.
show
(
WareHousePanel
,
G_GetHomeDataByKey
(
HOME
.
PRODUCT
));
});
});
break
;
break
;
...
@@ -191,7 +194,7 @@ export default class MainUI extends ComponentBase {
...
@@ -191,7 +194,7 @@ export default class MainUI extends ComponentBase {
}
}
private
_onChange
()
{
private
_onChange
()
{
if
(
!
this
.
tip2
||
!
this
.
tip1
)
{
if
(
!
this
.
tip2
||
!
this
.
tip1
)
{
return
;
return
;
}
}
this
.
tip2
.
x
=
this
.
tip1
.
x
+
this
.
tip1
.
width
;
this
.
tip2
.
x
=
this
.
tip1
.
x
+
this
.
tip1
.
width
;
...
@@ -238,11 +241,11 @@ export default class MainUI extends ComponentBase {
...
@@ -238,11 +241,11 @@ export default class MainUI extends ComponentBase {
public
setPropInfoByBI
()
{
public
setPropInfoByBI
()
{
const
data
=
G_GetHomeDataByKey
(
HOME
.
PROP
);
const
data
=
G_GetHomeDataByKey
(
HOME
.
PROP
);
for
(
let
k
in
propData
)
{
for
(
let
k
in
propData
)
{
this
[
`
${
propData
[
k
].
name
}
Num`
].
text
=
'× '
+
data
[
k
];
this
[
`
${
propData
[
k
].
name
}
Num`
].
text
=
'× '
+
data
[
k
];
DataManager
.
ins
.
updateData
(
propData
[
k
].
name
,
data
[
k
]);
DataManager
.
ins
.
updateData
(
propData
[
k
].
name
,
data
[
k
]);
}
}
if
(
data
[
'sp_prop_1'
]
>
0
)
{
if
(
data
[
'sp_prop_1'
]
>
0
)
{
NetManager
.
ins
.
showLog
(
getlogItem
(
18
));
// 加速卡区域
NetManager
.
ins
.
showLog
(
getlogItem
(
18
));
// 加速卡区域
this
[
`
${
propData
[
'sp_prop_1'
].
name
}
Group`
].
visible
=
true
;
this
[
`
${
propData
[
'sp_prop_1'
].
name
}
Group`
].
visible
=
true
;
}
else
{
}
else
{
...
@@ -252,7 +255,7 @@ export default class MainUI extends ComponentBase {
...
@@ -252,7 +255,7 @@ export default class MainUI extends ComponentBase {
public
setPropInfo
()
{
public
setPropInfo
()
{
const
data
=
G_GetHomeDataByKey
(
HOME
.
PROP
);
const
data
=
G_GetHomeDataByKey
(
HOME
.
PROP
);
for
(
let
k
in
propData
)
{
for
(
let
k
in
propData
)
{
this
[
`
${
propData
[
k
].
name
}
Num`
].
text
=
'× '
+
data
[
k
];
this
[
`
${
propData
[
k
].
name
}
Num`
].
text
=
'× '
+
data
[
k
];
DataManager
.
ins
.
updateData
(
propData
[
k
].
name
,
data
[
k
]);
DataManager
.
ins
.
updateData
(
propData
[
k
].
name
,
data
[
k
]);
}
}
...
@@ -261,7 +264,7 @@ export default class MainUI extends ComponentBase {
...
@@ -261,7 +264,7 @@ export default class MainUI extends ComponentBase {
public
getGoldNum
()
{
public
getGoldNum
()
{
NetManager
.
ins
.
getProjectUserInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
getProjectUserInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
const
data
=
res
.
data
;
const
data
=
res
.
data
;
...
@@ -272,13 +275,22 @@ export default class MainUI extends ComponentBase {
...
@@ -272,13 +275,22 @@ export default class MainUI extends ComponentBase {
private
getUserInfo
()
{
private
getUserInfo
()
{
NetManager
.
ins
.
getConsumerInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
getConsumerInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
this
.
userName
.
text
=
'欢趣使者'
;
this
.
userName
.
text
=
'欢趣使者'
;
return
;
return
;
}
}
const
data
=
res
.
data
;
const
data
=
res
.
data
;
this
.
userName
.
text
=
(
!
data
||
!
data
.
nickname
||
(
data
.
nickname
==
'null'
))
this
.
userName
.
text
=
(
!
data
||
!
data
.
nickname
||
(
data
.
nickname
==
'null'
))
?
'欢趣使者'
:
((
data
.
nickname
.
length
>
7
)
?
data
.
nickname
.
slice
(
0
,
7
)
+
'...'
:
data
.
nickname
);
?
'欢趣使者'
:
((
data
.
nickname
.
length
>
7
)
?
data
.
nickname
.
slice
(
0
,
7
)
+
'...'
:
data
.
nickname
);
if
(
data
.
popup
)
{
if
(
data
.
newUser
)
{
PanelCtrl
.
instance
.
show
(
NewUserPanel
);
}
else
{
PanelCtrl
.
instance
.
show
(
OldUserPanel
);
}
}
});
});
}
}
...
...
egret/src/Scenes/MainScene/Objs/Land.ts
View file @
5ef21c09
...
@@ -57,8 +57,8 @@ export default class Land extends eui.Component {
...
@@ -57,8 +57,8 @@ export default class Land extends eui.Component {
const
landData
=
this
.
data
.
data
;
const
landData
=
this
.
data
.
data
;
/// TODO 根据数据添加Crop 初始化状态
/// TODO 根据数据添加Crop 初始化状态
if
(
landData
.
petId
)
{
if
(
landData
.
petId
)
{
if
(
landData
.
petId
==
1
||
landData
.
petId
==
4
)
{
if
(
landData
.
petId
==
1
||
landData
.
petId
==
4
)
{
this
.
changeState
(
LAND_STATE
.
ANIMAL
);
this
.
changeState
(
LAND_STATE
.
ANIMAL
);
}
else
{
}
else
{
this
.
changeState
(
LAND_STATE
.
PLANT
);
this
.
changeState
(
LAND_STATE
.
PLANT
);
...
@@ -82,7 +82,7 @@ export default class Land extends eui.Component {
...
@@ -82,7 +82,7 @@ export default class Land extends eui.Component {
this
.
touchEnabled
=
false
;
// 保证空白处不可点击,且子对象可点击
this
.
touchEnabled
=
false
;
// 保证空白处不可点击,且子对象可点击
this
.
touchChildren
=
true
;
this
.
touchChildren
=
true
;
this
.
land
.
touchEnabled
=
true
;
this
.
land
.
touchEnabled
=
true
;
this
.
land
.
pixelHitTest
=
true
;
// 保证透明像素不可点击
// this.land.pixelHitTest = true; // 保证透明像素不可点击 TODO ios14像素点击不能用
this
.
fence
.
touchEnabled
=
false
;
// 保证栅栏和食槽不可点击
this
.
fence
.
touchEnabled
=
false
;
// 保证栅栏和食槽不可点击
this
.
trough
.
touchEnabled
=
false
;
this
.
trough
.
touchEnabled
=
false
;
}
}
...
@@ -91,9 +91,23 @@ export default class Land extends eui.Component {
...
@@ -91,9 +91,23 @@ export default class Land extends eui.Component {
this
.
land
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap
,
this
);
this
.
land
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap
,
this
);
}
}
private
onTap
()
{
private
onTap
(
e
)
{
/* TODO ios14像素点击不能用 手动检测菱形包围盒 */
const
{
localX
,
localY
}
=
e
;
const
p
=
{
x
:
localX
,
y
:
localY
};
const
tW
=
this
.
land
.
width
;
const
tH
=
this
.
land
.
height
;
p
.
x
-=
tW
/
2
;
p
.
y
-=
tH
/
2
;
const
judge
=
Math
.
abs
(
p
.
x
*
tH
/
2
)
+
Math
.
abs
(
p
.
y
*
tW
/
2
)
<=
tW
*
tH
/
4
;
if
(
!
judge
)
return
;
/* TODO ios14像素点击不能用 手动检测菱形包围盒 */
console
.
log
(
`点击了第
${
this
.
index
}
块土地, 当前状态是
${
this
.
state
}
`
);
console
.
log
(
`点击了第
${
this
.
index
}
块土地, 当前状态是
${
this
.
state
}
`
);
if
(
this
.
state
!=
LAND_STATE
.
NONE
)
{
if
(
this
.
state
!=
LAND_STATE
.
NONE
)
{
// M_HideOption();
// M_HideOption();
return
;
return
;
}
}
...
@@ -109,8 +123,8 @@ export default class Land extends eui.Component {
...
@@ -109,8 +123,8 @@ export default class Land extends eui.Component {
const
landData
=
this
.
data
.
data
;
const
landData
=
this
.
data
.
data
;
/// TODO 根据数据添加Crop 初始化状态
/// TODO 根据数据添加Crop 初始化状态
if
(
landData
.
petId
)
{
if
(
landData
.
petId
)
{
if
(
landData
.
petId
==
1
||
landData
.
petId
==
4
)
{
if
(
landData
.
petId
==
1
||
landData
.
petId
==
4
)
{
this
.
changeState
(
LAND_STATE
.
ANIMAL
);
this
.
changeState
(
LAND_STATE
.
ANIMAL
);
}
else
{
}
else
{
this
.
changeState
(
LAND_STATE
.
PLANT
);
this
.
changeState
(
LAND_STATE
.
PLANT
);
...
@@ -125,7 +139,7 @@ export default class Land extends eui.Component {
...
@@ -125,7 +139,7 @@ export default class Land extends eui.Component {
// 改变状态积
// 改变状态积
private
changeState
(
state
:
LAND_STATE
)
{
private
changeState
(
state
:
LAND_STATE
)
{
if
(
state
==
this
.
state
)
{
if
(
state
==
this
.
state
)
{
return
;
return
;
}
}
...
@@ -136,7 +150,7 @@ export default class Land extends eui.Component {
...
@@ -136,7 +150,7 @@ export default class Land extends eui.Component {
this
.
trough
.
visible
=
(
this
.
state
==
LAND_STATE
.
ANIMAL
);
// 显示食槽
this
.
trough
.
visible
=
(
this
.
state
==
LAND_STATE
.
ANIMAL
);
// 显示食槽
/// TODO 定义状态积详情
/// TODO 定义状态积详情
switch
(
this
.
state
)
{
switch
(
this
.
state
)
{
case
LAND_STATE
.
NONE
:
// 啥也没有
case
LAND_STATE
.
NONE
:
// 啥也没有
break
;
break
;
...
@@ -153,4 +167,4 @@ export default class Land extends eui.Component {
...
@@ -153,4 +167,4 @@ export default class Land extends eui.Component {
break
;
break
;
}
}
}
}
}
}
\ No newline at end of file
egret/src/Scenes/ShopScene/ShopScene.ts
View file @
5ef21c09
...
@@ -98,7 +98,7 @@ export default class ShopScene extends Scene {
...
@@ -98,7 +98,7 @@ export default class ShopScene extends Scene {
private
buyProp
(
e
:
egret
.
TouchEvent
)
{
private
buyProp
(
e
:
egret
.
TouchEvent
)
{
btnDelay
(
e
.
target
);
btnDelay
(
e
.
target
);
let
data
=
null
;
let
data
=
null
;
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
speedBtn
:
// 买加速卡
case
this
.
speedBtn
:
// 买加速卡
NetManager
.
ins
.
clickLog
(
getlogItem
(
22
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
22
));
data
=
shopSpData
[
'sp_prop_1'
];
data
=
shopSpData
[
'sp_prop_1'
];
...
@@ -118,7 +118,7 @@ export default class ShopScene extends Scene {
...
@@ -118,7 +118,7 @@ export default class ShopScene extends Scene {
}
}
private
onTouchTap
(
e
:
egret
.
TouchEvent
)
{
private
onTouchTap
(
e
:
egret
.
TouchEvent
)
{
switch
(
e
.
target
)
{
switch
(
e
.
target
)
{
case
this
.
backBtn
:
case
this
.
backBtn
:
btnDelay
(
this
.
backBtn
);
btnDelay
(
this
.
backBtn
);
egret
.
Tween
.
get
(
this
.
backBtn
)
egret
.
Tween
.
get
(
this
.
backBtn
)
...
@@ -158,10 +158,12 @@ export default class ShopScene extends Scene {
...
@@ -158,10 +158,12 @@ export default class ShopScene extends Scene {
private
setGoods
()
{
private
setGoods
()
{
G_UpdateHomeData
().
then
(()
=>
{
G_UpdateHomeData
().
then
(()
=>
{
this
.
getGoodsInfo
().
then
(()
=>
{
this
.
getGoodsInfo
().
then
(()
=>
{
let
_d
=
[];
const
_d
=
[];
for
(
let
k
in
this
.
prizeData
)
{
for
(
let
k
in
this
.
prizeData
)
{
_d
.
push
(
this
.
prizeData
[
k
]);
_d
.
push
(
this
.
prizeData
[
k
]);
}
}
this
.
none
.
visible
=
(
_d
.
length
<=
0
);
this
.
none
.
visible
=
(
_d
.
length
<=
0
);
this
.
have
.
visible
=
!
(
_d
.
length
<=
0
);
this
.
have
.
visible
=
!
(
_d
.
length
<=
0
);
this
.
list
.
useVirtualLayout
=
false
;
this
.
list
.
useVirtualLayout
=
false
;
...
@@ -180,8 +182,8 @@ export default class ShopScene extends Scene {
...
@@ -180,8 +182,8 @@ export default class ShopScene extends Scene {
*/
*/
private
getGoodsInfo
()
{
private
getGoodsInfo
()
{
// 聚合查询
// 聚合查询
le
t
querys
=
{};
cons
t
querys
=
{};
for
(
let
i
=
1
;
i
<=
ruNum
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
ruNum
;
i
++
)
{
querys
[
`ru_item_
${
i
}
`
]
=
{
querys
[
`ru_item_
${
i
}
`
]
=
{
path
:
`/ru_item_
${
i
}
.query`
,
path
:
`/ru_item_
${
i
}
.query`
,
params
:
{},
params
:
{},
...
@@ -191,29 +193,30 @@ export default class ShopScene extends Scene {
...
@@ -191,29 +193,30 @@ export default class ShopScene extends Scene {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
///////////////////////// 查询商店列表 /////////////////////////
///////////////////////// 查询商店列表 /////////////////////////
NetManager
.
ins
.
mergeQuery
((
success
,
res
)
=>
{
NetManager
.
ins
.
mergeQuery
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
reject
();
reject
();
return
;
return
;
}
}
const
data
=
res
.
data
;
const
data
=
res
.
data
;
let
prizeIds
=
''
;
let
prizeIds
=
''
;
for
(
let
k
in
data
)
{
for
(
let
k
in
data
)
{
le
t
_d
=
JSON
.
parse
(
data
[
k
]);
cons
t
_d
=
JSON
.
parse
(
data
[
k
]);
if
(
!
_d
.
success
)
{
continue
;
if
(
!
_d
.
success
)
continue
;
}
for
(
let
i
=
0
;
i
<=
_d
.
data
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
_d
.
data
.
length
;
i
++
)
{
if
(
_d
.
data
[
i
].
prizeId
==
'thanks'
)
{
if
(
_d
.
data
[
i
].
prizeId
==
'thanks'
)
{
_d
.
data
.
splice
(
i
,
1
);
_d
.
data
.
splice
(
i
,
1
);
}
}
}
}
if
(
_d
.
data
.
length
<=
0
)
{
continue
;
if
(
_d
.
data
.
length
<=
0
)
continue
;
}
this
.
prizeData
[
_d
.
data
[
0
][
'prizeId'
]]
=
deepClone
(
_d
.
data
[
0
]);
// 保存商品信息
const
prizeId
=
_d
.
data
[
0
].
prizeId
;
this
.
prizeData
[
_d
.
data
[
0
][
'prizeId'
]][
'strategyId'
]
=
k
;
// 保存规则Id
this
.
prizeData
[
prizeId
]
=
deepClone
(
_d
.
data
[
0
]);
// 保存商品信息
prizeIds
+=
`
${
k
}
:
${
_d
.
data
[
0
][
'prizeId'
]}
,`
;
this
.
prizeData
[
prizeId
].
strategyId
=
k
;
// 保存规则Id
this
.
prizeData
[
_d
.
data
[
0
][
'prizeId'
]][
'canGet'
]
=
true
;
prizeIds
+=
`
${
k
}
:
${
prizeId
}
,`
;
this
.
prizeData
[
prizeId
].
canGet
=
true
;
(
this
.
canShow
)
?
NetManager
.
ins
.
showLog
(
getlogDpm
(
21
,
+
k
.
slice
(
8
)))
:
0
;
(
this
.
canShow
)
?
NetManager
.
ins
.
showLog
(
getlogDpm
(
21
,
+
k
.
slice
(
8
)))
:
0
;
}
}
...
@@ -221,26 +224,26 @@ export default class ShopScene extends Scene {
...
@@ -221,26 +224,26 @@ export default class ShopScene extends Scene {
prizeIds
=
prizeIds
.
slice
(
0
,
prizeIds
.
length
-
1
);
prizeIds
=
prizeIds
.
slice
(
0
,
prizeIds
.
length
-
1
);
///////////////////////// 查询库存和需要的道具信息 /////////////////////////
///////////////////////// 查询库存和需要的道具信息 /////////////////////////
NetManager
.
ins
.
prizeInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
prizeInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
reject
();
reject
();
return
;
return
;
}
}
const
_data
=
res
.
data
;
const
_data
=
res
.
data
;
for
(
let
k
in
_data
)
{
// 设置库存
for
(
let
k
in
_data
)
{
// 设置库存
this
.
prizeData
[
k
]
[
'stock'
]
=
_data
[
k
][
'stock'
]
;
this
.
prizeData
[
k
]
.
stock
=
_data
[
k
].
stock
;
this
.
prizeData
[
k
]
[
'spMap'
]
=
_data
[
k
][
'spMap'
]
;
this
.
prizeData
[
k
]
.
spMap
=
_data
[
k
].
spMap
;
}
}
///////////////////////// 查询是否合成过 /////////////////////////
///////////////////////// 查询是否合成过 /////////////////////////
NetManager
.
ins
.
queryRecords
((
success
,
res
)
=>
{
NetManager
.
ins
.
queryRecords
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
reject
();
reject
();
return
;
return
;
}
}
const
__data
=
res
.
data
;
const
__data
=
res
.
data
;
for
(
let
v
of
__data
)
{
for
(
let
v
of
__data
)
{
let
prizeId
=
v
.
prizeId
;
let
prizeId
=
v
.
prizeId
;
if
(
this
.
prizeData
.
hasOwnProperty
(
prizeId
))
{
if
(
this
.
prizeData
.
hasOwnProperty
(
prizeId
))
{
this
.
prizeData
[
prizeId
]
[
'canGet'
]
=
false
;
this
.
prizeData
[
prizeId
]
.
canGet
=
false
;
}
}
}
}
resolve
();
resolve
();
...
@@ -259,32 +262,32 @@ export default class ShopScene extends Scene {
...
@@ -259,32 +262,32 @@ export default class ShopScene extends Scene {
*/
*/
private
getPropInfo
()
{
private
getPropInfo
()
{
NetManager
.
ins
.
propInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
propInfo
((
success
,
res
)
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
let
data
=
{};
let
data
=
{};
res
.
data
.
forEach
((
v
)
=>
{
res
.
data
.
forEach
((
v
)
=>
{
data
[
v
.
spId
]
=
{};
data
[
v
.
spId
]
=
{};
data
[
v
.
spId
]
[
'stock'
]
=
v
.
stock
;
data
[
v
.
spId
]
.
stock
=
v
.
stock
;
data
[
v
.
spId
]
[
'price'
]
=
v
.
price
;
data
[
v
.
spId
]
.
price
=
v
.
price
;
});
});
for
(
let
k
in
shopSpData
)
{
for
(
let
k
in
shopSpData
)
{
le
t
spd
=
shopSpData
[
k
];
cons
t
spd
=
shopSpData
[
k
];
le
t
d
=
data
[
k
]
||
null
;
cons
t
d
=
data
[
k
]
||
null
;
shopSpData
[
k
].
price
=
d
.
price
;
shopSpData
[
k
].
price
=
d
.
price
;
shopSpData
[
k
].
stock
=
d
.
stock
;
shopSpData
[
k
].
stock
=
d
.
stock
;
const
btn
=
this
[
`
${
spd
.
name
}
Btn`
];
this
[
`
${
spd
.
name
}
Label`
].
text
=
`所需欢趣豆:
${
d
?
d
.
price
:
0
}
`
;
this
[
`
${
spd
.
name
}
Label`
].
text
=
`所需欢趣豆:
${
d
?
d
.
price
:
0
}
`
;
(
d
&&
d
.
stock
>
0
)
if
(
d
&&
d
.
stock
>
0
)
{
?
function
()
{
// 有库存
btn
.
source
=
'shop_buy_png'
;
this
[
`
${
spd
.
name
}
Btn`
].
source
=
'shop_buy_png'
;
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
buyProp
,
this
);
this
[
`
${
spd
.
name
}
Btn`
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
buyProp
,
this
);
}
else
{
}.
bind
(
this
)()
if
(
btn
.
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
))
{
:
function
()
{
// 无库存
btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
buyProp
,
this
);
if
(
this
[
`
${
spd
.
name
}
Btn`
].
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
))
{
}
this
[
`
${
spd
.
name
}
Btn`
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
buyProp
,
this
);
btn
.
source
=
'shop_none_png'
;
}
}
this
[
`
${
spd
.
name
}
Btn`
].
source
=
'shop_none_png'
;
}.
bind
(
this
)();
}
}
});
});
}
}
...
@@ -314,14 +317,6 @@ export default class ShopScene extends Scene {
...
@@ -314,14 +317,6 @@ export default class ShopScene extends Scene {
}
}
}
}
const
posArr
=
[
[
154
,
64
],
[
154
,
64
],
[
154
,
64
],
[
154
,
64
],
];
// 商店列表
// 商店列表
class
ShopItem
extends
eui
.
ItemRenderer
{
class
ShopItem
extends
eui
.
ItemRenderer
{
public
btn
:
eui
.
Group
;
public
btn
:
eui
.
Group
;
...
@@ -338,6 +333,10 @@ class ShopItem extends eui.ItemRenderer {
...
@@ -338,6 +333,10 @@ class ShopItem extends eui.ItemRenderer {
public
sp_3_label
:
eui
.
Label
;
public
sp_3_label
:
eui
.
Label
;
public
sp_4_group
:
eui
.
Group
;
public
sp_4_group
:
eui
.
Group
;
public
sp_4_label
:
eui
.
Label
;
public
sp_4_label
:
eui
.
Label
;
public
sp_5_group
:
eui
.
Group
;
public
sp_5_label
:
eui
.
Label
;
public
sp_6_group
:
eui
.
Group
;
public
sp_6_label
:
eui
.
Label
;
public
stock_label
:
eui
.
Label
;
public
stock_label
:
eui
.
Label
;
public
mk
:
eui
.
Rect
;
public
mk
:
eui
.
Rect
;
...
@@ -364,7 +363,7 @@ class ShopItem extends eui.ItemRenderer {
...
@@ -364,7 +363,7 @@ class ShopItem extends eui.ItemRenderer {
this
.
btn
.
touchChildren
=
false
;
this
.
btn
.
touchChildren
=
false
;
this
.
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
!
this
.
data
.
canGet
)
{
// 已经合成过则不设置监听
if
(
!
this
.
data
.
canGet
)
{
// 已经合成过则不设置监听
showToast
(
"兑换次数已达上限"
);
showToast
(
"兑换次数已达上限"
);
return
;
return
;
}
}
...
@@ -381,8 +380,9 @@ class ShopItem extends eui.ItemRenderer {
...
@@ -381,8 +380,9 @@ class ShopItem extends eui.ItemRenderer {
// 显示需要的道具
// 显示需要的道具
private
setNeed
()
{
private
setNeed
()
{
let
showList
=
[];
const
showList
=
[];
for
(
let
spk
in
this
.
data
[
'spMap'
])
{
const
spMap
=
this
.
data
.
spMap
;
for
(
let
spk
in
spMap
)
{
showList
.
push
(
spk
);
showList
.
push
(
spk
);
}
}
// 设置道具下的label
// 设置道具下的label
...
@@ -393,15 +393,15 @@ class ShopItem extends eui.ItemRenderer {
...
@@ -393,15 +393,15 @@ class ShopItem extends eui.ItemRenderer {
this
[
`
${
v
}
_label`
].
textFlow
=
<
Array
<
egret
.
ITextElement
>>
[
this
[
`
${
v
}
_label`
].
textFlow
=
<
Array
<
egret
.
ITextElement
>>
[
{
{
text
:
products
[
v
].
toString
(),
text
:
products
[
v
].
toString
(),
style
:
{
"textColor"
:
(
products
[
v
]
<
this
.
data
[
'spMap'
]
[
v
])
?
0xed3330
:
0x855933
}
style
:
{
"textColor"
:
(
products
[
v
]
<
spMap
[
v
])
?
0xed3330
:
0x855933
}
},
},
{
text
:
'/'
+
this
.
data
[
'spMap'
]
[
v
],
style
:
{
"textColor"
:
0x855933
}}
{
text
:
'/'
+
spMap
[
v
],
style
:
{
"textColor"
:
0x855933
}}
];
];
});
});
``
// 显示+号
// 显示+号
for
(
let
i
=
1
;
i
<
showList
.
length
;
i
++
)
{
for
(
let
i
=
1
;
i
<
showList
.
length
;
i
++
)
{
this
[
`add
${
i
}
`
].
visible
=
true
;
this
[
`add
${
i
}
`
].
visible
=
true
;
}
}
}
}
}
}
\ No newline at end of file
mock/config.js
View file @
5ef21c09
...
@@ -344,6 +344,9 @@ const config = {
...
@@ -344,6 +344,9 @@ const config = {
'/projectx/{projectId}/join_8/join.do'
:
{
'/projectx/{projectId}/join_8/join.do'
:
{
data
:
'./joyousManor/useProp.json'
data
:
'./joyousManor/useProp.json'
},
},
'/projectx/{projectId}/join_9/join.do'
:
{
data
:
'./joyousManor/join_9.json'
},
};
};
...
@@ -365,4 +368,4 @@ for (let item in config) {
...
@@ -365,4 +368,4 @@ for (let item in config) {
config
[
item
].
path
=
path
.
resolve
(
__dirname
,
config
[
item
].
data
);
config
[
item
].
path
=
path
.
resolve
(
__dirname
,
config
[
item
].
data
);
}
}
}
}
module
.
exports
=
config
;
module
.
exports
=
config
;
\ No newline at end of file
mock/joyousManor/consumerInfo.json
View file @
5ef21c09
{
{
"code"
:
null
,
"code"
:
null
,
"data"
:
{
"data"
:
{
"nickname"
:
"12345678"
"nickname"
:
"12345678"
,
"newUser"
:
false
,
"popup"
:
false
},
},
"message"
:
null
,
"message"
:
null
,
"success"
:
true
"success"
:
true
}
}
\ No newline at end of file
mock/joyousManor/getLandInfo.json
View file @
5ef21c09
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
"feedLeftSeconds"
:
1111
,
"feedLeftSeconds"
:
1111
,
"feedNum"
:
20
,
"feedNum"
:
20
,
"id"
:
1
,
"id"
:
1
,
"level"
:
1
,
"level"
:
3
,
"petId"
:
1
"petId"
:
0
},
},
{
{
"canFeed"
:
false
,
"canFeed"
:
false
,
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
"feedLeftSeconds"
:
8888
,
"feedLeftSeconds"
:
8888
,
"feedNum"
:
20
,
"feedNum"
:
20
,
"id"
:
2
,
"id"
:
2
,
"level"
:
2
,
"level"
:
3
,
"petId"
:
2
"petId"
:
5
},
},
{
{
"canFeed"
:
true
,
"canFeed"
:
true
,
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
"feedLeftSeconds"
:
10000
,
"feedLeftSeconds"
:
10000
,
"feedNum"
:
30
,
"feedNum"
:
30
,
"id"
:
3
,
"id"
:
3
,
"level"
:
3
,
"level"
:
4
,
"petId"
:
0
"petId"
:
5
},
},
{
{
"canFeed"
:
false
,
"canFeed"
:
false
,
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
"feedLeftSeconds"
:
10000
,
"feedLeftSeconds"
:
10000
,
"feedNum"
:
20
,
"feedNum"
:
20
,
"id"
:
4
,
"id"
:
4
,
"level"
:
2
,
"level"
:
4
,
"petId"
:
4
"petId"
:
6
}
}
],
],
"message"
:
null
,
"message"
:
null
,
...
...
mock/joyousManor/join_9.json
0 → 100644
View file @
5ef21c09
{
"success"
:
true
,
"message"
:
""
,
"code"
:
""
,
"data"
:
null
}
\ No newline at end of file
mock/joyousManor/priceInfo.json
View file @
5ef21c09
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
"sp_1"
:
50
,
"sp_1"
:
50
,
"sp_2"
:
20
,
"sp_2"
:
20
,
"sp_3"
:
10
,
"sp_3"
:
10
,
"sp_4"
:
5
"sp_4"
:
5
,
"sp_5"
:
5
,
"sp_6"
:
5
}
}
}
}
\ No newline at end of file
mock/joyousManor/prizeInfo.json
View file @
5ef21c09
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
"data"
:
{
"data"
:
{
"sss_item_1"
:
{
"sss_item_1"
:
{
"spMap"
:
{
"spMap"
:
{
"sp_1"
:
1
"sp_1"
:
1
,
"sp_5"
:
1
,
"sp_6"
:
1
},
},
"stock"
:
98
"stock"
:
98
},
},
...
@@ -40,4 +42,4 @@
...
@@ -40,4 +42,4 @@
},
},
"message"
:
null
,
"message"
:
null
,
"success"
:
true
"success"
:
true
}
}
\ No newline at end of file
mock/joyousManor/propInfo.json
View file @
5ef21c09
...
@@ -13,6 +13,16 @@
...
@@ -13,6 +13,16 @@
"stock"
:
500
,
"stock"
:
500
,
"price"
:
700
"price"
:
700
},
},
{
"spId"
:
"sp_5"
,
"stock"
:
500
,
"price"
:
700
},
{
"spId"
:
"sp_6"
,
"stock"
:
500
,
"price"
:
700
},
{
{
"spId"
:
"sp_prop_1"
,
"spId"
:
"sp_prop_1"
,
"stock"
:
500
,
"stock"
:
500
,
...
@@ -29,4 +39,4 @@
...
@@ -29,4 +39,4 @@
"price"
:
300
"price"
:
300
}
}
]
]
}
}
\ No newline at end of file
mock/joyousManor/saleInfo.json
View file @
5ef21c09
...
@@ -40,16 +40,16 @@
...
@@ -40,16 +40,16 @@
{
{
"credits"
:
100
,
"credits"
:
100
,
"date"
:
1576223937000
,
"date"
:
1576223937000
,
"sp"
:
"sp_
1
"
,
"sp"
:
"sp_
6
"
,
"spCount"
:
2
"spCount"
:
2
},
},
{
{
"credits"
:
50
,
"credits"
:
50
,
"date"
:
1573574400000
,
"date"
:
1573574400000
,
"sp"
:
"sp_
1
"
,
"sp"
:
"sp_
5
"
,
"spCount"
:
1
"spCount"
:
1
}
}
],
],
"message"
:
null
,
"message"
:
null
,
"success"
:
true
"success"
:
true
}
}
\ No newline at end of file
mock/joyousManor/taskInfo.json
View file @
5ef21c09
...
@@ -28,8 +28,24 @@
...
@@ -28,8 +28,24 @@
"spFood2RewardNum"
:
30
,
"spFood2RewardNum"
:
30
,
"status"
:
0
,
"status"
:
0
,
"type"
:
1
"type"
:
1
},
{
"id"
:
5
,
"spFood1RewardNum"
:
20
,
"spFood2RewardNum"
:
30
,
"status"
:
0
,
"type"
:
1
,
"url"
:
"https://www.baidu.com"
},
{
"id"
:
6
,
"spFood1RewardNum"
:
20
,
"spFood2RewardNum"
:
30
,
"status"
:
0
,
"type"
:
1
,
"url"
:
"https://www.baidu.com"
}
}
],
],
"message"
:
null
,
"message"
:
null
,
"success"
:
true
"success"
:
true
}
}
\ No newline at end of file
mock/projectX/getUserSpList.json
View file @
5ef21c09
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
"sp_2"
:
5
,
"sp_2"
:
5
,
"sp_3"
:
10
,
"sp_3"
:
10
,
"sp_4"
:
100
,
"sp_4"
:
100
,
"sp_5"
:
100
,
"sp_6"
:
100
,
"sp_food_1"
:
100
,
"sp_food_1"
:
100
,
"sp_food_2"
:
100
,
"sp_food_2"
:
100
,
"sp_prop_1"
:
100
,
"sp_prop_1"
:
100
,
...
@@ -15,4 +17,4 @@
...
@@ -15,4 +17,4 @@
"sp_achv_1"
:
1
,
"sp_achv_1"
:
1
,
"sp_achv_2"
:
1
"sp_achv_2"
:
1
}
}
}
}
\ No newline at end of file
mock/projectX/mergeQuery.json
View file @
5ef21c09
{
{
"data"
:
{
"data"
:
{
"ru_item_10"
:
"{
\"
success
\"
:false}"
,
"ru_item_1"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100_100s.67c4f9ad32da23d0b5f838b48cbda0983591f4d9.jpg
\"
,
\"
id
\"
:
\"
odd16ea0b
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物1_@_介绍一下这个商品真的很值很值很值很值很值很值很值很值很值很值很值很值,买了不会后悔的赶紧兑换吧
\"
,
\"
prizeId
\"
:
\"
sss_item_1
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34024
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_20"
:
"{
\"
success
\"
:false}"
,
"ru_item_2"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100_100s.67c4f9ad32da23d0b5f838b48cbda0983591f4d9.jpg
\"
,
\"
id
\"
:
\"
odd16ea0b
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物1_@_介绍一下这个商品真的很值很值很值很值很值很值很值很值很值很值很值很值,买了不会后悔的赶紧兑换吧
\"
,
\"
prizeId
\"
:
\"
sss_item_2
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34024
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_1"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100_100s.67c4f9ad32da23d0b5f838b48cbda0983591f4d9.jpg
\"
,
\"
id
\"
:
\"
odd16ea0b
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物1_@_介绍一下这个商品真的很值很值很值很值很值很值很值很值很值很值很值很值,买了不会后悔的赶紧兑换吧
\"
,
\"
prizeId
\"
:
\"
sss_item_2
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34024
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_3"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100-100(4).42ece1fc6b6906e343b419e9d445a3f96581d6f0.jpg
\"
,
\"
id
\"
:
\"
oca9a51f6
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物2_@_这个商品是限量的,同志们冲啊!!123!@$ASDsdfsdf
\"
,
\"
prizeId
\"
:
\"
sss_item_3
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34025
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_3"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100-100.29be0c52b59853280da74d8d28fccb90bba690c7.png
\"
,
\"
id
\"
:
\"
oc47f0131
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3_@_欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3
\"
,
\"
prizeId
\"
:
\"
sss_item_4
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34026
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_4"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100-100.29be0c52b59853280da74d8d28fccb90bba690c7.png
\"
,
\"
id
\"
:
\"
oc47f0131
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3_@_欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3欢趣农场实物3
\"
,
\"
prizeId
\"
:
\"
sss_item_4
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34026
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_2"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/100-100(4).42ece1fc6b6906e343b419e9d445a3f96581d6f0.jpg
\"
,
\"
id
\"
:
\"
oca9a51f6
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物2_@_这个商品是限量的,同志们冲啊!!123!@$ASDsdfsdf
\"
,
\"
prizeId
\"
:
\"
sss_item_3
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34025
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_5"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.dui88.com/projectxh5/object-250-250.png
\"
,
\"
id
\"
:
\"
ob5b4b54c
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物4
\"
,
\"
prizeId
\"
:
\"
sss_item_5
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34027
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
"ru_item_5"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/polaris/208-120.6bcd7de68e3ce00e5c2b15362dc353d5b9a273bf.jpg
\"
,
\"
id
\"
:
\"
oaca2fe96
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物5
\"
,
\"
prizeId
\"
:
\"
sss_item_6
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34028
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_4"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.dui88.com/projectxh5/object-250-250.png
\"
,
\"
id
\"
:
\"
ob5b4b54c
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
欢趣农场实物4
\"
,
\"
prizeId
\"
:
\"
sss_item_5
\"
,
\"
prizeType
\"
:2,
\"
refId
\"
:
\"
34027
\"
,
\"
refType
\"
:
\"
object
\"
},{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:2,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_19"
:
"{
\"
success
\"
:false}"
,
"ru_item_7"
:
"{
\"
success
\"
:false}"
,
"ru_item_6"
:
"{
\"
data
\"
:[{
\"
icon
\"
:
\"
//yun.duiba.com.cn/db-m/app/turntable/circle/images/prize/谢谢参与_6311f27.png
\"
,
\"
id
\"
:
\"
thanks
\"
,
\"
index
\"
:1,
\"
name
\"
:
\"
谢谢参与
\"
,
\"
prizeId
\"
:
\"
thanks
\"
,
\"
prizeType
\"
:0}],
\"
success
\"
:true}"
,
"ru_item_9"
:
"{
\"
success
\"
:false}"
,
"ru_item_16"
:
"{
\"
success
\"
:false}"
,
"ru_item_8"
:
"{
\"
success
\"
:false}"
,
"ru_item_15"
:
"{
\"
success
\"
:false}"
,
"ru_item_18"
:
"{
\"
success
\"
:false}"
,
"ru_item_17"
:
"{
\"
success
\"
:false}"
,
"ru_item_12"
:
"{
\"
success
\"
:false}"
,
"ru_item_11"
:
"{
\"
success
\"
:false}"
,
"ru_item_14"
:
"{
\"
success
\"
:false}"
,
"ru_item_13"
:
"{
\"
success
\"
:false}"
},
},
"success"
:
true
"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