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
9473bd5e
Commit
9473bd5e
authored
Oct 26, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a3a2668d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
20 deletions
+38
-20
Turntable.ts
egret/src/panels/TurntablePanel/Turntable.ts
+38
-20
No files found.
egret/src/panels/TurntablePanel/Turntable.ts
View file @
9473bd5e
...
@@ -13,6 +13,8 @@ import Utils from "../../Utils";
...
@@ -13,6 +13,8 @@ import Utils from "../../Utils";
import
{
loadSvga
}
from
"../../loadSvga"
;
import
{
loadSvga
}
from
"../../loadSvga"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
getResPath
from
"../../../libs/new_tc/getResPath"
;
import
wait
from
"../../../libs/new_tc/wait"
;
import
wait
from
"../../../libs/new_tc/wait"
;
import
tr
=
egret
.
sys
.
tr
;
import
{
showToast
}
from
"../../../libs/new_wx/ctrls/toastCtrl"
;
// export const loadTurntableSvga = (callback) => {
// export const loadTurntableSvga = (callback) => {
// loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// loadSvga(getResPath() + 'resource/assets/svgas/turntable.svga').then(async (mv: any) => {
// // await wait(100);
// // await wait(100);
...
@@ -52,8 +54,6 @@ export default class Turntable extends Panel {
...
@@ -52,8 +54,6 @@ export default class Turntable extends Panel {
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
start_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapStart
,
this
);
this
.
start_btn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapStart
,
this
);
this
.
rulebtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapRulebtn
,
this
);
this
.
rulebtn
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapRulebtn
,
this
);
GDispatcher
.
addEvent
(
'queryPrize'
,
this
.
queryPrize
,
this
);
GDispatcher
.
addEvent
(
'panelEffect'
,
this
.
panelEffect
,
this
);
}
}
onTouchTap_closeBtn
()
{
onTouchTap_closeBtn
()
{
...
@@ -64,8 +64,7 @@ export default class Turntable extends Panel {
...
@@ -64,8 +64,7 @@ export default class Turntable extends Panel {
super
.
removeEvents
();
super
.
removeEvents
();
this
[
"closeBtn"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"closeBtn"
].
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
.
start_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapStart
,
this
);
this
.
start_btn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapStart
,
this
);
GDispatcher
.
removeEvent
(
'queryPrize'
,
this
.
queryPrize
,
this
);
this
.
rulebtn
.
removeEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTapRulebtn
,
this
);
GDispatcher
.
removeEvent
(
'panelEffect'
,
this
.
panelEffect
,
this
);
}
}
onTapRulebtn
()
{
onTapRulebtn
()
{
...
@@ -75,7 +74,8 @@ export default class Turntable extends Panel {
...
@@ -75,7 +74,8 @@ export default class Turntable extends Panel {
onTapStart
()
{
onTapStart
()
{
this
.
setBtnTouch
(
false
);
// 锁定按钮
this
.
setBtnTouch
(
false
);
// 锁定按钮
Loading
.
instace
.
show
();
Loading
.
instace
.
show
();
GDispatcher
.
dispatchEvent
(
'queryPrize'
);
this
[
'container2'
].
visible
=
false
;
this
.
queryPrize
();
}
}
updateIcon
()
{
updateIcon
()
{
...
@@ -100,23 +100,44 @@ export default class Turntable extends Panel {
...
@@ -100,23 +100,44 @@ export default class Turntable extends Panel {
*/
*/
private
doJoin
()
{
private
doJoin
()
{
try
{
try
{
if
(
window
[
'getRST'
])
window
[
'getRST'
]();
if
(
window
[
'getRST'
])
window
[
'getRST'
]();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
warn
(
error
)
console
.
warn
(
error
)
}
}
NetManager
.
ins
.
hc_turnableDojoin
((
success
,
res
)
=>
{
NetManager
.
ins
.
hc_turnableDojoin
((
success
,
res
)
=>
{
Loading
.
instace
.
hide
();
Loading
.
instace
.
hide
();
// if(!success) {
// return;
// }
const
data
=
res
.
data
;
const
code
=
res
.
code
;
let
id
=
data
.
option
.
categoryType
;
if
(
data
.
isScratchCard
)
{
id
=
"scratch"
;
}
else
if
(
!
success
||
!
data
.
option
)
{
id
=
"thanks"
;
}
this
.
rotateByPrize
(
id
,
()
=>
{
if
(
!
success
)
{
if
(
!
success
)
{
switch
(
true
)
{
case
(
code
==
"600051"
):
// 元宝不足
showToast
(
"元宝不足咯~快去闯关赢元宝吧"
);
this
.
hidePanel
();
break
;
case
(
code
==
"600015"
):
// 命中风控参与规则
PanelCtrl
.
instance
.
show
(
"TurntableNoPrizePanel"
,
{
type
:
1
});
break
;
case
(
code
==
"600016"
):
// 苏宁风控 命中
PanelCtrl
.
instance
.
show
(
"TurntableNoPrizePanel"
,
{
type
:
1
});
break
;
default
:
break
;
}
return
;
return
;
}
}
const
data
=
res
.
data
;
this
.
rotateByPrize
(
data
.
option
.
categoryType
,
()
=>
{
//1换个姿势再来一次2 奖励溜走了3 离奖励只差一毫米
//抽奖结束
if
(
data
.
isScratchCard
&&
data
.
option
)
{
// 刮刮卡
if
(
data
.
isScratchCard
)
{
// 刮刮卡
//如果是刮刮卡类型
//如果是刮刮卡类型
this
.
updateIcon
();
this
.
updateIcon
();
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
).
then
(
async
(
mv
:
any
)
=>
{
loadSvga
(
getResPath
()
+
'resource/assets/svgas/turnprize.svga'
).
then
(
async
(
mv
:
any
)
=>
{
...
@@ -126,11 +147,8 @@ export default class Turntable extends Panel {
...
@@ -126,11 +147,8 @@ export default class Turntable extends Panel {
PanelCtrl
.
instance
.
show
(
'TurnPrize2Panel'
,
_data
);
PanelCtrl
.
instance
.
show
(
'TurnPrize2Panel'
,
_data
);
});
});
}
else
if
(
!
data
.
option
)
{
}
else
if
(
!
data
.
option
)
{
PanelCtrl
.
instance
.
show
(
"TurntableNoPrizePanel"
);
PanelCtrl
.
instance
.
show
(
"TurntableNoPrizePanel"
,
{
type
:
3
});
}
else
{
}
}
});
});
})
})
}
}
...
...
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