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
e4c72a67
Commit
e4c72a67
authored
May 07, 2021
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
c587e4d8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
4 deletions
+52
-4
NetName.ts
egret/libs/tw/enum/NetName.ts
+1
-1
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+17
-0
Main.ts
egret/src/Main.ts
+1
-0
MainScene.ts
egret/src/Scenes/MainScene/MainScene.ts
+13
-2
Tools.ts
egret/src/Tools.ts
+9
-0
config.js
mock/config.js
+3
-1
frontVariable.json
mock/game/frontVariable.json
+8
-0
No files found.
egret/libs/tw/enum/NetName.ts
View file @
e4c72a67
...
@@ -153,5 +153,5 @@ export enum NetName {
...
@@ -153,5 +153,5 @@ export enum NetName {
ACHIEVES
,
ACHIEVES
,
GAMEGROUP_MARK
,
GAMEGROUP_MARK
,
GAMEGROUP_PRIZE
,
GAMEGROUP_PRIZE
,
frontVariable
,
}
}
egret/libs/tw/manager/NetManager.ts
View file @
e4c72a67
...
@@ -1610,6 +1610,23 @@ export class NetManager extends ABNetManager {
...
@@ -1610,6 +1610,23 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
*
* @param callback
*/
public
frontVariable
(
callback
:
Function
)
{
const
net
:
INetData
=
{
name
:
NetName
.
frontVariable
,
uri
:
'/projectx/{projectId}/frontVariable.query'
,
type
:
'get'
,
dataType
:
'json'
,
param
:
{
},
callback
:
callback
};
this
.
send
(
net
);
}
}
}
// window['nt'] = NetManager.ins;
// window['nt'] = NetManager.ins;
...
...
egret/src/Main.ts
View file @
e4c72a67
...
@@ -111,6 +111,7 @@ class Main extends eui.UILayer {
...
@@ -111,6 +111,7 @@ 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
();
//
const
areaPrice
=
await
Tools
.
getAreaPrice
();
const
areaPrice
=
await
Tools
.
getAreaPrice
();
if
(
!
areaPrice
)
{
if
(
!
areaPrice
)
{
...
...
egret/src/Scenes/MainScene/MainScene.ts
View file @
e4c72a67
...
@@ -67,7 +67,8 @@ export default class MainScene extends Scene {
...
@@ -67,7 +67,8 @@ export default class MainScene extends Scene {
public
houseBtn
:
Group
;
public
houseBtn
:
Group
;
public
xiaoE
:
Image
;
public
xiaoE
:
eui
.
Group
;
advertBtn
:
eui
.
Group
public
xiaoEGroup
:
eui
.
Group
;
public
xiaoEGroup
:
eui
.
Group
;
public
xiaoEGroupList
:
eui
.
List
;
public
xiaoEGroupList
:
eui
.
List
;
...
@@ -202,6 +203,7 @@ export default class MainScene extends Scene {
...
@@ -202,6 +203,7 @@ export default class MainScene extends Scene {
[
this
.
xiaoEAnswer
,
this
.
onTap
,
this
],
[
this
.
xiaoEAnswer
,
this
.
onTap
,
this
],
[
this
.
xiaoEIKnow
,
this
.
onTap
,
this
],
[
this
.
xiaoEIKnow
,
this
.
onTap
,
this
],
[
this
.
xiaoETip
,
this
.
onTap
,
this
],
[
this
.
xiaoETip
,
this
.
onTap
,
this
],
[
this
.
advertBtn
,
this
.
onTap
,
this
],
]);
]);
}
}
...
@@ -236,7 +238,16 @@ export default class MainScene extends Scene {
...
@@ -236,7 +238,16 @@ export default class MainScene extends Scene {
this
.
hideXiaoETip
();
this
.
hideXiaoETip
();
M_HideOption
();
M_HideOption
();
break
;
break
;
case
this
.
advertBtn
:
console
.
error
(
"广告数据====?"
,
Tools
.
frontdata
);
if
(
Tools
.
frontdata
&&
Tools
.
frontdata
.
data
&&
Tools
.
frontdata
.
data
.
balloon_url
){
let
balloon_url
=
Tools
.
frontdata
.
data
.
balloon_url
;
if
(
balloon_url
&&
balloon_url
.
length
>
4
){
window
.
location
.
href
=
balloon_url
;
}
}
break
;
default
:
default
:
break
;
break
;
}
}
...
...
egret/src/Tools.ts
View file @
e4c72a67
...
@@ -194,5 +194,14 @@ export class Tools {
...
@@ -194,5 +194,14 @@ export class Tools {
},
toPlaywayId
,
toActionId
,
num
,
desc
);
},
toPlaywayId
,
toActionId
,
num
,
desc
);
});
});
}
}
public
static
frontdata
=
null
;
public
static
gameFrontVariable
(){
return
new
Promise
((
resolve
)
=>
{
NetManager
.
ins
.
frontVariable
((
success
,
res
)
=>
{
this
.
frontdata
=
res
;
resolve
(
true
);
})
})
}
}
}
\ No newline at end of file
mock/config.js
View file @
e4c72a67
...
@@ -365,7 +365,9 @@ const config = {
...
@@ -365,7 +365,9 @@ const config = {
'/projectx/{projectId}/game/join.do'
:
{
'/projectx/{projectId}/game/join.do'
:
{
data
:
'./game/join.do.json'
data
:
'./game/join.do.json'
},
},
'/projectx/{projectId}/frontVariable.query'
:
{
data
:
'./game/frontVariable.json'
},
};
};
// for (let item in config) {
// for (let item in config) {
...
...
mock/game/frontVariable.json
0 → 100644
View file @
e4c72a67
{
"success"
:
true
,
"message"
:
""
,
"code"
:
""
,
"data"
:
{
"balloon_url"
:
"https://www.baidu.com/"
}
}
\ 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