Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
xiaoxiaole
Commits
33a168ea
Commit
33a168ea
authored
Oct 26, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
decc8e69
9f26a250
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
Turntable.ts
egret/src/panels/TurntablePanel/Turntable.ts
+25
-9
turnablebaseInfo.json
mock/happyclear/turnablebaseInfo.json
+1
-1
No files found.
egret/src/panels/TurntablePanel/Turntable.ts
View file @
33a168ea
...
...
@@ -5,15 +5,12 @@ import RotaryData from './RotaryData';
import
Panel
from
"../../../libs/new_wx/components/Panel"
;
import
PanelCtrl
from
"../../../libs/new_wx/ctrls/panelCtrl"
;
import
{
ModuleTypes
}
from
"../../../libs/new_wx/types/sceneTypes"
;
import
hdGameDoDojoin
from
"../../../libs/new_tw/ctrls/hdGameDoDojoin"
;
import
submit
from
"../../../libs/new_tw/ctrls/submit"
;
import
Loading
from
"../../../libs/new_wx/components/Loading"
;
import
{
NetManager
}
from
"../../../libs/tw/manager/NetManager"
;
import
Utils
from
"../../Utils"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
wait
from
"../../../libs/new_tc/wait"
;
import
tr
=
egret
.
sys
.
tr
;
import
{
showToast
}
from
"../../../libs/new_wx/ctrls/toastCtrl"
;
import
getHomeData
from
"../../getHomeData"
;
// export const loadTurntableSvga = (callback) => {
...
...
@@ -27,6 +24,9 @@ export default class Turntable extends Panel {
public
start_btn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
private
nextTimeNeedCoin
:
number
=
0
;
private
remainTimes
:
number
=
0
;
public
get
skinKey
()
{
return
'Turntable'
}
...
...
@@ -40,7 +40,9 @@ export default class Turntable extends Panel {
async
start
(
data
?)
{
super
.
start
();
console
.
log
(
data
.
onceAgain
)
if
(
data
.
onceAgain
)
{
// 再抽一次
this
.
onTapStart
();
}
this
[
'container'
].
addChild
(
this
.
data
.
mv
);
this
.
hand
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/hand.svga'
,
this
[
'container2'
])
this
[
'container2'
].
touchEnabled
=
false
;
...
...
@@ -76,7 +78,11 @@ export default class Turntable extends Panel {
onTapStart
()
{
this
.
setBtnTouch
(
false
);
// 锁定按钮
Loading
.
instace
.
show
();
this
[
'container2'
].
visible
=
false
;
if
(
this
.
remainTimes
<=
0
&&
(
getHomeData
().
wealth
<
this
.
nextTimeNeedCoin
))
{
showToast
(
"元宝不足咯~快去闯关赢元宝吧"
);
Loading
.
instace
.
hide
();
return
;
}
this
.
queryPrize
();
}
...
...
@@ -87,12 +93,14 @@ export default class Turntable extends Panel {
// 设置全部按钮是否可以点击
private
setBtnTouch
(
touchEnabled
:
boolean
)
{
this
.
start_btn
.
touchEnabled
=
touchEnabled
;
this
[
"closeBtn"
].
touchEnabled
=
touchEnabled
;
}
/**
* 开始抽奖
*/
private
queryPrize
()
{
this
[
'container2'
].
visible
=
false
;
egret
.
Tween
.
removeTweens
(
this
.
panel
);
this
.
doJoin
();
}
...
...
@@ -114,10 +122,10 @@ export default class Turntable extends Panel {
const
data
=
res
.
data
;
const
code
=
res
.
code
;
let
id
=
data
.
option
.
categoryType
;
if
(
data
.
isScratchCard
)
{
id
=
"scratch"
;
}
else
if
(
!
success
||
!
data
.
option
)
{
if
(
!
success
||
!
data
.
option
)
{
id
=
"thanks"
;
}
else
if
(
data
.
isScratchCard
)
{
id
=
"scratch"
;
}
this
.
rotateByPrize
(
id
,
()
=>
{
if
(
!
success
)
{
...
...
@@ -145,11 +153,16 @@ export default class Turntable extends Panel {
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
).
then
(
async
(
mv
:
any
)
=>
{
let
_data
=
Utils
.
deepClone
(
data
);
_data
.
mv
=
mv
;
console
.
log
(
_data
);
PanelCtrl
.
instance
.
show
(
'TurnPrize2Panel'
,
_data
);
});
}
else
if
(
!
data
.
option
)
{
PanelCtrl
.
instance
.
show
(
"TurntableNoPrizePanel"
,
{
type
:
3
});
}
else
{
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
).
then
(
async
(
mv
:
any
)
=>
{
let
_data
=
Utils
.
deepClone
(
data
);
_data
.
mv
=
mv
;
PanelCtrl
.
instance
.
show
(
'TurnPrizePanel'
,
_data
);
});
}
});
})
...
...
@@ -224,6 +237,9 @@ export default class Turntable extends Panel {
this
[
'btnLabel'
].
text
=
`
${
data
.
nextTimeNeedCoin
}
元宝/次`
;
}
this
.
remainTimes
=
data
.
remainTimes
;
this
.
nextTimeNeedCoin
=
data
.
nextTimeNeedCoin
;
// 添加奖品
let
prizeList
=
[];
for
(
let
v
of
data
.
luckyDrawInfo
.
prizeList
)
{
...
...
mock/happyclear/turnablebaseInfo.json
View file @
33a168ea
...
...
@@ -42,7 +42,7 @@
},
"remainTimes"
:
0
,
"costCoinJoinTimes"
:
10
,
"nextTimeNeedCoin"
:
1
5
0
"nextTimeNeedCoin"
:
1
000
0
},
"desc"
:
"OK"
,
"success"
:
true
,
...
...
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