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
07964e5a
Commit
07964e5a
authored
May 08, 2021
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口,进度条修改
parent
fc003ca7
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
88 additions
and
34 deletions
+88
-34
NetName.ts
egret/libs/tw/enum/NetName.ts
+1
-0
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+18
-0
.DS_Store
egret/resource/.DS_Store
+0
-0
.DS_Store
egret/resource/assets/.DS_Store
+0
-0
.DS_Store
egret/resource/assets/index_scene/.DS_Store
+0
-0
进度条_ed.png
egret/resource/assets/index_scene/进度条_ed.png
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
TimeProgressBarSkin.exml
egret/resource/skins/Component/TimeProgressBarSkin.exml
+6
-4
Main.ts
egret/src/Main.ts
+2
-1
Const.ts
egret/src/Scenes/MainScene/Const.ts
+1
-1
LandMgr.ts
egret/src/Scenes/MainScene/LandMgr.ts
+1
-1
MainScene.ts
egret/src/Scenes/MainScene/MainScene.ts
+8
-11
Land.ts
egret/src/Scenes/MainScene/Objs/Land.ts
+1
-0
TimeProgressBar.ts
egret/src/Scenes/MainScene/TimeProgressBar.ts
+4
-2
Tools.ts
egret/src/Tools.ts
+20
-10
config.js
mock/config.js
+3
-0
frontInfo.do.json
mock/game/frontInfo.do.json
+14
-0
frontVariable.json
mock/game/frontVariable.json
+1
-1
consumerInfo.json
mock/joyousManor/consumerInfo.json
+2
-2
No files found.
egret/libs/tw/enum/NetName.ts
View file @
07964e5a
...
@@ -155,4 +155,5 @@ export enum NetName {
...
@@ -155,4 +155,5 @@ export enum NetName {
GAMEGROUP_PRIZE
,
GAMEGROUP_PRIZE
,
frontVariable
,
frontVariable
,
customInfo
,
customInfo
,
frontInfo
}
}
egret/libs/tw/manager/NetManager.ts
View file @
07964e5a
...
@@ -1644,6 +1644,24 @@ export class NetManager extends ABNetManager {
...
@@ -1644,6 +1644,24 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 查看运营配置项
* @callback
*/
public
frontInfo
(
callback
:
Function
){
const
net
:
INetData
=
{
name
:
NetName
.
customInfo
,
uri
:
'/projectx/{projectId}/join_5/frontInfo.do'
,
type
:
'get'
,
dataType
:
'json'
,
param
:
{
},
callback
:
callback
};
this
.
send
(
net
);
}
}
}
// window['nt'] = NetManager.ins;
// window['nt'] = NetManager.ins;
...
...
egret/resource/.DS_Store
View file @
07964e5a
No preview for this file type
egret/resource/assets/.DS_Store
View file @
07964e5a
No preview for this file type
egret/resource/assets/index_scene/.DS_Store
View file @
07964e5a
No preview for this file type
egret/resource/assets/index_scene/进度条_ed.png
0 → 100644
View file @
07964e5a
2.56 KB
egret/resource/default.res.json
View file @
07964e5a
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
"name"
:
"shop"
"name"
:
"shop"
},
},
{
{
"keys"
:
"option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png,奖品12_png,我要兑换按钮2_png,ex_buybtn2_png,ex_close2_png,ex_panda2_png,closebtn2_png,exd_fail_bg2_png,iknowbtn2_png,lightdotimg2_png,roalightbg2_png,roalightimg2_png,hotballoon2_png,option_left2_png,option_right2_png,option_scrollbar2_png,规则背景_png,规则关闭_png,introduce_bg_new_png,introduce_btn_close_png,introduce_btn_new_png,shopPanel_close_png,shop_btn_-_png,shop_btn_+_png,shop_item_bg_big_png,shop_item_cntBg_png,prop_apple_png,prop_papaya_png,shopBuy_close_btn_png,warehouse_close_btn_png,papaya_bg_png,apple_bg_png,sellOutLine_png,sell_+_en_png,sell_-_en_png,task_close_btn_png,浇水3_png,饲料2_png,task_brn_bg_dis_png,欢趣竞猜 icon_png,趣赶集 icon_png,newUserCloseBtn_png,noFeed_bg_png,noFeed_sr_btn_png,noWater_btn_png,noWater_bg_png,oldUserClose_png,sellTitle_apple_png,sellTitle_papaya_png,introduce_apple_png,introduce_papaya_png,横幅_png,index_liba_png"
,
"keys"
:
"option_left_png,option_right_png,option_scrollbar_png,ex_panda_png,ex_buybtn_png,ex_close_png,hotballoon_png,道具数量框_png,光线_png,水_半_png,水_空_png,水_满_png,饲料_半_png,饲料_空_png,饲料_满_png,roalightimg_png,closebtn_png,exd_fail_bg_png,iknowbtn_png,lightdotimg_png,roalightbg_png,奖品1_png,我要兑换按钮_png,奖品12_png,我要兑换按钮2_png,ex_buybtn2_png,ex_close2_png,ex_panda2_png,closebtn2_png,exd_fail_bg2_png,iknowbtn2_png,lightdotimg2_png,roalightbg2_png,roalightimg2_png,hotballoon2_png,option_left2_png,option_right2_png,option_scrollbar2_png,规则背景_png,规则关闭_png,introduce_bg_new_png,introduce_btn_close_png,introduce_btn_new_png,shopPanel_close_png,shop_btn_-_png,shop_btn_+_png,shop_item_bg_big_png,shop_item_cntBg_png,prop_apple_png,prop_papaya_png,shopBuy_close_btn_png,warehouse_close_btn_png,papaya_bg_png,apple_bg_png,sellOutLine_png,sell_+_en_png,sell_-_en_png,task_close_btn_png,浇水3_png,饲料2_png,task_brn_bg_dis_png,欢趣竞猜 icon_png,趣赶集 icon_png,newUserCloseBtn_png,noFeed_bg_png,noFeed_sr_btn_png,noWater_btn_png,noWater_bg_png,oldUserClose_png,sellTitle_apple_png,sellTitle_papaya_png,introduce_apple_png,introduce_papaya_png,横幅_png,index_liba_png
,进度条_ed_png
"
,
"name"
:
"preload"
"name"
:
"preload"
}
}
],
],
...
@@ -1640,6 +1640,11 @@
...
@@ -1640,6 +1640,11 @@
"name"
:
"index_liba_png"
,
"name"
:
"index_liba_png"
,
"type"
:
"image"
,
"type"
:
"image"
,
"url"
:
"assets/index_scene/index_liba.png"
"url"
:
"assets/index_scene/index_liba.png"
},
{
"name"
:
"进度条_ed_png"
,
"type"
:
"image"
,
"url"
:
"assets/index_scene/进度条_ed.png"
}
}
]
]
}
}
\ No newline at end of file
egret/resource/skins/Component/TimeProgressBarSkin.exml
View file @
07964e5a
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"TimeProgressBar"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
width=
"186"
height=
"31"
>
<e:Skin
class=
"TimeProgressBar"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
width=
"186"
height=
"31"
>
<e:Rect
id=
"bg"
fillColor=
"0xffffff"
left=
"0"
top=
"0"
bottom=
"0"
right=
"0"
ellipseWidth=
"
13"
ellipseHeight=
"13
"
/>
<e:Rect
id=
"bg"
fillColor=
"0xffffff"
left=
"0"
top=
"0"
bottom=
"0"
right=
"0"
ellipseWidth=
"
36"
ellipseHeight=
"36
"
/>
<e:Label
id=
"corpName"
text=
"鸡"
size=
"16"
textColor=
"0x000000"
horizontalCenter=
"-70"
verticalCenter=
"0"
/>
<e:Label
id=
"corpName"
text=
"鸡"
size=
"16"
textColor=
"0x000000"
horizontalCenter=
"-70"
verticalCenter=
"0"
/>
<e:Group
width=
"139"
height=
"29"
verticalCenter=
"0"
left=
"46"
>
<e:Group
width=
"139"
height=
"29"
verticalCenter=
"0"
left=
"46"
>
<e:Rect
id=
"progressBar"
ellipseWidth=
"13"
ellipseHeight=
"13"
width=
"139"
height=
"29"
fillColor=
"0x643b14"
x=
"0"
y=
"0"
/>
<e:Rect
id=
"progressBar1"
ellipseWidth=
"13"
ellipseHeight=
"13"
width=
"139"
height=
"29"
fillColor=
"0x643b14"
x=
"0"
y=
"0"
visible=
"false"
/>
<e:Rect
id=
"fillMask"
ellipseWidth=
"13"
ellipseHeight=
"13"
width=
"139"
height=
"29"
fillColor=
"0x643B14"
x=
"0"
y=
"0"
/>
<e:Rect
id=
"fillMask1"
ellipseWidth=
"13"
ellipseHeight=
"13"
width=
"139"
height=
"29"
fillColor=
"0x643B14"
x=
"0"
y=
"0"
visible=
"false"
/>
<e:Rect
id=
"progressFill"
ellipseWidth=
"13"
ellipseHeight=
"13"
width=
"69.5"
height=
"29"
fillColor=
"0xd52c25"
x=
"0"
y=
"0"
/>
<e:Image
id=
"progressBar"
source=
"进度条_ed_png"
x=
"0"
y=
"0"
/>
<e:Image
id=
"fillMask"
source=
"进度条_ed_png"
x=
"0"
y=
"0"
/>
<e:Rect
id=
"progressFill"
ellipseWidth=
"29"
ellipseHeight=
"29"
width=
"69.5"
height=
"29"
fillColor=
"0xd52c25"
x=
"0"
y=
"0"
/>
<e:Label
id=
"progressLabel"
text=
"23时54分后喂食"
size=
"16"
scaleX=
"1"
scaleY=
"1"
textColor=
"0xffffff"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
<e:Label
id=
"progressLabel"
text=
"23时54分后喂食"
size=
"16"
scaleX=
"1"
scaleY=
"1"
textColor=
"0xffffff"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Group>
</e:Group>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/src/Main.ts
View file @
07964e5a
...
@@ -111,7 +111,8 @@ class Main extends eui.UILayer {
...
@@ -111,7 +111,8 @@ class Main extends eui.UILayer {
await
Tools
.
getQuestionList
();
// 问题列表
await
Tools
.
getQuestionList
();
// 问题列表
await
Tools
.
getMedalData
();
// 勋章数据
await
Tools
.
getMedalData
();
// 勋章数据
await
Tools
.
gameGroupPrize
();
// 游戏合集发奖
await
Tools
.
gameGroupPrize
();
// 游戏合集发奖
await
Tools
.
gameFrontVariable
();
//
// await Tools.gameFrontVariable();//
await
Tools
.
gameFrontInfo
();
await
Tools
.
gameCustomInfo
();
await
Tools
.
gameCustomInfo
();
const
areaPrice
=
await
Tools
.
getAreaPrice
();
const
areaPrice
=
await
Tools
.
getAreaPrice
();
...
...
egret/src/Scenes/MainScene/Const.ts
View file @
07964e5a
...
@@ -39,7 +39,7 @@ export let petData = {
...
@@ -39,7 +39,7 @@ export let petData = {
key
:
'wheat'
,
key
:
'wheat'
,
name
:
'水稻'
,
name
:
'水稻'
,
type
:
'plant'
,
type
:
'plant'
,
pos
:
[
-
30
,
-
1
42
],
pos
:
[
-
30
,
-
1
50
],
propId
:
'sp_food_2'
,
propId
:
'sp_food_2'
,
optionSvga
:
'ready_water'
,
optionSvga
:
'ready_water'
,
option
:
'water'
,
option
:
'water'
,
...
...
egret/src/Scenes/MainScene/LandMgr.ts
View file @
07964e5a
...
@@ -29,7 +29,7 @@ import MovieClip = egret.MovieClip;
...
@@ -29,7 +29,7 @@ import MovieClip = egret.MovieClip;
const
landPos
=
[
// 地块位置(注意顺序,影响层级)
const
landPos
=
[
// 地块位置(注意顺序,影响层级)
{
x
:
189
,
y
:
554
},
{
x
:
189
,
y
:
554
},
{
x
:
4
02
,
y
:
66
0
},
{
x
:
4
22
,
y
:
64
0
},
{
x
:
106
,
y
:
725
},
{
x
:
106
,
y
:
725
},
{
x
:
318
,
y
:
835
},
{
x
:
318
,
y
:
835
},
{
x
:
49
,
y
:
942
},
{
x
:
49
,
y
:
942
},
...
...
egret/src/Scenes/MainScene/MainScene.ts
View file @
07964e5a
...
@@ -143,11 +143,9 @@ export default class MainScene extends Scene {
...
@@ -143,11 +143,9 @@ export default class MainScene extends Scene {
/**修改广告位 */
/**修改广告位 */
private
changePoster
()
{
private
changePoster
()
{
let
balloon_url
=
Tools
.
frontdata
.
data
.
balloon_url
;
let
balloonUrl
=
Tools
.
frontInfo
.
data
.
balloonUrl
;
console
.
log
(
'rgreg--->>'
,
balloon_url
);
console
.
log
(
'rgreg--->>'
,
balloonUrl
);
let
data
=
JSON
.
parse
((
balloon_url
));
const
{
body
,
link
,
bodyType
}
=
balloonUrl
;
console
.
log
(
"热气球广告位---》》"
,
data
)
const
{
body
,
link
,
bodyType
}
=
data
;
if
(
bodyType
==
1
){
if
(
bodyType
==
1
){
this
.
posterLabel
.
text
=
body
;
this
.
posterLabel
.
text
=
body
;
this
.
posterGroup
.
visible
=
true
;
this
.
posterGroup
.
visible
=
true
;
...
@@ -264,12 +262,11 @@ export default class MainScene extends Scene {
...
@@ -264,12 +262,11 @@ export default class MainScene extends Scene {
M_HideOption
();
M_HideOption
();
break
;
break
;
case
this
.
posterGroup
:
case
this
.
posterGroup
:
console
.
error
(
"广告数据====?"
,
Tools
.
frontdata
);
console
.
error
(
"广告数据====?"
,
Tools
.
frontInfo
);
if
(
Tools
.
frontdata
&&
Tools
.
frontdata
.
data
&&
Tools
.
frontdata
.
data
.
balloon_url
)
{
if
(
Tools
.
frontInfo
&&
Tools
.
frontInfo
.
data
&&
Tools
.
frontInfo
.
data
.
balloonUrl
)
{
let
balloon_url
=
Tools
.
frontdata
.
data
.
balloon_url
;
let
balloonUrl
=
Tools
.
frontInfo
.
data
.
balloonUrl
;
let
data
=
JSON
.
parse
(
balloon_url
);
console
.
log
(
"热气球广告位---》》"
,
balloonUrl
)
console
.
log
(
"热气球广告位---》》"
,
data
)
const
{
body
,
link
,
bodyType
}
=
balloonUrl
;
const
{
body
,
link
,
bodyType
}
=
data
;
if
(
link
&&
link
.
length
>
4
){
if
(
link
&&
link
.
length
>
4
){
window
.
location
.
href
=
link
;
window
.
location
.
href
=
link
;
}
}
...
...
egret/src/Scenes/MainScene/Objs/Land.ts
View file @
07964e5a
...
@@ -171,6 +171,7 @@ export default class Land extends eui.Component {
...
@@ -171,6 +171,7 @@ export default class Land extends eui.Component {
this
.
updateData
(
this
.
data
);
this
.
updateData
(
this
.
data
);
this
.
crop
=
new
Crop
(
this
.
data
);
this
.
crop
=
new
Crop
(
this
.
data
);
this
.
addChildAt
(
this
.
crop
,
2
);
this
.
addChildAt
(
this
.
crop
,
2
);
// this.rotation = 10;
}
}
// 改变状态积
// 改变状态积
...
...
egret/src/Scenes/MainScene/TimeProgressBar.ts
View file @
07964e5a
...
@@ -5,8 +5,10 @@ import { M_HideOption } from "./Objs/OptionPanel";
...
@@ -5,8 +5,10 @@ import { M_HideOption } from "./Objs/OptionPanel";
export
default
class
TimeProgressBar
extends
eui
.
Component
{
export
default
class
TimeProgressBar
extends
eui
.
Component
{
public
bg
:
eui
.
Rect
;
public
bg
:
eui
.
Rect
;
public
corpName
:
eui
.
Label
;
public
corpName
:
eui
.
Label
;
public
progressBar
:
eui
.
Rect
;
// public progressBar: eui.Rect;
public
fillMask
:
eui
.
Rect
;
public
progressBar
:
eui
.
Image
;
// public fillMask: eui.Rect;
public
fillMask
:
eui
.
Image
;
public
progressFill
:
eui
.
Rect
;
public
progressFill
:
eui
.
Rect
;
public
progressLabel
:
eui
.
Label
;
public
progressLabel
:
eui
.
Label
;
...
...
egret/src/Tools.ts
View file @
07964e5a
...
@@ -4,12 +4,12 @@
...
@@ -4,12 +4,12 @@
* Copyright © 2020 haiyoucuv. All rights reserved.
* Copyright © 2020 haiyoucuv. All rights reserved.
*/
*/
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
To
=
egret
.
tween
.
To
;
import
To
=
egret
.
tween
.
To
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
PanelCtrl
from
"./ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"./types/sceneTypes"
;
import
{
ModuleTypes
}
from
"./types/sceneTypes"
;
import
MedalPanel
from
"./Panels/MedalPanel"
;
import
MedalPanel
from
"./Panels/MedalPanel"
;
import
{
wait
}
from
"./comm/GameConst"
;
import
{
wait
}
from
"./comm/GameConst"
;
export
class
Tools
{
export
class
Tools
{
...
@@ -195,23 +195,33 @@ export class Tools {
...
@@ -195,23 +195,33 @@ export class Tools {
});
});
}
}
public
static
frontdata
=
null
;
public
static
frontdata
=
null
;
public
static
gameFrontVariable
(){
public
static
gameFrontVariable
()
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
NetManager
.
ins
.
frontVariable
((
success
,
res
)
=>
{
NetManager
.
ins
.
frontVariable
((
success
,
res
)
=>
{
this
.
frontdata
=
res
;
this
.
frontdata
=
res
;
resolve
(
true
);
resolve
(
true
);
},
{
keys
:
'balloon_url'
})
},
{
keys
:
'balloon_url'
})
})
})
}
}
public
static
customInfo
=
null
;
public
static
customInfo
=
null
;
public
static
gameCustomInfo
(){
public
static
gameCustomInfo
()
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
NetManager
.
ins
.
customInfo
((
success
,
res
)
=>
{
NetManager
.
ins
.
customInfo
((
success
,
res
)
=>
{
this
.
customInfo
=
res
;
this
.
customInfo
=
res
;
resolve
(
true
);
resolve
(
true
);
})
})
})
})
}
}
public
static
frontInfo
=
null
;
public
static
gameFrontInfo
()
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
frontInfo
((
s
,
res
)
=>
{
this
.
frontInfo
=
res
;
r
(
true
)
})
})
}
}
}
\ No newline at end of file
mock/config.js
View file @
07964e5a
...
@@ -371,6 +371,9 @@ const config = {
...
@@ -371,6 +371,9 @@ const config = {
'/projectx/{projectId}/join_5/customInfo.do'
:
{
'/projectx/{projectId}/join_5/customInfo.do'
:
{
data
:
'./game/customInfo.json'
data
:
'./game/customInfo.json'
},
},
'/projectx/{projectId}/join_5/frontInfo.do'
:
{
data
:
'./game/frontInfo.do.json'
},
};
};
// for (let item in config) {
// for (let item in config) {
...
...
mock/game/frontInfo.do.json
0 → 100644
View file @
07964e5a
{
"success"
:
true
,
"message"
:
""
,
"code"
:
""
,
"data"
:
{
"balloonUrl"
:
{
"body"
:
"1234"
,
"link"
:
"www.bilibli.com"
,
"bodyType"
:
1
},
"dxqRule"
:
"1"
,
"xxlRule"
:
"111"
}
}
\ No newline at end of file
mock/game/frontVariable.json
View file @
07964e5a
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
"success"
:
true
,
"success"
:
true
,
"message"
:
""
,
"message"
:
""
,
"code"
:
""
,
"code"
:
""
,
"data"
:
{
"balloon_url"
:
"{
\"
body
\"
:
\"
123
\"
,
\"
link
\"
:
\"
www.baidu.com
\"
,
\"
bodyType
\"
:
2
}"
}
"data"
:
{
"balloon_url"
:
"{
\"
body
\"
:
\"
123
\"
,
\"
link
\"
:
\"
www.baidu.com
\"
,
\"
bodyType
\"
:
1
}"
}
}
}
\ No newline at end of file
mock/joyousManor/consumerInfo.json
View file @
07964e5a
{
{
"code"
:
null
,
"code"
:
null
,
"data"
:
{
"data"
:
{
"popup"
:
tru
e
,
"popup"
:
fals
e
,
"ifLogin"
:
true
,
"ifLogin"
:
true
,
"newUser"
:
tru
e
,
"newUser"
:
fals
e
,
"nickname"
:
"4l60053306590_"
,
"nickname"
:
"4l60053306590_"
,
"loginPresent"
:
{
"loginPresent"
:
{
"sp_food_2"
:
0
"sp_food_2"
:
0
...
...
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