Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zjzy_client_game
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
王勇霞
zjzy_client_game
Commits
5bd7925a
Commit
5bd7925a
authored
Mar 10, 2023
by
王勇霞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接入接口
parent
2cb2b413
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
15 deletions
+62
-15
config.js
mock/config.js
+4
-0
gameIndex.json
mock/json/gameIndex.json
+17
-0
Hdtool.ts
src/hdTool/Hdtool.ts
+26
-0
RulePanel.ts
src/panels/RulePanel.ts
+0
-1
StartScene.ts
src/scenes/StartScene.ts
+15
-14
No files found.
mock/config.js
View file @
5bd7925a
...
@@ -19,6 +19,10 @@ const config = {
...
@@ -19,6 +19,10 @@ const config = {
'/hdtool/recon/ngame/getNgameStartStatus'
:
{
'/hdtool/recon/ngame/getNgameStartStatus'
:
{
data
:
'./json/getNgameStartStatus.json'
data
:
'./json/getNgameStartStatus.json'
},
},
// 本次内容
'/zy-activity/game/index'
:
{
data
:
'./json/gameIndex.json'
}
}
}
for
(
let
item
in
config
)
{
for
(
let
item
in
config
)
{
...
...
mock/json/gameIndex.json
0 → 100644
View file @
5bd7925a
{
"success"
:
true
,
"desc"
:
"elit"
,
"data"
:
{
"data"
:
[
{
"num"
:
"sint consectetur id quis"
,
"context"
:
"in dolore"
,
"ifComplete"
:
-46608589.20993536
,
"count"
:
67750870.19773784
}
],
"collectCount"
:
-20061995
},
"code"
:
"in enim ea dolore"
,
"timestamp"
:
-81389889
}
\ No newline at end of file
src/hdTool/Hdtool.ts
View file @
5bd7925a
...
@@ -5,6 +5,32 @@
...
@@ -5,6 +5,32 @@
import
{
ajax
,
jsonp
}
from
"../../module/web/ajax"
import
{
ajax
,
jsonp
}
from
"../../module/web/ajax"
import
{
showToast
}
from
"../../module/ctrls"
import
{
showToast
}
from
"../../module/ctrls"
import
{
duiba_md5
}
from
"../../module/tools/security"
import
{
duiba_md5
}
from
"../../module/tools/security"
import
{
getUrlParams
}
from
"../../module/web/webTools"
export
function
getGameIndex
():
Promise
<
{
success
:
boolean
,
data
?:
any
}
>
{
return
new
Promise
((
r
)
=>
{
ajax
({
url
:
"/zy-activity/game/index"
,
//请求地址
type
:
"POST"
,
//"POST", //请求方式
data
:
{
activityId
:
getUrlParams
(
'activityId'
),
type
:
3
},
//请求参数
dataType
:
"json"
,
// 返回值类型的设定,暂时只有json
async
:
true
,
//是否异步
// headers: headers,
success
:
function
(
res
)
{
if
(
!
res
.
success
)
showToast
(
res
.
desc
||
"网络异常,请稍后再试"
)
r
(
res
)
},
error
:
function
(
status
)
{
showToast
(
"网络异常,请稍后再试"
)
r
({
success
:
false
})
},
})
})
}
//部分情况需要,比如duiba_md5,需跳转下载的
//部分情况需要,比如duiba_md5,需跳转下载的
// <script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/zepto_security_downloadApp.min.js"></script>
// <script crossorigin="anonymous" src="//yun.duiba.com.cn/db_games/libs/zepto_security_downloadApp.min.js"></script>
...
...
src/panels/RulePanel.ts
View file @
5bd7925a
...
@@ -48,7 +48,6 @@ export class RulePanel extends Panel {
...
@@ -48,7 +48,6 @@ export class RulePanel extends Panel {
var
rule
=
this
.
addChild
(
new
FYGE
.
FloatDisplay
());
var
rule
=
this
.
addChild
(
new
FYGE
.
FloatDisplay
());
rule
.
position
.
set
(
this
.
ruleLab
.
x
,
this
.
ruleLab
.
y
)
rule
.
position
.
set
(
this
.
ruleLab
.
x
,
this
.
ruleLab
.
y
)
rule
.
init
(
section
);
rule
.
init
(
section
);
}
}
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
...
...
src/scenes/StartScene.ts
View file @
5bd7925a
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
{
changeScene
,
showPanel
,
showToast
}
from
"../../module/ctrls"
;
import
{
changeScene
,
showPanel
,
showToast
,
hideWaiting
}
from
"../../module/ctrls"
;
import
{
GameScene
}
from
"./GameScene"
;
import
{
GameScene
}
from
"./GameScene"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
RES
}
from
"../../module/RES"
;
import
{
RulePanel
}
from
"../panels/RulePanel"
;
import
{
RulePanel
}
from
"../panels/RulePanel"
;
import
{
sendWebNet
,
WebNetName
,
getPxTokenSave
}
from
"../webNet"
;
import
{
sendWebNet
,
WebNetName
,
getPxTokenSave
}
from
"../webNet"
;
import
{
GDispatcher
}
from
"../Main"
;
import
{
getGameIndex
}
from
"../hdTool/Hdtool"
;
export
class
StartScene
extends
Scene
{
export
class
StartScene
extends
Scene
{
get
groupNames
()
{
return
[
"StartScene"
]
};
get
groupNames
()
{
return
[
"StartScene"
]
};
get
skinName
()
{
return
"StartScene"
};
get
skinName
()
{
return
"StartScene"
};
...
@@ -39,19 +41,21 @@ export class StartScene extends Scene {
...
@@ -39,19 +41,21 @@ export class StartScene extends Scene {
this
.
getIndexInfo
()
this
.
getIndexInfo
()
}
}
async
getIndexInfo
()
{
async
getIndexInfo
()
{
const
{
success
,
data
,
message
}
=
await
sendWebNet
(
WebNetName
.
indexInfo
)
getGameIndex
().
then
((
r
)
=>
{
if
(
!
success
)
{
hideWaiting
()
showToast
(
message
||
"网络异常,请重试~"
)
if
(
r
.
success
)
{
return
this
.
indexInfo
=
r
.
data
;
}
this
.
titlelab
.
text
=
"今日收集字数( "
+
r
.
data
.
collectCount
+
" / 16 )"
}
this
.
indexInfo
=
data
})
this
.
titlelab
.
text
=
"今日收集字数( "
+
data
.
word
+
" / 17 )"
// this.openGame()
// this.openGame()
}
}
openRule
()
{
openRule
()
{
showPanel
(
RulePanel
)
// showPanel(RulePanel)
GDispatcher
.
dispatchEvent
(
"openRule"
);
}
}
isOpen
=
false
isOpen
=
false
async
openGame
()
{
async
openGame
()
{
...
@@ -84,10 +88,7 @@ export class StartScene extends Scene {
...
@@ -84,10 +88,7 @@ export class StartScene extends Scene {
}
}
goback
()
{
goback
()
{
setTimeout
(()
=>
{
GDispatcher
.
dispatchEvent
(
"backIndex"
);
history
.
go
(
-
1
)
},
500
)
}
}
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
...
...
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