Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shuijf
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
shuijf
Commits
7a8d84c5
Commit
7a8d84c5
authored
Jun 25, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
715d9644
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
28 deletions
+63
-28
main.scene
assets/scenes/main.scene
+4
-3
PrizeDialogContent.ts
assets/scripts/dialogs/PrizeDialogContent.ts
+2
-2
SceneStart.ts
assets/scripts/scenes/SceneStart.ts
+19
-22
dojion.json
mock/customActivity/sjf/activity/dojion.json
+1
-1
getOrderStatus.json
mock/customActivity/sjf/activity/getOrderStatus.json
+37
-0
No files found.
assets/scenes/main.scene
View file @
7a8d84c5
...
...
@@ -140,7 +140,7 @@
{
"script": "./scripts/api/SamplePollingApi",
"properties": {
"uri": "/
hdtool/recon
/getOrderStatus",
"uri": "/
customActivity/sjf/activity
/getOrderStatus",
"method": "GET",
"onError": [
{
...
...
@@ -1342,7 +1342,7 @@
"properties": {
"position": {
"x": 0,
"y": 2
04.44444444444443
"y": 2
17.77777777777777
}
}
},
...
...
@@ -1385,7 +1385,8 @@
}
}
],
"uuid": "e67a692f-68ea-43ca-8046-d4db33798873"
"uuid": "e67a692f-68ea-43ca-8046-d4db33798873",
"disabled": false
},
{
"name": "prizeType",
...
...
assets/scripts/dialogs/PrizeDialogContent.ts
View file @
7a8d84c5
...
...
@@ -53,8 +53,8 @@ export default class PrizeDialogContent extends DialogContent {
this
.
useBtn
.
enabled
=
this
.
name
.
enabled
=
isDuibaPrize
;
this
.
tips
.
enabled
=
!
isDuibaPrize
;
if
(
isDuibaPrize
)
{
//大牌券
this
.
_link
;
this
.
_link
=
data
.
link
;
imgUrl
=
data
.
imgUrl
;
}
else
{
//线下
imgUrl
=
data
.
imgurl
;
}
...
...
assets/scripts/scenes/SceneStart.ts
View file @
7a8d84c5
...
...
@@ -12,8 +12,8 @@ import Drop from "./Drop";
export
default
class
SceneStart
extends
ScillaComponent
implements
INavigatorViewBase
{
Drop
:
resource
;
doJoin
:
dynamic
;
getOrderStatus
:
dynamic
;
//
doJoin: dynamic;
//
getOrderStatus: dynamic;
countTxt
:
Entity
;
startbtn
:
Entity
;
...
...
@@ -48,23 +48,20 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onShakeOver
()
{
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
this
.
dojoinFunc
(
tokenObj
.
token
);
},
(
key
:
string
,
messageObj
:
any
)
=>
{
// this.onError(net);
});
}
else
{
this
.
dojoinFunc
();
}
//
if (window['getDuibaToken']) {
//
window['getDuibaToken']((tokenObj: any) => {
//
this.dojoinFunc(tokenObj.token);
//
}, (key: string, messageObj: any) => {
//
// this.onError(net);
//
});
//
} else {
this
.
dojoinFunc
();
//
}
}
dojoinFunc
(
token
?)
{
this
.
broadcast
(
'callApi'
,
1
,
'doJoin'
,
{
token
:
token
,
activityId
:
window
[
'CFG'
].
actId
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
activityId
:
1
});
}
...
...
@@ -90,17 +87,17 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onGotDojoin
(
data
)
{
console
.
log
(
'onGotDojoin'
,
this
.
doJoin
);
//
console.log('onGotDojoin', this.doJoin);
if
(
data
.
prizeType
==
0
)
{
//幸运奖
this
.
broadcast
(
'callApi'
,
1
,
'getOrderStatus'
,
{
orderId
:
this
.
doJoin
orderId
:
data
.
orderId
});
}
else
{
//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖 5谢谢 6
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
if
(
data
.
prizeType
==
5
)
{
//5谢谢
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'您与奖品擦肩而过~'
);
}
else
if
(
data
.
prizeType
!=
6
)
{
//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖
this
.
bubbling
(
'showDialog'
,
'Prize'
,
{
isDuibaPrize
:
false
,
data
:
data
});
this
.
bubbling
(
'showDialog'
,
'Prize'
,
{
isDuibaPrize
:
false
,
data
:
data
});
}
else
{
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'系统异常,prizeType=6'
);
}
...
...
@@ -124,11 +121,11 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
console
.
log
(
'onGotDojoinError'
,
error
);
}
onResponse_getOrderStatus
()
{
onResponse_getOrderStatus
(
data
)
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
true
;
console
.
log
(
'onResponse_getOrderStatus'
,
this
.
getOrderStatus
);
if
(
this
.
getOrderStatus
.
lottery
)
{
this
.
bubbling
(
'showDialog'
,
'Prize'
,
{
isDuibaPrize
:
true
,
data
:
this
.
getOrderStatus
});
console
.
log
(
'onResponse_getOrderStatus'
,
data
);
if
(
data
.
lottery
)
{
this
.
bubbling
(
'showDialog'
,
'Prize'
,
{
isDuibaPrize
:
true
,
data
:
data
.
lottery
});
}
else
{
this
.
bubbling
(
'showDialog'
,
'Alert'
,
'您与奖品擦肩而过~'
);
}
...
...
mock/customActivity/sjf/activity/dojion.json
View file @
7a8d84c5
...
...
@@ -7,7 +7,7 @@
"orderId"
:
132
,
"prizeId"
:
null
,
"title"
:
null
,
"prizeType"
:
5
,
"prizeType"
:
0
,
"orderStatus"
:
1
,
"imgurl"
:
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
,
"link"
:
null
...
...
mock/customActivity/sjf/activity/getOrderStatus.json
0 → 100755
View file @
7a8d84c5
{
"code"
:
"1C000000001"
,
"data"
:
{
"creditsInfo"
:
{
"activityId"
:
21194
,
"score"
:
31
,
"recordStatus"
:
1
,
"developerBizId"
:
"3013273"
,
"prizeId"
:
1
},
"lottery"
:
{
"imgUrl"
:
"//yun.duiba.com.cn/babi/img/q7yx1sus73.gif"
,
"imgUrl1"
:
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
,
"itemId"
:
20348
,
"appHidden"
:
true
,
"link"
:
"//activity.m.duibatest.com.cn/activity/takePrizeNew?recordId=3395303&dbnewopen"
,
"id"
:
9
,
"title"
:
"虚拟商品"
,
"type"
:
"v"
,
"isDownloadUrl"
:
true
},
"element"
:
{
"isCreditsTypeOpen"
:
false
,
"myCreditsLong"
:
4993862
,
"freeLimit"
:
2
,
"success"
:
true
,
"myCredits"
:
"4993862"
,
"needCredits"
:
"200"
,
"freeEmpty"
:
false
,
"needCreditsLong"
:
200
,
"status"
:
5
}
},
"success"
:
true
,
"desc"
:
"OK"
,
"timestamp"
:
1550543212313
}
\ 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