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
8ffb4343
Commit
8ffb4343
authored
Jun 25, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fc1dba2d
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
61 deletions
+126
-61
main.scene
assets/scenes/main.scene
+45
-6
AlertDialogContent.ts
assets/scripts/dialogs/AlertDialogContent.ts
+4
-1
ScoreDialogContent.ts
assets/scripts/dialogs/ScoreDialogContent.ts
+9
-1
ScenePlay.ts
assets/scripts/scenes/ScenePlay.ts
+19
-4
SceneStart.ts
assets/scripts/scenes/SceneStart.ts
+2
-34
bundle.js
debug/bundle.js
+24
-14
bundle.js.map
debug/bundle.js.map
+1
-1
activitySubmit.json
mock/customActivity/sjf/activity/activitySubmit.json
+7
-0
dojion.json
mock/customActivity/sjf/activity/dojion.json
+15
-0
No files found.
assets/scenes/main.scene
View file @
8ffb4343
...
@@ -141,7 +141,7 @@
...
@@ -141,7 +141,7 @@
"properties": {
"properties": {
"method": "POST",
"method": "POST",
"name": "doJoin",
"name": "doJoin",
"uri": "/
hdtool/recon/doJoi
n",
"uri": "/
customActivity/sjf/activity/dojio
n",
"onError": [
"onError": [
{
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
...
@@ -202,17 +202,18 @@
...
@@ -202,17 +202,18 @@
}
}
},
},
{
{
"script": "./scripts/api/Sample
Polling
Api",
"script": "./scripts/api/SampleApi",
"properties": {
"properties": {
"uri": "/customActivity/sjf/activity/rankInfo",
"name": "rankInfo",
"name": "rankInfo",
"method": "GET",
"onResponse": [
"onResponse": [
{
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"component": 1,
"method": "onResponse_rank"
"method": "onResponse_rank"
}
}
]
],
"uri": "/customActivity/sjf/activity/rankInfo"
}
}
}
}
],
],
...
@@ -436,7 +437,7 @@
...
@@ -436,7 +437,7 @@
"uuid": "34f68eec-739c-478c-a527-6aa12c197850"
"uuid": "34f68eec-739c-478c-a527-6aa12c197850"
}
}
],
],
"disabled":
fals
e
"disabled":
tru
e
},
},
{
{
"name": "ScenePlay",
"name": "ScenePlay",
...
@@ -455,7 +456,30 @@
...
@@ -455,7 +456,30 @@
"box1": "entity|c2fe839a-b7c4-4621-8064-16b16ea1714d",
"box1": "entity|c2fe839a-b7c4-4621-8064-16b16ea1714d",
"box2": "entity|4e7a15d9-07c6-44cf-be7b-2393fbcd765f",
"box2": "entity|4e7a15d9-07c6-44cf-be7b-2393fbcd765f",
"box3": "entity|a9ecf50b-0bba-4e98-a65e-073ff62f654c",
"box3": "entity|a9ecf50b-0bba-4e98-a65e-073ff62f654c",
"iconResource": "res|d6c6eb9d-b2bf-4da7-9017-1fdde2766886"
"iconResource": "res|d6c6eb9d-b2bf-4da7-9017-1fdde2766886",
"doJoin": "dynamic|API|doJoin"
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "GET",
"uri": "/customActivity/sjf/activity/activitySubmit",
"name": "activitySubmit",
"onError": [
{
"entity": "entity|0690fa72-d77d-42c2-ac55-6b6adccee9bf",
"component": 1,
"method": "onError_activitySubmit"
}
],
"onResponse": [
{
"entity": "entity|0690fa72-d77d-42c2-ac55-6b6adccee9bf",
"component": 1,
"method": "onRespone_activitySubmit"
}
]
}
}
}
}
],
],
...
@@ -2037,6 +2061,21 @@
...
@@ -2037,6 +2061,21 @@
"properties": {
"properties": {
"content": "entity|03779188-0be4-44e9-a348-c01cbcda6865"
"content": "entity|03779188-0be4-44e9-a348-c01cbcda6865"
}
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "GET",
"name": "rankInfo",
"uri": "/customActivity/sjf/activity/rankInfo",
"onResponse": [
{
"entity": "entity|4e3bc4b3-e5f5-4ae5-a736-9c252085acd7",
"component": 1,
"method": "onResponse_rank"
}
]
}
}
}
],
],
"uuid": "4e3bc4b3-e5f5-4ae5-a736-9c252085acd7",
"uuid": "4e3bc4b3-e5f5-4ae5-a736-9c252085acd7",
...
...
assets/scripts/dialogs/AlertDialogContent.ts
View file @
8ffb4343
...
@@ -13,7 +13,10 @@ export default class AlertDialogContent extends DialogContent {
...
@@ -13,7 +13,10 @@ export default class AlertDialogContent extends DialogContent {
onAwake
()
{
onAwake
()
{
super
.
onAwake
();
super
.
onAwake
();
}
}
protected
onTapCloseButton
()
{
super
.
onTapCloseButton
();
this
.
bubbling
(
'fuckNavigator'
,
'start'
);
}
setup
(
data
:
any
=
{})
{
setup
(
data
:
any
=
{})
{
setText
(
this
.
content
,
data
);
setText
(
this
.
content
,
data
);
}
}
...
...
assets/scripts/dialogs/ScoreDialogContent.ts
View file @
8ffb4343
...
@@ -5,11 +5,12 @@
...
@@ -5,11 +5,12 @@
*/
*/
import
{
Entity
}
from
"scilla/src"
;
import
{
Entity
}
from
"scilla/src"
;
import
DialogContent
from
"../popup/DialogContent"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
setText
}
from
"../entityUtils"
;
import
DialogContent
from
"../popup/DialogContent"
;
export
default
class
ScoreDialogContent
extends
DialogContent
{
export
default
class
ScoreDialogContent
extends
DialogContent
{
content
:
Entity
;
content
:
Entity
;
rankbtn
:
Entity
;
onAwake
()
{
onAwake
()
{
super
.
onAwake
();
super
.
onAwake
();
}
}
...
@@ -25,6 +26,13 @@ export default class ScoreDialogContent extends DialogContent {
...
@@ -25,6 +26,13 @@ export default class ScoreDialogContent extends DialogContent {
onclick_ranbtn
()
{
onclick_ranbtn
()
{
this
.
hide
();
this
.
hide
();
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
})
}
onResponse_rank
()
{
this
.
bubbling
(
'fuckNavigator'
,
'result'
);
this
.
bubbling
(
'fuckNavigator'
,
'result'
);
}
}
}
}
assets/scripts/scenes/ScenePlay.ts
View file @
8ffb4343
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
ScillaComponent
from
"scilla-components/src/base/ScillaComponent"
;
import
{
Entity
,
instantiate
,
resource
}
from
"scilla/src"
;
import
{
Entity
,
instantiate
,
resource
,
dynamic
}
from
"scilla/src"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
setText
}
from
"../entityUtils"
;
import
{
getTween
}
from
"../getTween"
;
import
{
getTween
}
from
"../getTween"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
import
{
alien
}
from
"../navigator/StackNavigator"
;
...
@@ -7,6 +7,8 @@ import { INavigatorViewBase } from "../navigator/VirtualNavigator";
...
@@ -7,6 +7,8 @@ import { INavigatorViewBase } from "../navigator/VirtualNavigator";
import
{
setScale
}
from
"../transformUtils"
;
import
{
setScale
}
from
"../transformUtils"
;
export
default
class
ScenePlay
extends
ScillaComponent
implements
INavigatorViewBase
{
export
default
class
ScenePlay
extends
ScillaComponent
implements
INavigatorViewBase
{
doJoin
:
dynamic
;
iconResource
:
resource
;
iconResource
:
resource
;
countTxt
:
Entity
;
countTxt
:
Entity
;
num1
:
Entity
;
num1
:
Entity
;
...
@@ -15,7 +17,7 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
...
@@ -15,7 +17,7 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
box1
:
Entity
;
box1
:
Entity
;
box2
:
Entity
;
box2
:
Entity
;
box3
:
Entity
;
box3
:
Entity
;
private
COUNT_DOWN_SEC
=
10
;
private
COUNT_DOWN_SEC
=
4
;
private
_startTag
=
false
;
private
_startTag
=
false
;
private
_msPassed
=
0
;
private
_msPassed
=
0
;
private
_ballCounter
=
0
;
private
_ballCounter
=
0
;
...
@@ -123,10 +125,23 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
...
@@ -123,10 +125,23 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
onTimerout
()
{
onTimerout
()
{
console
.
log
(
'onTimerout'
);
console
.
log
(
'onTimerout'
);
// alert(this._ballCounter);
this
.
broadcast
(
'callApi'
,
1
,
'activitySubmit'
,
{
this
.
bubbling
(
'showDialog'
,
'Score'
,
this
.
_ballCounter
);
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
,
orderId
:
this
.
doJoin
.
orderId
,
score
:
this
.
_ballCounter
});
}
onRespone_activitySubmit
()
{
this
.
bubbling
(
'showDialog'
,
'Score'
,
this
.
_ballCounter
);
}
}
onError_activitySubmit
(
error
)
{
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'网络异常,请稍后再试~'
);
}
getNumber
(
num
)
{
getNumber
(
num
)
{
if
(
num
<
10
)
if
(
num
<
10
)
return
`0
${
num
}
`
return
`0
${
num
}
`
...
...
assets/scripts/scenes/SceneStart.ts
View file @
8ffb4343
...
@@ -9,9 +9,7 @@ import { alien } from "../navigator/StackNavigator";
...
@@ -9,9 +9,7 @@ import { alien } from "../navigator/StackNavigator";
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
ajaxElement
:
dynamic
;
doJoin
:
dynamic
;
doJoin
:
dynamic
;
getNgameStartStatus
:
dynamic
;
getOrderStatus
:
dynamic
;
getOrderStatus
:
dynamic
;
countTxt
:
Entity
;
countTxt
:
Entity
;
...
@@ -56,9 +54,8 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
...
@@ -56,9 +54,8 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
onGotDojoin
()
{
onGotDojoin
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
orderId
:
this
.
doJoin
this
.
bubbling
(
'fuck'
,
'guide'
);
});
}
}
onGotDojoinError
(
error
)
{
onGotDojoinError
(
error
)
{
...
@@ -78,35 +75,6 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
...
@@ -78,35 +75,6 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
console
.
log
(
'onGotDojoinError'
,
error
);
console
.
log
(
'onGotDojoinError'
,
error
);
}
}
onGot_getNgameStartStatus
()
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
// if (this.getNgameStartStatus.orderId) {
// this.bubbling('showDialog', 'Prize', this.getNgameStartStatus);
// } else {
// this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
// }
this
.
bubbling
(
'fuck'
,
'guide'
);
}
onGotError_getNgameStartStatus
(
error
)
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'网络异常,请稍后再试~'
);
// if (error === '0') {
// this.bubbling('showDialog', 'Alert', '活动还未开始\n敬请期待~');
// }
// else if (error === '1') {
// this.bubbling('showDialog', 'Alert', '活动已结束\n下次早点来哦~');
// }
// else if (error === '2') {
// this.bubbling('showDialog', 'Alert', '您已经没有抽奖机会了');
// }
// else {
// this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// }
console
.
log
(
'onGotError_getNgameStartStatus'
,
error
);
}
onClick_rulebtn
()
{
onClick_rulebtn
()
{
console
.
log
(
'onClick_rulebtn'
);
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
...
...
debug/bundle.js
View file @
8ffb4343
...
@@ -6970,7 +6970,7 @@
...
@@ -6970,7 +6970,7 @@
__extends
(
ScenePlay
,
_super
);
__extends
(
ScenePlay
,
_super
);
function
ScenePlay
()
{
function
ScenePlay
()
{
var
_this_1
=
_super
!==
null
&&
_super
.
apply
(
this
,
arguments
)
||
this
;
var
_this_1
=
_super
!==
null
&&
_super
.
apply
(
this
,
arguments
)
||
this
;
_this_1
.
COUNT_DOWN_SEC
=
10
;
_this_1
.
COUNT_DOWN_SEC
=
4
;
_this_1
.
_startTag
=
false
;
_this_1
.
_startTag
=
false
;
_this_1
.
_msPassed
=
0
;
_this_1
.
_msPassed
=
0
;
_this_1
.
_ballCounter
=
0
;
_this_1
.
_ballCounter
=
0
;
...
@@ -7090,8 +7090,19 @@
...
@@ -7090,8 +7090,19 @@
};
};
ScenePlay
.
prototype
.
onTimerout
=
function
()
{
ScenePlay
.
prototype
.
onTimerout
=
function
()
{
console
.
log
(
'onTimerout'
);
console
.
log
(
'onTimerout'
);
this
.
broadcast
(
'callApi'
,
1
,
'activitySubmit'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
,
orderId
:
this
.
doJoin
.
orderId
,
score
:
this
.
_ballCounter
});
};
ScenePlay
.
prototype
.
onRespone_activitySubmit
=
function
()
{
this
.
bubbling
(
'showDialog'
,
'Score'
,
this
.
_ballCounter
);
this
.
bubbling
(
'showDialog'
,
'Score'
,
this
.
_ballCounter
);
};
};
ScenePlay
.
prototype
.
onError_activitySubmit
=
function
(
error
)
{
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'网络异常,请稍后再试~'
);
};
ScenePlay
.
prototype
.
getNumber
=
function
(
num
)
{
ScenePlay
.
prototype
.
getNumber
=
function
(
num
)
{
if
(
num
<
10
)
if
(
num
<
10
)
return
"0"
+
num
;
return
"0"
+
num
;
...
@@ -7377,9 +7388,8 @@
...
@@ -7377,9 +7388,8 @@
};
};
SceneStart
.
prototype
.
onGotDojoin
=
function
()
{
SceneStart
.
prototype
.
onGotDojoin
=
function
()
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
this
.
broadcast
(
'callApi'
,
1
,
'getNgameStartStatus'
,
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
orderId
:
this
.
doJoin
this
.
bubbling
(
'fuck'
,
'guide'
);
});
};
};
SceneStart
.
prototype
.
onGotDojoinError
=
function
(
error
)
{
SceneStart
.
prototype
.
onGotDojoinError
=
function
(
error
)
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
...
@@ -7397,16 +7407,6 @@
...
@@ -7397,16 +7407,6 @@
}
}
console
.
log
(
'onGotDojoinError'
,
error
);
console
.
log
(
'onGotDojoinError'
,
error
);
};
};
SceneStart
.
prototype
.
onGot_getNgameStartStatus
=
function
()
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
console
.
log
(
'onGot_getNgameStartStatus'
,
this
.
getNgameStartStatus
);
this
.
bubbling
(
'fuck'
,
'guide'
);
};
SceneStart
.
prototype
.
onGotError_getNgameStartStatus
=
function
(
error
)
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'网络异常,请稍后再试~'
);
console
.
log
(
'onGotError_getNgameStartStatus'
,
error
);
};
SceneStart
.
prototype
.
onClick_rulebtn
=
function
()
{
SceneStart
.
prototype
.
onClick_rulebtn
=
function
()
{
console
.
log
(
'onClick_rulebtn'
);
console
.
log
(
'onClick_rulebtn'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
this
.
bubbling
(
'showDialog'
,
'Rule'
);
...
@@ -8651,6 +8651,10 @@
...
@@ -8651,6 +8651,10 @@
AlertDialogContent
.
prototype
.
onAwake
=
function
()
{
AlertDialogContent
.
prototype
.
onAwake
=
function
()
{
_super
.
prototype
.
onAwake
.
call
(
this
);
_super
.
prototype
.
onAwake
.
call
(
this
);
};
};
AlertDialogContent
.
prototype
.
onTapCloseButton
=
function
()
{
_super
.
prototype
.
onTapCloseButton
.
call
(
this
);
this
.
bubbling
(
'fuckNavigator'
,
'start'
);
};
AlertDialogContent
.
prototype
.
setup
=
function
(
data
)
{
AlertDialogContent
.
prototype
.
setup
=
function
(
data
)
{
if
(
data
===
void
0
)
{
data
=
{};
}
if
(
data
===
void
0
)
{
data
=
{};
}
setText
(
this
.
content
,
data
);
setText
(
this
.
content
,
data
);
...
@@ -8743,6 +8747,12 @@
...
@@ -8743,6 +8747,12 @@
};
};
ScoreDialogContent
.
prototype
.
onclick_ranbtn
=
function
()
{
ScoreDialogContent
.
prototype
.
onclick_ranbtn
=
function
()
{
this
.
hide
();
this
.
hide
();
this
.
broadcast
(
'callApi'
,
1
,
'rankInfo'
,
{
weddingId
:
window
[
'CFG'
].
_weddingId
,
activityId
:
window
[
'CFG'
].
_activityId
});
};
ScoreDialogContent
.
prototype
.
onResponse_rank
=
function
()
{
this
.
bubbling
(
'fuckNavigator'
,
'result'
);
this
.
bubbling
(
'fuckNavigator'
,
'result'
);
};
};
return
ScoreDialogContent
;
return
ScoreDialogContent
;
...
...
debug/bundle.js.map
View file @
8ffb4343
This diff is collapsed.
Click to expand it.
mock/customActivity/sjf/activity/activitySubmit.json
0 → 100644
View file @
8ffb4343
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1561363232162
,
"data"
:
1000
}
\ No newline at end of file
mock/customActivity/sjf/activity/dojion.json
0 → 100644
View file @
8ffb4343
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1561445946866
,
"data"
:
{
"orderId"
:
123
,
"prizeId"
:
null
,
"title"
:
null
,
"prizeType"
:
6
,
"orderStatus"
:
1
,
"imgurl"
:
null
,
"link"
:
null
}
}
\ 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