Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
babycare_xiaoxiao
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
王剑峰
babycare_xiaoxiao
Commits
b40b44ea
Commit
b40b44ea
authored
Jul 15, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
2e2ca461
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
553 additions
and
267 deletions
+553
-267
index.html
index.html
+2
-2
babycare.completeTask.json
mock/miniTb/babycare.completeTask.json
+6
-0
babycare.consumerTools.json
mock/miniTb/babycare.consumerTools.json
+12
-0
babycare.dojoin.json
mock/miniTb/babycare.dojoin.json
+8
-0
babycare.exchange.json
mock/miniTb/babycare.exchange.json
+9
-0
babycare.gameOver.json
mock/miniTb/babycare.gameOver.json
+11
-0
babycare.getGameInfo.json
mock/miniTb/babycare.getGameInfo.json
+63
-0
babycare.getIndex.json
mock/miniTb/babycare.getIndex.json
+1
-1
babycare.getPrizesByLevel.json
mock/miniTb/babycare.getPrizesByLevel.json
+49
-0
babycare.getTaskList.json
mock/miniTb/babycare.getTaskList.json
+38
-0
babycare.queryCredits.json
mock/miniTb/babycare.queryCredits.json
+9
-0
babycare.receiveTaskRewards.json
mock/miniTb/babycare.receiveTaskRewards.json
+6
-0
settingBg.png
resource/playScene/settingBg.png
+0
-0
res.json
resource/res.json
+34
-48
ResJson.ts
src/ResJson.ts
+34
-48
TaoBaoNet.ts
src/TaoBaoNet.ts
+55
-3
Tools.ts
src/Tools.ts
+94
-1
ToolsOutPanel.ts
src/panels/ToolsOutPanel.ts
+13
-8
PlayScene.ts
src/scene/PlayScene.ts
+102
-150
getChapter.ts
src/something/chapters/getChapter.ts
+6
-6
PropType.ts
src/something/enum/PropType.ts
+1
-0
No files found.
index.html
View file @
b40b44ea
...
...
@@ -32,9 +32,9 @@
height
:
100%
;
overflow
:
hidden
;
position
:
absolute
;
/* background-color: #000000; */
background-color
:
#f5cccd
;
/* background: linear-gradient(#93dbb7,#ff0,#b5d89a); */
background
:
linear-gradient
(
#93dbb7
,
#b5d89a
);
/* background: linear-gradient(#93dbb7,#b5d89a); */
}
</style>
</head>
...
...
mock/miniTb/babycare.completeTask.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
1
,
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.consumerTools.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
{
"tools"
:
{
"HAMMERS"
:
1
,
"STEPS"
:
0
,
"BOOMS"
:
0
}
},
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.dojoin.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
{
"power"
:
3
},
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.exchange.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"530001"
,
"data"
:
{
"isvip"
:
false
,
"url"
:
"//market.m.taobao.com/apps/market/shopmember/index.html?wh_weex=true&sellerId=2207623078795&extraInfo=%7B%22source%22%3A%22isvapp%22%2C%22entrance%22%3A%22duiba%22%7D"
},
"success"
:
false
,
"message"
:
"需要成为会员"
}
\ No newline at end of file
mock/miniTb/babycare.gameOver.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
{
"currentLevel"
:
11
,
"prize"
:
{},
"isPrizeLevel"
:
false
,
"tool"
:
{}
},
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.getGameInfo.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
{
"currentLevel"
:
11
,
"visitors"
:
[
{
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"score"
:
10000
,
"level"
:
120
,
"createTime"
:
1594370024407
,
"openId"
:
"AAHuCvE-ALiIWXYsJuTb5S4W"
,
"isVisitSuccess"
:
true
,
"updateTime"
:
1594370024407
,
"_id"
:
"5f0827e89da67191b6b29261"
,
"stars"
:
3
,
"isPrizeLevel"
:
false
,
"sendAwardType"
:
true
},
{
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"score"
:
10000
,
"level"
:
10
,
"createTime"
:
1594370106090
,
"openId"
:
"AAHuCvE-ALiIWXYsJuTb5S4W"
,
"isVisitSuccess"
:
true
,
"updateTime"
:
1594370106090
,
"_id"
:
"5f08283a75cfb693ea1b3d5b"
,
"stars"
:
3
,
"isPrizeLevel"
:
true
,
"sendAwardType"
:
"prize"
},
{
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"score"
:
10000
,
"level"
:
1
,
"createTime"
:
1594369315957
,
"openId"
:
"AAHuCvE-ALiIWXYsJuTb5S4W"
,
"isVisitSuccess"
:
true
,
"updateTime"
:
1594369868256
,
"_id"
:
"5f082523c3ad3494b92036bf"
,
"stars"
:
3
,
"isPrizeLevel"
:
false
,
"sendAwardType"
:
true
}
],
"prizes"
:
[
{
"receiveTime"
:
""
,
"level"
:
120
,
"isReceive"
:
false
}
],
"power"
:
3
,
"tools"
:
{
"HAMMERS"
:
1
,
"STEPS"
:
0
,
"BOOMS"
:
0
},
"topAward"
:
""
},
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.getIndex.json
View file @
b40b44ea
...
...
@@ -4,7 +4,7 @@
"message"
:
"OK"
,
"data"
:
{
"power"
:
100
,
"currentLevel"
:
1
,
"currentLevel"
:
1
20
,
"tools"
:
{
"STEPS"
:
1
,
"BOOMS"
:
2
,
...
...
mock/miniTb/babycare.getPrizesByLevel.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
[
{
"switchStock"
:
1
,
"image"
:
"https://img.alicdn.com/imgextra/i2/2275046294/O1CN01c4rCs11wMhRrsjEep_!!2275046294-2-miniprogram.png"
,
"isBackUp"
:
false
,
"properiodto"
:
1600
,
"level"
:
1
,
"probability"
:
"16"
,
"openId"
:
"AAFwCvE-ALiIWXYsJuTQVRpH"
,
"prizeType"
:
60
,
"updateTime"
:
1594623032191
,
"type"
:
3
,
"properiodfrom"
:
1
,
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"ename"
:
""
,
"lockStatus"
:
1
,
"credits"
:
""
,
"createTime"
:
1594361933509
,
"deleteStatus"
:
1
,
"name"
:
"60关奖品3"
,
"useStock"
:
1
,
"rank"
:
""
,
"_id"
:
"5f08084e0cb7338a0a377c8e"
,
"id"
:
""
,
"stock"
:
200
},
{
"isBackUp"
:
true
,
"properiodto"
:
10000
,
"level"
:
2
,
"probability"
:
"84"
,
"prizeType"
:
60
,
"updateTime"
:
1594623032197
,
"type"
:
5
,
"properiodfrom"
:
1601
,
"activityId"
:
"5f08084ec3ad3494b9201c0e"
,
"lockStatus"
:
1
,
"createTime"
:
1594623032197
,
"deleteStatus"
:
1
,
"name"
:
"谢谢参与"
,
"useStock"
:
0
,
"_id"
:
"5f0c043852bbde91d1ca5682"
}
],
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.getTaskList.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
[
{
"taskType"
:
"member"
,
"times"
:
1
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"rewards"
:
65
},
{
"taskType"
:
"invites"
,
"times"
:
3
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"value"
:
""
,
"rewards"
:
10
},
{
"taskType"
:
"follow"
,
"times"
:
1
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"value"
:
""
,
"rewards"
:
7
},
{
"taskType"
:
"browseGoods"
,
"times"
:
3
,
"todayCompleteTimes"
:
0
,
"waitReceive"
:
0
,
"value"
:
""
,
"rewards"
:
10
}
],
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
mock/miniTb/babycare.queryCredits.json
0 → 100644
View file @
b40b44ea
{
"success"
:
false
,
"message"
:
"您还不是会员"
,
"data"
:
{
"isvip"
:
false
,
"url"
:
"xxx"
,
"credits"
:
1111
}
}
\ No newline at end of file
mock/miniTb/babycare.receiveTaskRewards.json
0 → 100644
View file @
b40b44ea
{
"code"
:
"000000"
,
"data"
:
1
,
"success"
:
true
,
"message"
:
"成功"
}
\ No newline at end of file
resource/playScene/settingBg.png
0 → 100644
View file @
b40b44ea
1.56 KB
resource/res.json
View file @
b40b44ea
This diff is collapsed.
Click to expand it.
src/ResJson.ts
View file @
b40b44ea
This diff is collapsed.
Click to expand it.
src/TaoBaoNet.ts
View file @
b40b44ea
...
...
@@ -9,9 +9,61 @@ export enum TbNetName {
* activityId params elemType
*/
trackingReport
=
"squirrelsAdoptRest2c.trackingReport"
,
/**
* 进入活动调用, 刷新数据不调用该接口
* activityId userNick avatar follow inviteId
*/
getIndex
=
"babycare.getIndex"
,
/**
* 获取游戏信息
* activityId
*/
getGameInfo
=
"babycare.getGameInfo"
,
/**
* 消耗道具 ,会返回剩余所有道具数量
* activityId type
*/
consumerTools
=
"babycare.consumerTools"
,
/**
* 提交分数
* activityId level score stars isVisitSuccess(是否通关)
*/
gameOver
=
"babycare.gameOver"
,
/**
* 领取任务奖励
* activityId taskType
*/
receiveTaskRewards
=
"babycare.receiveTaskRewards"
,
/**
* 积分兑换道具和体力
* activityId type credits
*/
exchange
=
"babycare.exchange"
,
/**
* 根据等级获取奖品列表
* activityId level
*/
getPrizesByLevel
=
"babycare.getPrizesByLevel"
,
/**
* 查询用户积分
* activityId
*/
queryCredits
=
"babycare.queryCredits"
,
/**
* 开始闯关,会返回体力值
* activityId level
*/
dojoin
=
"babycare.dojoin"
,
/**
* 完成任务(浏览商品详情页, 关注店铺)
* activityId taskType
*/
completeTask
=
"babycare.completeTask"
,
/**
* 任务列表
* activityId
*/
getTaskList
=
"babycare.getTaskList"
,
///////////////////前端调用接口都加个mine
...
...
@@ -35,7 +87,7 @@ export enum TbNetName {
*/
getAdoptName
=
"mine.getAdoptName"
,
//基本都是前端同步方法
//
/////////////////////////
基本都是前端同步方法
/**
* 获取参数
*/
...
...
src/Tools.ts
View file @
b40b44ea
...
...
@@ -4,6 +4,7 @@ import Tween = FYGE.Tween;
import
DisplayObject
=
FYGE
.
DisplayObject
;
import
Ease
=
FYGE
.
Ease
;
import
{
sendTbNet
,
TbNetName
}
from
"./TaoBaoNet"
;
import
{
PropType
}
from
"./something/enum/PropType"
;
/**
* 定制,记录一些全局量和方法
...
...
@@ -28,7 +29,99 @@ export class Tools {
"inviteId"
:
string
,
"isFollow"
:
boolean
}
/**
* 游戏数据,需要根据接口维护
*/
public
static
gameData
:
{
"currentLevel"
:
number
,
"visitors"
:
{
"score"
:
number
,
"level"
:
number
,
"isVisitSuccess"
:
boolean
,
"stars"
:
number
,
}[],
"prizes"
:
{
"receiveTime"
:
string
,
//number
"level"
:
number
,
"isReceive"
:
boolean
}[],
"power"
:
number
,
"tools"
:
{
"HAMMERS"
:
number
,
"STEPS"
:
number
,
"BOOMS"
:
number
},
"isFristLogin"
:
boolean
,
//是否是首次
"topAward"
:
any
//120关自动开奖
}
/**
* 首页数据,loading页面执行一次
*/
public
static
getIndex
()
{
return
new
Promise
((
r
)
=>
{
sendTbNet
(
TbNetName
.
getIndex
,
{
userNick
:
this
.
globalData
.
nickName
,
avatar
:
this
.
globalData
.
avatar
,
follow
:
this
.
globalData
.
isFollow
,
inviteId
:
this
.
globalData
.
inviteId
,
},
(
s
,
res
)
=>
{
if
(
s
)
this
.
gameData
=
res
.
data
;
r
(
s
);
})
})
}
/**
* 进入地图页面刷新
*/
public
static
getGameInfo
()
{
return
new
Promise
((
r
)
=>
{
sendTbNet
(
TbNetName
.
getGameInfo
,
(
s
,
res
)
=>
{
if
(
s
)
this
.
gameData
=
res
.
data
;
r
(
s
);
})
})
}
/**
* 消耗道具
*/
public
static
consumerTools
(
type
:
PropType
):
Promise
<
boolean
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
sendTbNet
(
TbNetName
.
consumerTools
,
{
type
},
(
s
,
res
)
=>
{
if
(
s
)
{
//修改道具数量
this
.
gameData
.
tools
=
res
.
data
.
tools
;
// resolve(res);//数据按照gameData的更新,不返回
resolve
(
true
)
}
else
{
reject
()
}
})
})
}
/**
* 兑换道具,根据返回参数判断
*/
public
static
async
exchange
(
type
:
PropType
):
Promise
<
boolean
|
string
>
{
//先获取积分,判断是否有积分
var
creditsData
=
await
sendTbNet
(
TbNetName
.
queryCredits
)
//接口失败,没数据时,返回false
if
(
!
creditsData
||
!
creditsData
.
data
)
{
return
false
}
//非会员,返回会员路径
if
(
creditsData
&&
!
creditsData
.
success
&&
!
creditsData
.
data
.
isvip
)
{
return
creditsData
.
data
.
url
}
const
res
=
await
sendTbNet
(
TbNetName
.
exchange
,
{
type
,
credits
:
creditsData
.
data
.
credits
})
if
(
res
.
success
)
{
//修改道具数量和体力
this
.
gameData
.
power
=
res
.
data
.
power
;
this
.
gameData
.
tools
=
res
.
data
.
tools
;
return
true
;
//可根据gameData修改视图
}
else
{
return
false
;
}
}
/**
* 询问权限用
*/
...
...
src/panels/ToolsOutPanel.ts
View file @
b40b44ea
import
{
Panel
}
from
"../../module/views/Panel"
;
import
{
PropType
}
from
"../something/enum/PropType"
;
export
class
ToolsOutPanel
extends
Panel
{
get
groupNames
()
{
return
[
"ToolsOutPanel"
]
}
get
skinName
()
{
return
"ToolsOutPanel"
}
consideBtn
:
FYGE
.
Button
;
sureBtn
:
FYGE
.
Button
;
closeBtn
:
FYGE
.
Button
;
msgTxt
:
FYGE
.
TextField
;
consideBtn
:
FYGE
.
Button
;
sureBtn
:
FYGE
.
Button
;
closeBtn
:
FYGE
.
Button
;
msgTxt
:
FYGE
.
TextField
;
data
:
{
type
:
PropType
;
}
initUi
()
{
...
...
src/scene/PlayScene.ts
View file @
b40b44ea
This diff is collapsed.
Click to expand it.
src/something/chapters/getChapter.ts
View file @
b40b44ea
...
...
@@ -23,12 +23,12 @@ const chapters: ChapterData[] = [].concat(
Chapters4
,
Chapters5
,
Chapters6
,
Chapters7
,
Chapters8
,
Chapters9
,
Chapters10
,
Chapters11
,
Chapters12
,
//
Chapters7,
//
Chapters8,
//
Chapters9,
//
Chapters10,
//
Chapters11,
//
Chapters12,
)
/**
* 获取关卡数据,返回关卡数据
...
...
src/something/enum/PropType.ts
View file @
b40b44ea
...
...
@@ -5,4 +5,5 @@ export enum PropType {
STEPS
=
"STEPS"
,
BOOMS
=
"BOOMS"
,
HAMMERS
=
"HAMMERS"
,
POWER
=
"POWER"
,
}
\ 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