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
4875fcbf
Commit
4875fcbf
authored
Oct 26, 2019
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
96ed04f1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
30 deletions
+84
-30
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+10
-0
ScratchSkin.exml
egret/resource/skins/ScratchSkin.exml
+1
-0
Turntable.ts
egret/src/panels/TurntablePanel/Turntable.ts
+64
-28
turnablebaseInfo.json
mock/happyclear/turnablebaseInfo.json
+9
-2
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
4875fcbf
...
@@ -2107,6 +2107,11 @@ export class NetManager extends ABNetManager {
...
@@ -2107,6 +2107,11 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 获取邀请码
* @param callback
* @param scratchCardTaskId 刮刮卡任务id
*/
public
scratchGetShareCode
(
callback
:
Function
,
scratchCardTaskId
):
void
{
public
scratchGetShareCode
(
callback
:
Function
,
scratchCardTaskId
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
SCRATCH_GET_SHARECODE
,
name
:
NetName
.
SCRATCH_GET_SHARECODE
,
...
@@ -2123,6 +2128,11 @@ export class NetManager extends ABNetManager {
...
@@ -2123,6 +2128,11 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 助力
* @param callback
* @param shareCode 分享码
*/
public
scratchDoHelp
(
callback
:
Function
,
shareCode
):
void
{
public
scratchDoHelp
(
callback
:
Function
,
shareCode
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
SCRATCH_DOHELP
,
name
:
NetName
.
SCRATCH_DOHELP
,
...
...
egret/resource/skins/ScratchSkin.exml
View file @
4875fcbf
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Label
id=
"cutTimeLabel"
text=
"将在23:43:21后失效"
y=
"895.33"
size=
"28"
textColor=
"0xffffff"
horizontalCenter=
"0.5"
/>
<e:Label
id=
"cutTimeLabel"
text=
"将在23:43:21后失效"
y=
"895.33"
size=
"28"
textColor=
"0xffffff"
horizontalCenter=
"0.5"
/>
<e:Label
text=
"帮刮\n记录"
y=
"805"
size=
"28"
textColor=
"0xFFFFFF"
horizontalCenter=
"-248"
/>
<e:Scroller
width=
"487"
height=
"90"
y=
"783"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
horizontalCenter=
"32.5"
>
<e:Scroller
width=
"487"
height=
"90"
y=
"783"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
horizontalCenter=
"32.5"
>
<e:Group
anchorOffsetX=
"0"
y=
"2"
>
<e:Group
anchorOffsetX=
"0"
y=
"2"
>
<e:List
id=
"list"
x=
"0"
y=
"0"
anchorOffsetX=
"0"
>
<e:List
id=
"list"
x=
"0"
y=
"0"
anchorOffsetX=
"0"
>
...
...
egret/src/panels/TurntablePanel/Turntable.ts
View file @
4875fcbf
...
@@ -32,16 +32,21 @@ export default class Turntable extends Panel {
...
@@ -32,16 +32,21 @@ export default class Turntable extends Panel {
super
();
super
();
this
.
data
=
data
;
this
.
data
=
data
;
}
}
hand
;
hand
;
async
start
(
data
?)
{
async
start
(
data
?)
{
super
.
start
();
super
.
start
();
console
.
log
(
data
.
onceAgain
)
console
.
log
(
data
.
onceAgain
)
this
[
'container'
].
addChild
(
this
.
data
.
mv
);
this
[
'container'
].
addChild
(
this
.
data
.
mv
);
this
.
hand
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/hand.svga'
,
this
[
'container2'
])
this
.
hand
=
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/hand.svga'
,
this
[
'container2'
])
this
[
'container2'
].
touchEnabled
=
false
;
this
[
'container2'
].
touchEnabled
=
false
;
this
[
'container2'
].
touchChildren
=
false
;
this
[
'container2'
].
touchChildren
=
false
;
this
.
initUI
();
}
}
rulebtn
;
rulebtn
;
initEvents
()
{
initEvents
()
{
super
.
initEvents
();
super
.
initEvents
();
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
this
[
"closeBtn"
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTouchTap_closeBtn
,
this
);
...
@@ -66,6 +71,7 @@ export default class Turntable extends Panel {
...
@@ -66,6 +71,7 @@ export default class Turntable extends Panel {
onTapRulebtn
()
{
onTapRulebtn
()
{
PanelCtrl
.
instance
.
show
(
'TurnRulePanel'
)
PanelCtrl
.
instance
.
show
(
'TurnRulePanel'
)
}
}
onTapStart
()
{
onTapStart
()
{
// this.setBtnTouch(false); // 锁定按钮
// this.setBtnTouch(false); // 锁定按钮
// Loading.instace.show();
// Loading.instace.show();
...
@@ -77,11 +83,11 @@ export default class Turntable extends Panel {
...
@@ -77,11 +83,11 @@ export default class Turntable extends Panel {
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
)
=>
{
// await wait(100);
// await wait(100);
PanelCtrl
.
instance
.
show
(
'TurnPrize2Panel'
,
{
mv
:
mv
});
PanelCtrl
.
instance
.
show
(
'TurnPrize2Panel'
,
{
mv
:
mv
});
});
});
}
}
updateIcon
(){
updateIcon
()
{
GDispatcher
.
dispatchEvent
(
"updateScratchTips"
);
GDispatcher
.
dispatchEvent
(
"updateScratchTips"
);
}
}
...
@@ -158,16 +164,11 @@ export default class Turntable extends Panel {
...
@@ -158,16 +164,11 @@ export default class Turntable extends Panel {
*/
*/
private
rotate
(
rotation
:
number
,
time
:
number
,
callFun
:
Function
)
{
private
rotate
(
rotation
:
number
,
time
:
number
,
callFun
:
Function
)
{
let
tw
=
egret
.
Tween
.
get
(
this
.
panel
);
let
tw
=
egret
.
Tween
.
get
(
this
.
panel
);
tw
.
to
({
rotation
:
rotation
},
time
,
egret
.
Ease
.
cubicInOut
).
wait
(
500
).
call
(
callFun
);
tw
.
to
({
rotation
:
rotation
},
time
,
egret
.
Ease
.
cubicInOut
).
wait
(
500
).
call
(
callFun
);
}
}
protected
onSkinComplete
():
void
{
protected
onSkinComplete
():
void
{
super
.
onSkinComplete
();
super
.
onSkinComplete
();
this
.
onLoad
();
}
protected
onLoad
():
void
{
this
.
initUI
();
}
}
private
initUI
():
void
{
private
initUI
():
void
{
...
@@ -180,14 +181,14 @@ export default class Turntable extends Panel {
...
@@ -180,14 +181,14 @@ export default class Turntable extends Panel {
}
}
private
panelEffect
()
{
private
panelEffect
()
{
egret
.
Tween
.
get
(
this
.
panel
).
to
({
rotation
:
360
},
20000
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
.
panel
).
to
({
rotation
:
360
},
20000
).
call
(()
=>
{
this
.
panelEffect
();
this
.
panelEffect
();
});
});
}
}
protected
async
preLoadRes
()
{
protected
async
preLoadRes
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
resolve
();
resolve
();
});
});
}
}
...
@@ -196,22 +197,57 @@ export default class Turntable extends Panel {
...
@@ -196,22 +197,57 @@ export default class Turntable extends Panel {
* 获得所有奖品信息
* 获得所有奖品信息
*/
*/
private
getPrizeInfo
()
{
private
getPrizeInfo
()
{
/////////////////////////////////////////// 查询奖品加入转盘数据 ///////////////////////////////////////////
NetManager
.
ins
.
hc_turnableBaseInfo
((
success
,
res
)
=>
{
// let data = DataManager.ins.ajaxElementData.options;
if
(
!
success
)
{
// let options = Utils.deepClone(data);
return
;
// for(let i = 0; i < options.length; i++) {
}
// let v = options[i];
let
prizeList
=
Utils
.
deepClone
(
res
.
data
.
prizeList
);
// if(v.scoreArea == "1,1") {
prizeList
.
push
({
// options.splice(i--, 1);
categoryType
:
'thanks'
,
// }
},
{
// }
categoryType
:
'scratch'
,
// for(let i = 0; i < options.length; i++) {
});
// let v = options[i];
for
(
let
i
=
0
;
i
<
prizeList
.
length
;
i
++
)
{
// RotaryData.key.push(v.id);
let
v
=
prizeList
[
i
];
// RotaryData.data[v.id] = [{start: i * 40 - 15, end: i * 40 + 15}];
let
prizeImg
=
""
;
// this[`img${i}`].source = v.logo;
switch
(
v
.
categoryType
)
{
// this[`lab${i}`].text = v.name;
case
"scratch"
:
// }
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/object.png"
;
break
;
case
"thanks"
:
prizeImg
=
"//yun.duiba.com.cn/upload/uP99F1462438316972.png"
;
break
;
case
1
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
;
break
;
case
2
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/qb.png"
;
break
;
case
3
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/phonebill.png"
;
break
;
case
4
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/object.png"
;
break
;
case
5
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png"
;
break
;
case
6
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/qb.png"
;
break
;
case
7
:
prizeImg
=
"//yun.duiba.com.cn/developer/img/activityTool/slotMachine/phonebill.png"
;
break
;
default
:
break
;
}
v
.
prizeImg
=
prizeImg
;
RotaryData
.
key
.
push
(
v
.
categoryType
);
RotaryData
.
data
[
v
.
categoryType
]
=
[{
start
:
i
*
60
-
20
,
end
:
i
*
60
+
20
}];
this
[
`img
${
i
}
`
].
source
=
v
.
prizeImg
;
}
});
console
.
log
(
RotaryData
);
console
.
log
(
RotaryData
);
}
}
}
}
\ No newline at end of file
mock/happyclear/turnablebaseInfo.json
View file @
4875fcbf
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
},
},
{
{
"appItemId"
:
2099
,
"appItemId"
:
2099
,
"categoryType"
:
7
,
"categoryType"
:
6
,
"img"
:
"虚拟商品图片"
,
"img"
:
"虚拟商品图片"
,
"name"
:
"虚拟商品名称"
,
"name"
:
"虚拟商品名称"
,
"rate"
:
"30"
,
"rate"
:
"30"
,
...
@@ -30,7 +30,14 @@
...
@@ -30,7 +30,14 @@
"propType"
:
2
,
"propType"
:
2
,
"rate"
:
"30"
,
"rate"
:
"30"
,
"title"
:
"奖品信息"
"title"
:
"奖品信息"
}
},
{
"categoryType"
:
8
,
"num"
:
10
,
"propType"
:
2
,
"rate"
:
"30"
,
"title"
:
"奖品信息"
},
]
]
},
},
"remainTimes"
:
1
,
"remainTimes"
:
1
,
...
...
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