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
c7d582ff
Commit
c7d582ff
authored
Aug 13, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
2b5c25f1
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
313 additions
and
86 deletions
+313
-86
babycare.getIndex.json
mock/miniTb/babycare.getIndex.json
+6
-1
output.js
output.js
+154
-41
output.js.map
output.js.map
+1
-1
powerImg.png
resource/common/powerImg.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+49
-38
Tools.ts
src/Tools.ts
+11
-2
WxPrizePanel.ts
src/panels/WxPrizePanel.ts
+72
-0
LoadingScene.ts
src/scene/LoadingScene.ts
+1
-1
MapScene.ts
src/scene/map/MapScene.ts
+18
-1
No files found.
mock/miniTb/babycare.getIndex.json
View file @
c7d582ff
...
@@ -444,6 +444,11 @@
...
@@ -444,6 +444,11 @@
"topAward"
:
{
"topAward"
:
{
"openPrizeStatus"
:
true
,
"openPrizeStatus"
:
true
,
"prize"
:
{}
"prize"
:
{}
},
"wxOriginPrize"
:
{
"type"
:
9
,
"name"
:
"阿三的"
,
"rewardNum"
:
5
}
}
},
},
"success"
:
true
,
"success"
:
true
,
...
...
output.js
View file @
c7d582ff
This diff is collapsed.
Click to expand it.
output.js.map
View file @
c7d582ff
This diff is collapsed.
Click to expand it.
resource/common/powerImg.png
0 → 100644
View file @
c7d582ff
11.4 KB
resource/res.json
View file @
c7d582ff
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"name"
:
"BuyPowerPanel"
"name"
:
"BuyPowerPanel"
},
},
{
{
"keys"
:
"boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,stepBtn.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png"
,
"keys"
:
"boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,
powerImg.png,
stepBtn.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png"
,
"name"
:
"common"
"name"
:
"common"
},
},
{
{
...
...
src/ResJson.ts
View file @
c7d582ff
...
@@ -288,7 +288,7 @@ export const ResJson = {
...
@@ -288,7 +288,7 @@ export const ResJson = {
}
}
},
},
{
{
"keys"
:
"boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,stepBtn.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png"
,
"keys"
:
"boomBtn.png,comCloseBtn.png,comm_light.png,ele0.png,ele1.png,ele10.png,ele11.png,ele12.png,ele13.png,ele14.png,ele2.png,ele3.png,ele4.png,ele5.png,ele6.png,ele7.png,ele8.png,ele9.png,hammerBtn.png,
powerImg.png,
stepBtn.png,toastBg.png,waitingBg.png,waitingRot.png,关闭按钮.png,再想想.png,开始闯关不要能量.png,开始闯关要能量.png,确定.png,继续闯关大.png,继续闯关小.png"
,
"name"
:
"common"
,
"name"
:
"common"
,
"atlas"
:
{
"atlas"
:
{
"boomBtn.png"
:
{
"boomBtn.png"
:
{
...
@@ -303,8 +303,8 @@ export const ResJson = {
...
@@ -303,8 +303,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"comCloseBtn.png"
:
{
"comCloseBtn.png"
:
{
"x"
:
34
7
,
"x"
:
34
0
,
"y"
:
908
,
"y"
:
890
,
"w"
:
48
,
"w"
:
48
,
"h"
:
48
,
"h"
:
48
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -325,8 +325,8 @@ export const ResJson = {
...
@@ -325,8 +325,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele0.png"
:
{
"ele0.png"
:
{
"x"
:
188
,
"x"
:
342
,
"y"
:
762
,
"y"
:
598
,
"w"
:
80
,
"w"
:
80
,
"h"
:
66
,
"h"
:
66
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -336,19 +336,19 @@ export const ResJson = {
...
@@ -336,19 +336,19 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"ele1.png"
:
{
"ele1.png"
:
{
"x"
:
279
,
"x"
:
421
,
"y"
:
922
,
"y"
:
528
,
"w"
:
66
,
"w"
:
66
,
"h"
:
72
,
"h"
:
72
,
"ox"
:
7
,
"ox"
:
7
,
"oy"
:
8
,
"oy"
:
8
,
"sw"
:
80
,
"sw"
:
80
,
"sh"
:
80
,
"sh"
:
80
,
"ro"
:
fals
e
"ro"
:
tru
e
},
},
"ele10.png"
:
{
"ele10.png"
:
{
"x"
:
256
,
"x"
:
460
,
"y"
:
761
,
"y"
:
443
,
"w"
:
76
,
"w"
:
76
,
"h"
:
74
,
"h"
:
74
,
"ox"
:
2
,
"ox"
:
2
,
...
@@ -358,8 +358,8 @@ export const ResJson = {
...
@@ -358,8 +358,8 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"ele11.png"
:
{
"ele11.png"
:
{
"x"
:
211
,
"x"
:
410
,
"y"
:
844
,
"y"
:
597
,
"w"
:
76
,
"w"
:
76
,
"h"
:
74
,
"h"
:
74
,
"ox"
:
2
,
"ox"
:
2
,
...
@@ -369,8 +369,8 @@ export const ResJson = {
...
@@ -369,8 +369,8 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"ele12.png"
:
{
"ele12.png"
:
{
"x"
:
211
,
"x"
:
410
,
"y"
:
844
,
"y"
:
597
,
"w"
:
76
,
"w"
:
76
,
"h"
:
74
,
"h"
:
74
,
"ox"
:
2
,
"ox"
:
2
,
...
@@ -380,8 +380,8 @@ export const ResJson = {
...
@@ -380,8 +380,8 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"ele13.png"
:
{
"ele13.png"
:
{
"x"
:
287
,
"x"
:
352
,
"y"
:
839
,
"y"
:
528
,
"w"
:
67
,
"w"
:
67
,
"h"
:
67
,
"h"
:
67
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -391,8 +391,8 @@ export const ResJson = {
...
@@ -391,8 +391,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele14.png"
:
{
"ele14.png"
:
{
"x"
:
332
,
"x"
:
277
,
"y"
:
754
,
"y"
:
915
,
"w"
:
61
,
"w"
:
61
,
"h"
:
66
,
"h"
:
66
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -402,8 +402,8 @@ export const ResJson = {
...
@@ -402,8 +402,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele2.png"
:
{
"ele2.png"
:
{
"x"
:
118
,
"x"
:
272
,
"y"
:
762
,
"y"
:
598
,
"w"
:
80
,
"w"
:
80
,
"h"
:
68
,
"h"
:
68
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -413,19 +413,19 @@ export const ResJson = {
...
@@ -413,19 +413,19 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"ele3.png"
:
{
"ele3.png"
:
{
"x"
:
2
80
,
"x"
:
2
72
,
"y"
:
598
,
"y"
:
680
,
"w"
:
72
,
"w"
:
72
,
"h"
:
70
,
"h"
:
70
,
"ox"
:
4
,
"ox"
:
4
,
"oy"
:
10
,
"oy"
:
10
,
"sw"
:
80
,
"sw"
:
80
,
"sh"
:
80
,
"sh"
:
80
,
"ro"
:
tru
e
"ro"
:
fals
e
},
},
"ele4.png"
:
{
"ele4.png"
:
{
"x"
:
2
79
,
"x"
:
2
11
,
"y"
:
678
,
"y"
:
915
,
"w"
:
74
,
"w"
:
74
,
"h"
:
64
,
"h"
:
64
,
"ox"
:
6
,
"ox"
:
6
,
...
@@ -436,7 +436,7 @@ export const ResJson = {
...
@@ -436,7 +436,7 @@ export const ResJson = {
},
},
"ele5.png"
:
{
"ele5.png"
:
{
"x"
:
118
,
"x"
:
118
,
"y"
:
598
,
"y"
:
752
,
"w"
:
80
,
"w"
:
80
,
"h"
:
80
,
"h"
:
80
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -446,15 +446,15 @@ export const ResJson = {
...
@@ -446,15 +446,15 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele6.png"
:
{
"ele6.png"
:
{
"x"
:
211
,
"x"
:
346
,
"y"
:
922
,
"y"
:
680
,
"w"
:
66
,
"w"
:
66
,
"h"
:
72
,
"h"
:
72
,
"ox"
:
7
,
"ox"
:
7
,
"oy"
:
5
,
"oy"
:
5
,
"sw"
:
80
,
"sw"
:
80
,
"sh"
:
80
,
"sh"
:
80
,
"ro"
:
fals
e
"ro"
:
tru
e
},
},
"ele7.png"
:
{
"ele7.png"
:
{
"x"
:
278
,
"x"
:
278
,
...
@@ -468,8 +468,8 @@ export const ResJson = {
...
@@ -468,8 +468,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele8.png"
:
{
"ele8.png"
:
{
"x"
:
118
,
"x"
:
200
,
"y"
:
680
,
"y"
:
752
,
"w"
:
78
,
"w"
:
78
,
"h"
:
80
,
"h"
:
80
,
"ox"
:
1
,
"ox"
:
1
,
...
@@ -479,8 +479,8 @@ export const ResJson = {
...
@@ -479,8 +479,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"ele9.png"
:
{
"ele9.png"
:
{
"x"
:
2
0
0
,
"x"
:
2
8
0
,
"y"
:
598
,
"y"
:
752
,
"w"
:
78
,
"w"
:
78
,
"h"
:
78
,
"h"
:
78
,
"ox"
:
1
,
"ox"
:
1
,
...
@@ -500,6 +500,17 @@ export const ResJson = {
...
@@ -500,6 +500,17 @@ export const ResJson = {
"sh"
:
114
,
"sh"
:
114
,
"ro"
:
false
"ro"
:
false
},
},
"powerImg.png"
:
{
"x"
:
118
,
"y"
:
598
,
"w"
:
152
,
"h"
:
152
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
152
,
"sh"
:
152
,
"ro"
:
false
},
"stepBtn.png"
:
{
"stepBtn.png"
:
{
"x"
:
905
,
"x"
:
905
,
"y"
:
2
,
"y"
:
2
,
...
@@ -534,8 +545,8 @@ export const ResJson = {
...
@@ -534,8 +545,8 @@ export const ResJson = {
"ro"
:
true
"ro"
:
true
},
},
"waitingRot.png"
:
{
"waitingRot.png"
:
{
"x"
:
345
,
"x"
:
292
,
"y"
:
67
2
,
"y"
:
83
2
,
"w"
:
56
,
"w"
:
56
,
"h"
:
56
,
"h"
:
56
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -545,8 +556,8 @@ export const ResJson = {
...
@@ -545,8 +556,8 @@ export const ResJson = {
"ro"
:
false
"ro"
:
false
},
},
"关闭按钮.png"
:
{
"关闭按钮.png"
:
{
"x"
:
198
,
"x"
:
211
,
"y"
:
680
,
"y"
:
834
,
"w"
:
79
,
"w"
:
79
,
"h"
:
79
,
"h"
:
79
,
"ox"
:
0
,
"ox"
:
0
,
...
@@ -8398,5 +8409,5 @@ export const ResJson = {
...
@@ -8398,5 +8409,5 @@ export const ResJson = {
}
}
}
}
],
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/159
6439435
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/babycare_xiaoxiao/159
7303204
/resource/"
}
}
\ No newline at end of file
src/Tools.ts
View file @
c7d582ff
...
@@ -32,7 +32,8 @@ export class Tools {
...
@@ -32,7 +32,8 @@ export class Tools {
"activityId"
:
string
,
"activityId"
:
string
,
"openId"
:
string
,
"openId"
:
string
,
"inviteId"
:
string
,
"inviteId"
:
string
,
"isFollow"
:
boolean
"isFollow"
:
boolean
,
"isFromWx"
:
boolean
,
}
}
/**
/**
* 游戏数据,需要根据接口维护
* 游戏数据,需要根据接口维护
...
@@ -62,7 +63,14 @@ export class Tools {
...
@@ -62,7 +63,14 @@ export class Tools {
"topAward"
:
{
"topAward"
:
{
openPrizeStatus
:
boolean
,
openPrizeStatus
:
boolean
,
prize
:
any
prize
:
any
}
//120关自动开奖
},
//120关自动开奖
"wxOriginPrize"
?:
{
//微信中奖信息
"type"
:
number
,
"name"
:
string
,
"rewardNum"
:
number
,
"code"
?:
string
,
"defaultMsg"
?:
string
}
}
}
public
static
baseInfo
:
{
public
static
baseInfo
:
{
...
@@ -87,6 +95,7 @@ export class Tools {
...
@@ -87,6 +95,7 @@ export class Tools {
avatar
:
this
.
globalData
.
avatar
,
avatar
:
this
.
globalData
.
avatar
,
follow
:
this
.
globalData
.
isFollow
,
follow
:
this
.
globalData
.
isFollow
,
inviteId
:
this
.
globalData
.
inviteId
,
inviteId
:
this
.
globalData
.
inviteId
,
isFromWx
:
this
.
globalData
.
isFromWx
},
(
s
,
res
)
=>
{
},
(
s
,
res
)
=>
{
if
(
s
)
this
.
gameData
=
res
.
data
;
if
(
s
)
this
.
gameData
=
res
.
data
;
r
(
s
);
r
(
s
);
...
...
src/panels/WxPrizePanel.ts
0 → 100644
View file @
c7d582ff
import
{
Panel
}
from
"../../module/views/Panel"
;
import
TextField
=
FYGE
.
TextField
;
import
Button
=
FYGE
.
Button
;
import
Sprite
=
FYGE
.
Sprite
;
import
TEXT_ALIGN
=
FYGE
.
TEXT_ALIGN
;
import
Texture
=
FYGE
.
Texture
;
import
MouseEvent
=
FYGE
.
MouseEvent
;
import
{
sendTbNet
,
TbNetName
}
from
"../TaoBaoNet"
;
import
{
showToast
}
from
"../../module/ctrls"
;
import
{
Tool
}
from
"../something/Tool"
;
import
{
Tools
}
from
"../Tools"
;
import
{
RES
}
from
"../../module/RES"
;
/**
* 处理微信渠道中奖信息,皮肤和资源用的PrizePanel
*/
export
class
WxPrizePanel
extends
Panel
{
get
groupNames
()
{
return
[
"PrizePanel"
]
}
get
skinName
()
{
return
"PrizePanel"
}
protected
get
closeBtns
():
any
[]
{
return
[
this
.
closeBtn
,
this
.
prizeBtn
]
}
closeBtn
:
Button
;
prizeTxt
:
TextField
;
prizeImg
:
Sprite
;
prizeBtn
:
Button
;
data
:
{
"type"
:
number
,
//6(锤子)7(炸弹)8(步数)9(体力)
"name"
:
string
,
"rewardNum"
:
number
}
initUi
()
{
this
.
prizeTxt
.
textAlign
=
TEXT_ALIGN
.
CENTER
;
this
.
prizeTxt
.
textWidth
=
750
;
this
.
prizeTxt
.
x
=
0
;
this
.
prizeTxt
.
text
=
`恭喜获得
${
this
.
data
.
name
}
`
;
this
.
prizeImg
.
anchorTexture
.
x
=
0.5
;
this
.
prizeImg
.
width
=
this
.
prizeImg
.
height
=
220
;
this
.
prizeImg
.
x
=
375
;
this
.
prizeImg
.
texture
=
RES
.
getRes
(
(()
=>
{
var
str
=
"aaaaaa.png"
switch
(
this
.
data
.
type
)
{
case
6
:
//锤子
str
=
"hammerBtn.png"
break
;
case
7
:
//炸弹
str
=
"boomBtn.png"
break
;
case
8
:
//步数
str
=
"stepBtn.png"
break
;
case
9
:
//体力
str
=
"powerImg.png"
break
;
}
return
str
})()
);
}
}
src/scene/LoadingScene.ts
View file @
c7d582ff
...
@@ -110,7 +110,7 @@ export class LoadingScene extends Scene {
...
@@ -110,7 +110,7 @@ export class LoadingScene extends Scene {
Tools
.
globalData
=
data
;
Tools
.
globalData
=
data
;
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.3
)
this
.
dispatchEvent
(
FYGE
.
Event
.
PROGRESS
,
0.3
)
//询问读取权限,不阻止进程
//询问读取权限,不阻止进程
Tools
.
checkPermission
();
// Tools.checkPermission();//这个需要吗?
//获取首页数据
//获取首页数据
var
getIndexSuccesss
=
await
Tools
.
getIndex
()
var
getIndexSuccesss
=
await
Tools
.
getIndex
()
//失败不进入
//失败不进入
...
...
src/scene/map/MapScene.ts
View file @
c7d582ff
...
@@ -13,11 +13,12 @@ import Sprite = FYGE.Sprite;
...
@@ -13,11 +13,12 @@ import Sprite = FYGE.Sprite;
import
Texture
=
FYGE
.
Texture
;
import
Texture
=
FYGE
.
Texture
;
import
Tween
=
FYGE
.
Tween
;
import
Tween
=
FYGE
.
Tween
;
import
Ease
=
FYGE
.
Ease
;
import
Ease
=
FYGE
.
Ease
;
import
{
showPanel
}
from
"../../../module/ctrls"
;
import
{
showPanel
,
showToast
}
from
"../../../module/ctrls"
;
import
{
FreePowerPanel
}
from
"../../panels/FreePowerPanel"
;
import
{
FreePowerPanel
}
from
"../../panels/FreePowerPanel"
;
import
{
PrizePanel
}
from
"../../panels/PrizePanel"
;
import
{
PrizePanel
}
from
"../../panels/PrizePanel"
;
import
{
GTool
}
from
"../../../module/tools/GTool"
;
import
{
GTool
}
from
"../../../module/tools/GTool"
;
import
{
NoPrizePanel
}
from
"../../panels/NoPrizePanel"
;
import
{
NoPrizePanel
}
from
"../../panels/NoPrizePanel"
;
import
{
WxPrizePanel
}
from
"../../panels/WxPrizePanel"
;
export
class
MapScene
extends
Scene
{
export
class
MapScene
extends
Scene
{
private
mapContainer
:
Container
=
null
;
private
mapContainer
:
Container
=
null
;
...
@@ -75,6 +76,22 @@ export class MapScene extends Scene {
...
@@ -75,6 +76,22 @@ export class MapScene extends Scene {
// showPanel(PrizePanel, JSON.parse(JSON.stringify(Tools.gameData.topAward)));
// showPanel(PrizePanel, JSON.parse(JSON.stringify(Tools.gameData.topAward)));
// Tools.gameData.topAward = null;
// Tools.gameData.topAward = null;
// }
// }
//微信渠道抽奖
if
(
Tools
.
gameData
.
wxOriginPrize
)
{
//有奖品
if
(
Tools
.
gameData
.
wxOriginPrize
.
type
&&
//类型存在
Tools
.
gameData
.
wxOriginPrize
.
type
!=
5
//不为谢谢参与
)
{
showPanel
(
WxPrizePanel
,
Tools
.
gameData
.
wxOriginPrize
)
}
//超出限制了
else
if
(
Tools
.
gameData
.
wxOriginPrize
.
defaultMsg
)
{
showToast
(
Tools
.
gameData
.
wxOriginPrize
.
defaultMsg
)
}
//置空数据
Tools
.
gameData
.
wxOriginPrize
=
null
;
}
}
}
private
updateMapCheck
()
{
private
updateMapCheck
()
{
...
...
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