Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shuijf2
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
wildfirecode13
shuijf2
Commits
349310b0
Commit
349310b0
authored
Jun 25, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
755c98f5
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
194 additions
and
12 deletions
+194
-12
main.scene
assets/scenes/main.scene
+39
-1
MainController.ts
assets/scripts/MainController.ts
+17
-1
SceneResult.ts
assets/scripts/scenes/SceneResult.ts
+31
-4
SceneStart.ts
assets/scripts/scenes/SceneStart.ts
+1
-0
transformUtils.ts
assets/scripts/transformUtils.ts
+1
-1
bundle.js
debug/bundle.js
+43
-4
bundle.js.map
debug/bundle.js.map
+1
-1
rankInfo.json
mock/customActivity/sjf/activity/rankInfo.json
+61
-0
No files found.
assets/scenes/main.scene
View file @
349310b0
...
...
@@ -63,6 +63,28 @@
],
"uri": "/hdtool/recon/ajaxElement"
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "GET",
"name": "rankInfo",
"onError": [
{
"entity": "entity|20181212032053",
"component": null,
"method": null
}
],
"onResponse": [
{
"entity": "entity|20181212032053",
"component": 2,
"method": "onResponse_rankInfo"
}
],
"uri": "/customActivity/sjf/activity/rankInfo"
}
}
],
"children": [
...
...
@@ -688,11 +710,27 @@
"myname": "entity|61fc871c-9f18-499e-abb5-2dfe8b381223",
"myscore": "entity|d30c7a2a-e95a-42e4-a288-ebe7022e1f3e",
"myrank": "entity|3ed68a8c-bbcc-4a85-a9da-5f44eff0d08e"
},
"disabled": false
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "GET",
"name": "rankInfo",
"onResponse": [
{
"entity": "entity|5f2a7508-4728-430b-b306-06f719ea81e3",
"component": 1,
"method": "onResponse"
}
],
"uri": "/customActivity/sjf/activity/rankInfo"
}
}
],
"uuid": "5f2a7508-4728-430b-b306-06f719ea81e3",
"disabled":
fals
e,
"disabled":
tru
e,
"children": [
{
"name": "cankao",
...
...
assets/scripts/MainController.ts
View file @
349310b0
...
...
@@ -27,10 +27,26 @@ export default class MainController extends ScillaComponent {
initEnv
();
this
.
broadcast
(
'callApi'
,
1
,
'ajaxElement'
,
{
duibaId
:
this
.
hdToolId
,
activityId
:
this
.
actId
})
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
})
}
onResponse_rankInfo
(
data
)
{
// console.log(data);
if
(
data
.
openPrize
)
{
if
(
true
)
this
.
showDialog
(
'Prize'
,
data
);
else
this
.
showDialog
(
'Alert'
,
'您与奖品擦肩而过~'
)
}
}
onGotAjaxElement
()
{
setTimeout
(()
=>
{
this
.
broadcast
(
'initGameStage'
);
},
1000
);
}
onGotAjaxElementError
(
e
)
{
...
...
assets/scripts/scenes/SceneResult.ts
View file @
349310b0
...
...
@@ -4,15 +4,42 @@ import { createTexture, EngineConfig, Entity, Texture } from "scilla/src";
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
TextureRenderer
}
from
"scilla-components/src"
;
import
{
setScale
}
from
"../transformUtils"
;
import
{
setScale
,
setText
}
from
"../transformUtils"
;
export
default
class
SceneResult
extends
ScillaComponent
implements
INavigatorViewBase
{
onAwake
()
{
super
.
onAwake
();
this
.
loadAvatar
(
this
.
avatar1
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
78
);
this
.
loadAvatar
(
this
.
avatar2
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
64
);
this
.
loadAvatar
(
this
.
avatar3
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
64
);
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
})
}
onResponse
(
data
)
{
//设置我的信息
setText
(
this
.
myname
,
'honingwon'
);
setText
(
this
.
myrank
,
data
.
rank
+
''
);
setText
(
this
.
myscore
,
'123456'
);
this
.
loadAvatar
(
this
.
myavatar
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
78
);
//设置前三名的信息
const
[
rankinfo1
,
rankinfo2
,
rankinfo3
,
...
last
]
=
data
.
list
;
console
.
log
(
rankinfo1
,
rankinfo2
,
rankinfo3
,
last
);
if
(
rankinfo1
)
{
this
.
loadAvatar
(
this
.
avatar1
,
rankinfo1
.
avatar
,
78
);
setText
(
this
.
name1
,
rankinfo1
.
nickName
);
setText
(
this
.
score1
,
rankinfo1
.
score
);
}
if
(
rankinfo2
)
{
this
.
loadAvatar
(
this
.
avatar2
,
rankinfo2
.
avatar
,
64
);
setText
(
this
.
name2
,
rankinfo2
.
nickName
);
setText
(
this
.
score2
,
rankinfo2
.
score
);
}
if
(
rankinfo3
)
{
this
.
loadAvatar
(
this
.
avatar3
,
rankinfo3
.
avatar
,
64
);
setText
(
this
.
name3
,
rankinfo3
.
nickName
);
setText
(
this
.
score3
,
rankinfo3
.
score
);
}
}
onTapCloseButton
()
{
...
...
assets/scripts/scenes/SceneStart.ts
View file @
349310b0
...
...
@@ -25,6 +25,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
initGameStage
()
{
console
.
log
(
'initGameStage'
)
// // this.updateCountText();
// this.bubbling('showToast', '活动还未开始\n敬请期待')
}
...
...
assets/scripts/transformUtils.ts
View file @
349310b0
...
...
@@ -32,7 +32,7 @@ export const setScale = (val: Entity | ScillaComponent, sacle) => {
}
export
const
setText
=
(
entity
:
Entity
,
text
:
string
)
=>
{
entity
.
getComponent
(
TextRenderer
).
text
=
text
;
entity
.
getComponent
(
TextRenderer
).
text
=
text
+
''
;
}
export
const
getScale
=
(
val
:
Entity
|
ScillaComponent
)
=>
{
...
...
debug/bundle.js
View file @
349310b0
...
...
@@ -6934,6 +6934,9 @@
val
.
entity
.
getComponent
(
Transform
).
scale
.
y
=
sacle
;
}
};
var
setText$1
=
function
(
entity
,
text
)
{
entity
.
getComponent
(
TextRenderer
).
text
=
text
+
''
;
};
var
setY
=
function
(
entity
,
y
)
{
entity
.
getComponent
(
Transform
).
position
.
y
=
y
;
};
...
...
@@ -7346,6 +7349,7 @@
_super
.
prototype
.
onAwake
.
call
(
this
);
};
SceneStart
.
prototype
.
initGameStage
=
function
()
{
console
.
log
(
'initGameStage'
);
};
SceneStart
.
prototype
.
onClick_startbtn
=
function
()
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
false
;
...
...
@@ -7522,10 +7526,33 @@
}
SceneResult
.
prototype
.
onAwake
=
function
()
{
_super
.
prototype
.
onAwake
.
call
(
this
);
this
.
loadAvatar
(
this
.
avatar1
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
78
);
this
.
loadAvatar
(
this
.
avatar2
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
64
);
this
.
loadAvatar
(
this
.
avatar3
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
64
);
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
});
};
SceneResult
.
prototype
.
onResponse
=
function
(
data
)
{
setText$1
(
this
.
myname
,
'honingwon'
);
setText$1
(
this
.
myrank
,
data
.
rank
+
''
);
setText$1
(
this
.
myscore
,
'123456'
);
this
.
loadAvatar
(
this
.
myavatar
,
'//yun.duiba.com.cn/db_games/1.jpg'
,
78
);
var
_a
=
__read
(
data
.
list
),
rankinfo1
=
_a
[
0
],
rankinfo2
=
_a
[
1
],
rankinfo3
=
_a
[
2
],
last
=
_a
.
slice
(
3
);
console
.
log
(
rankinfo1
,
rankinfo2
,
rankinfo3
,
last
);
if
(
rankinfo1
)
{
this
.
loadAvatar
(
this
.
avatar1
,
rankinfo1
.
avatar
,
78
);
setText$1
(
this
.
name1
,
rankinfo1
.
nickName
);
setText$1
(
this
.
score1
,
rankinfo1
.
score
);
}
if
(
rankinfo2
)
{
this
.
loadAvatar
(
this
.
avatar2
,
rankinfo2
.
avatar
,
64
);
setText$1
(
this
.
name2
,
rankinfo2
.
nickName
);
setText$1
(
this
.
score2
,
rankinfo2
.
score
);
}
if
(
rankinfo3
)
{
this
.
loadAvatar
(
this
.
avatar3
,
rankinfo3
.
avatar
,
64
);
setText$1
(
this
.
name3
,
rankinfo3
.
nickName
);
setText$1
(
this
.
score3
,
rankinfo3
.
score
);
}
};
SceneResult
.
prototype
.
onTapCloseButton
=
function
()
{
this
.
bubbling
(
'fuck'
,
'start'
);
...
...
@@ -8464,9 +8491,21 @@
this
.
_popup
=
this
.
Popup
.
getComponent
(
Popup
);
initEnv
();
this
.
broadcast
(
'callApi'
,
1
,
'ajaxElement'
,
{
duibaId
:
this
.
hdToolId
,
activityId
:
this
.
actId
});
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
});
};
MainController
.
prototype
.
onResponse_rankInfo
=
function
(
data
)
{
if
(
data
.
openPrize
)
{
this
.
showDialog
(
'Prize'
,
data
);
}
};
MainController
.
prototype
.
onGotAjaxElement
=
function
()
{
this
.
broadcast
(
'initGameStage'
);
var
_this
=
this
;
setTimeout
(
function
()
{
_this
.
broadcast
(
'initGameStage'
);
},
1000
);
};
MainController
.
prototype
.
onGotAjaxElementError
=
function
(
e
)
{
console
.
log
(
e
);
...
...
debug/bundle.js.map
View file @
349310b0
This diff is collapsed.
Click to expand it.
mock/customActivity/sjf/activity/rankInfo.json
0 → 100644
View file @
349310b0
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1561377481101
,
"data"
:
{
"openPrize"
:
false
,
"rank"
:
"3"
,
"list"
:
[
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName1"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
100
,
"rank"
:
"1"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName2"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
50
,
"rank"
:
"2"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName3"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
20
,
"rank"
:
"3"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName4"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
204
,
"rank"
:
"4"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName5"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
205
,
"rank"
:
"5"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName6"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
206
,
"rank"
:
"6"
},
{
"weiXinUid"
:
"weiXinUid"
,
"nickName"
:
"nickName_last"
,
"avatar"
:
"//yun.duiba.com.cn/db_games/1.jpg"
,
"score"
:
9999
,
"rank"
:
"999"
}
]
}
}
\ 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