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
99c9d4e4
Commit
99c9d4e4
authored
Feb 22, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
3879dfd7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
70 deletions
+162
-70
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
MapScene.ts
egret/src/mapScene/MapScene.ts
+12
-2
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+35
-15
BloodPanel2.ts
egret/src/panels/BloodPanel2.ts
+35
-15
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+6
-1
ScratchPanel.ts
egret/src/panels/ScratchPanel.ts
+28
-23
ShareCodePanel.ts
egret/src/panels/ShareCodePanel.ts
+11
-3
StartPanel.ts
egret/src/panels/StartPanel.ts
+33
-11
No files found.
egret/libs/new_wx/MainBase.ts
View file @
99c9d4e4
...
@@ -533,6 +533,8 @@ export default class MainBase extends eui.UILayer {
...
@@ -533,6 +533,8 @@ export default class MainBase extends eui.UILayer {
this
.
getBackReward
(),
this
.
getBackReward
(),
this
.
hcRedBoobBaseInfo
(),
this
.
hcRedBoobBaseInfo
(),
]);
]);
//获取分享加体力的shareCode,不影响初始化场景,不进await
NetManager
.
ins
.
getUserShareCode
(()
=>
{})
MapScene
.
adData
=
DataManager
.
ins
.
getData
(
'hc_advert'
);
MapScene
.
adData
=
DataManager
.
ins
.
getData
(
'hc_advert'
);
...
...
egret/src/mapScene/MapScene.ts
View file @
99c9d4e4
...
@@ -60,8 +60,18 @@ export default class MapScene extends Scene {
...
@@ -60,8 +60,18 @@ export default class MapScene extends Scene {
//0224修改,取sceneCode,
//0224修改,取sceneCode,
const
sceneCode
=
Utils
.
getRequestByKey
(
'sceneCode'
)
const
sceneCode
=
Utils
.
getRequestByKey
(
'sceneCode'
)
if
(
sceneCode
==
CodeChannels
.
AddBlood
)
{
//加体力的,0228到时会修改成助力,这里要加逻辑
if
(
sceneCode
==
CodeChannels
.
AddBlood
)
{
//加体力的,0228到时会修改成助力,这里要加逻辑
if
(
window
[
"test0228"
])
{
if
(
window
[
"test0228"
])
{
//测试助力,到时失败code再和后端对接
NetManager
.
ins
.
doHelpNew
((
s
,
res
)
=>
{
if
(
s
)
{
showToast
(
"助力成功!"
)
}
else
if
(
res
)
{
if
(
res
.
code
==
"0000"
)
{
}
else
if
(
res
.
code
==
"00001"
)
{
}
}
else
{
showToast
(
"助力失败"
)
}
},
code
)
}
else
{
}
else
{
showToast
(
"欢迎加入游戏,去闯关吧"
);
showToast
(
"欢迎加入游戏,去闯关吧"
);
}
}
...
...
egret/src/panels/BloodPanel.ts
View file @
99c9d4e4
...
@@ -14,6 +14,7 @@ import { gotoNextLevel } from "./gotoNextLevel";
...
@@ -14,6 +14,7 @@ import { gotoNextLevel } from "./gotoNextLevel";
import
BloodPanel2
from
"./BloodPanel2"
;
import
BloodPanel2
from
"./BloodPanel2"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
BloodPanel
extends
Panel
{
export
default
class
BloodPanel
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
...
@@ -145,24 +146,43 @@ export default class BloodPanel extends Panel {
...
@@ -145,24 +146,43 @@ export default class BloodPanel extends Panel {
});
});
})
})
}
else
{
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
if
(
window
[
"test0228"
])
{
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
//如果之前没获取到,就再发接口,几率很低
wait
(
2000
).
then
(()
=>
{
if
(
!
DataManager
.
ins
.
getData
(
"getUserShareCode"
))
{
showToast
(
'对不起,索要体力的机会已经用完了~'
);
this
.
touchEnabled
=
false
});
this
.
touchChildren
=
false
NetManager
.
ins
.
getUserShareCode
((
s
,
res
)
=>
{
this
.
touchEnabled
=
true
this
.
touchChildren
=
true
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
}
})
}
else
{
}
else
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
NetManager
.
ins
.
hc_home
(()
=>
{
}
this
.
updateData
();
}
else
{
updateMainTimer
();
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
SceneCtrl
.
instance
.
updateScene
();
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'
分享成功
~'
);
showToast
(
'
对不起,索要体力的机会已经用完了
~'
);
});
});
})
}
else
{
}
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
})
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功~'
);
});
})
}
})
}
}
}
}
}
...
...
egret/src/panels/BloodPanel2.ts
View file @
99c9d4e4
...
@@ -13,6 +13,7 @@ import { showShare } from "../shareCtrl";
...
@@ -13,6 +13,7 @@ import { showShare } from "../shareCtrl";
import
BloodPanel
from
"./BloodPanel"
;
import
BloodPanel
from
"./BloodPanel"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
BloodPanel2
extends
Panel
{
export
default
class
BloodPanel2
extends
Panel
{
start
(
data
)
{
start
(
data
)
{
...
@@ -143,24 +144,43 @@ export default class BloodPanel2 extends Panel {
...
@@ -143,24 +144,43 @@ export default class BloodPanel2 extends Panel {
});
});
})
})
}
else
{
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
if
(
window
[
"test0228"
])
{
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
//如果之前没获取到,就再发接口,几率很低
wait
(
2000
).
then
(()
=>
{
if
(
!
DataManager
.
ins
.
getData
(
"getUserShareCode"
))
{
showToast
(
'对不起,索要体力的机会已经用完了~'
);
this
.
touchEnabled
=
false
});
this
.
touchChildren
=
false
NetManager
.
ins
.
getUserShareCode
((
s
,
res
)
=>
{
this
.
touchEnabled
=
true
this
.
touchChildren
=
true
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
}
})
}
else
{
}
else
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
NetManager
.
ins
.
hc_home
(()
=>
{
}
this
.
updateData
();
}
else
{
updateMainTimer
();
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
SceneCtrl
.
instance
.
updateScene
();
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'
分享成功
~'
);
showToast
(
'
对不起,索要体力的机会已经用完了
~'
);
});
});
})
}
else
{
}
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
})
NetManager
.
ins
.
hc_home
(()
=>
{
this
.
updateData
();
updateMainTimer
();
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功~'
);
});
})
}
})
}
}
}
}
}
...
...
egret/src/panels/InvitePanel.ts
View file @
99c9d4e4
...
@@ -111,7 +111,12 @@ export default class InvitePanel extends Panel {
...
@@ -111,7 +111,12 @@ export default class InvitePanel extends Panel {
}
}
for
(
let
i
=
0
;
i
<
this
.
data
.
invitationUser
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
data
.
invitationUser
.
length
;
i
++
)
{
this
.
data
.
invitationUser
[
i
][
'callFun'
]
=
()
=>
{
this
.
data
.
invitationUser
[
i
][
'callFun'
]
=
()
=>
{
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
//加个防连点,这里影响功能了,要加
this
.
touchEnabled
=
false
;
this
.
touchChildren
=
false
;
NetManager
.
ins
.
getShareCode
((
success
,
res
)
=>
{
//shareCode为啥不缓存,每次好像都一样吧,还有下面失败是否要给个toast
this
.
touchEnabled
=
true
;
this
.
touchChildren
=
true
;
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
}
}
...
...
egret/src/panels/ScratchPanel.ts
View file @
99c9d4e4
...
@@ -23,20 +23,20 @@ export default class ScratchPanel extends Panel {
...
@@ -23,20 +23,20 @@ export default class ScratchPanel extends Panel {
setGtaphics
(
x
,
y
)
{
setGtaphics
(
x
,
y
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
pIndex
%
2
==
0
)
{
// 双数
if
(
this
.
pIndex
%
2
==
0
)
{
// 双数
y
-=
25
;
y
-=
25
;
if
(
y
<=
this
[
"prizeImg"
].
y
)
{
if
(
y
<=
this
[
"prizeImg"
].
y
)
{
this
.
pIndex
++
;
this
.
pIndex
++
;
}
}
}
else
{
// 单数
}
else
{
// 单数
y
+=
25
;
y
+=
25
;
if
(
y
>=
(
this
[
"prizeImg"
].
y
+
this
[
"prizeImg"
].
height
))
{
if
(
y
>=
(
this
[
"prizeImg"
].
y
+
this
[
"prizeImg"
].
height
))
{
this
.
pIndex
++
;
this
.
pIndex
++
;
}
}
}
}
x
+=
5
;
x
+=
5
;
this
.
myShape
.
graphics
.
lineTo
(
x
,
y
);
this
.
myShape
.
graphics
.
lineTo
(
x
,
y
);
if
(
x
>
this
[
"prizeImg"
].
x
+
(
+
this
.
data
.
completePercent
)
/
100
*
this
[
"prizeImg"
].
width
-
60
)
{
if
(
x
>
this
[
"prizeImg"
].
x
+
(
+
this
.
data
.
completePercent
)
/
100
*
this
[
"prizeImg"
].
width
-
60
)
{
return
;
return
;
}
}
this
.
setGtaphics
(
x
,
y
);
this
.
setGtaphics
(
x
,
y
);
...
@@ -77,8 +77,8 @@ export default class ScratchPanel extends Panel {
...
@@ -77,8 +77,8 @@ export default class ScratchPanel extends Panel {
playBgAni
()
{
playBgAni
()
{
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
true
;
this
[
'light1'
].
visible
=
this
[
'light2'
].
visible
=
true
;
const
time
=
7000
;
const
time
=
7000
;
egret
.
Tween
.
get
(
this
[
'light1'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
time
);
egret
.
Tween
.
get
(
this
[
'light1'
],
{
loop
:
true
}).
to
({
rotation
:
360
},
time
);
egret
.
Tween
.
get
(
this
[
'light2'
],
{
loop
:
true
}).
to
({
rotation
:
-
360
},
time
);
egret
.
Tween
.
get
(
this
[
'light2'
],
{
loop
:
true
}).
to
({
rotation
:
-
360
},
time
);
}
}
showlog
()
{
showlog
()
{
...
@@ -126,17 +126,17 @@ export default class ScratchPanel extends Panel {
...
@@ -126,17 +126,17 @@ export default class ScratchPanel extends Panel {
this
[
"prizeImg"
].
source
=
this
.
data
.
prizeImage
;
this
[
"prizeImg"
].
source
=
this
.
data
.
prizeImage
;
if
(
!
this
.
data
.
avatarList
)
{
if
(
!
this
.
data
.
avatarList
)
{
this
.
data
.
avatarList
=
[];
this
.
data
.
avatarList
=
[];
}
}
// 添加邀请图标
// 添加邀请图标
let
noAvatarNum
=
this
.
data
.
helpedCount
-
this
.
data
.
avatarList
.
length
;
// 没有头像的人数
let
noAvatarNum
=
this
.
data
.
helpedCount
-
this
.
data
.
avatarList
.
length
;
// 没有头像的人数
let
dNum
=
this
.
data
.
totalNeedCount
-
this
.
data
.
avatarList
.
length
-
noAvatarNum
;
// 没邀请的人数
let
dNum
=
this
.
data
.
totalNeedCount
-
this
.
data
.
avatarList
.
length
-
noAvatarNum
;
// 没邀请的人数
for
(
let
i
=
0
;
i
<
noAvatarNum
;
i
++
)
{
for
(
let
i
=
0
;
i
<
noAvatarNum
;
i
++
)
{
this
.
data
.
avatarList
.
push
(
""
);
this
.
data
.
avatarList
.
push
(
""
);
}
}
for
(
let
i
=
0
;
i
<
dNum
;
i
++
)
{
for
(
let
i
=
0
;
i
<
dNum
;
i
++
)
{
this
.
data
.
avatarList
.
push
(
"scratch_invite_png"
);
this
.
data
.
avatarList
.
push
(
"scratch_invite_png"
);
}
}
// 添加假用户
// 添加假用户
...
@@ -144,7 +144,7 @@ export default class ScratchPanel extends Panel {
...
@@ -144,7 +144,7 @@ export default class ScratchPanel extends Panel {
// 创建渲染列表
// 创建渲染列表
let
rendererList
=
[];
let
rendererList
=
[];
for
(
let
i
=
0
;
i
<
this
.
data
.
avatarList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
data
.
avatarList
.
length
;
i
++
)
{
rendererList
.
push
({
rendererList
.
push
({
avatar
:
this
.
data
.
avatarList
[
i
],
// 传递头像
avatar
:
this
.
data
.
avatarList
[
i
],
// 传递头像
wxShareTip
:
this
[
"wxShareTip"
],
// 传递shareGroup的引用
wxShareTip
:
this
[
"wxShareTip"
],
// 传递shareGroup的引用
...
@@ -160,12 +160,12 @@ export default class ScratchPanel extends Panel {
...
@@ -160,12 +160,12 @@ export default class ScratchPanel extends Panel {
// 倒计时
// 倒计时
this
.
cutTimer
=
new
CutTimer
(
this
[
"cutTimeLabel"
],
"将在<b>hh:mm:ss</b>失效"
,
()
=>
{
this
.
cutTimer
=
new
CutTimer
(
this
[
"cutTimeLabel"
],
"将在<b>hh:mm:ss</b>失效"
,
()
=>
{
this
.
hidePanel
();
this
.
hidePanel
();
GDispatcher
.
dispatchEvent
(
"updateScratchTips"
);
GDispatcher
.
dispatchEvent
(
"updateScratchTips"
);
}
}
);
);
let
cutTime
=
this
.
data
.
endTime
-
this
.
data
.
currentTime
+
3000
;
let
cutTime
=
this
.
data
.
endTime
-
this
.
data
.
currentTime
+
3000
;
if
(
!
this
.
cutTimer
.
start
(
cutTime
))
{
if
(
!
this
.
cutTimer
.
start
(
cutTime
))
{
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
stop
();
this
.
cutTimer
.
start
(
cutTime
);
this
.
cutTimer
.
start
(
cutTime
);
}
}
...
@@ -176,18 +176,18 @@ export default class ScratchPanel extends Panel {
...
@@ -176,18 +176,18 @@ export default class ScratchPanel extends Panel {
* @param progress 进度 0 - 100
* @param progress 进度 0 - 100
*/
*/
private
setProgress
(
progress
)
{
private
setProgress
(
progress
)
{
if
(
progress
>
100
)
{
if
(
progress
>
100
)
{
progress
=
100
;
progress
=
100
;
}
else
if
(
progress
<
0
)
{
}
else
if
(
progress
<
0
)
{
progress
=
0
;
progress
=
0
;
}
}
this
[
'numLabel'
].
textFlow
=
(
new
HtmlTextParser
).
parser
(
`共<b>
${
2
+
this
.
data
.
helpedCount
}
</b>位好友帮你刮了<b>
${
progress
.
toFixed
(
2
)}
</b>%`
)
;
this
[
'numLabel'
].
textFlow
=
(
new
HtmlTextParser
).
parser
(
`共<b>
${
2
+
this
.
data
.
helpedCount
}
</b>位好友帮你刮了<b>
${
progress
.
toFixed
(
2
)}
</b>%`
);
this
[
"progressLabel"
].
textFlow
=
(
new
HtmlTextParser
).
parser
(
`仅剩<b>
${(
100
-
progress
).
toFixed
(
2
)}
</b>%`
);
// 进度条文字
this
[
"progressLabel"
].
textFlow
=
(
new
HtmlTextParser
).
parser
(
`仅剩<b>
${(
100
-
progress
).
toFixed
(
2
)}
</b>%`
);
// 进度条文字
let
_width
=
this
[
"progressBg"
].
width
*
progress
/
100
;
// 宽度
let
_width
=
this
[
"progressBg"
].
width
*
progress
/
100
;
// 宽度
let
dProgress
=
Math
.
abs
(
progress
-
this
[
"progress"
].
width
/
this
[
"progressBg"
].
width
);
// 比当前进度的差值的绝对值
let
dProgress
=
Math
.
abs
(
progress
-
this
[
"progress"
].
width
/
this
[
"progressBg"
].
width
);
// 比当前进度的差值的绝对值
let
_duration
=
1000
*
dProgress
/
100
;
// 算出变化的时间
let
_duration
=
1000
*
dProgress
/
100
;
// 算出变化的时间
egret
.
Tween
.
get
(
this
[
"progress"
]).
to
({
width
:
_width
},
_duration
);
egret
.
Tween
.
get
(
this
[
"progress"
]).
to
({
width
:
_width
},
_duration
);
}
}
private
setWXShareTip
()
{
private
setWXShareTip
()
{
...
@@ -197,7 +197,7 @@ export default class ScratchPanel extends Panel {
...
@@ -197,7 +197,7 @@ export default class ScratchPanel extends Panel {
}
}
private
hongbaoEffect
()
{
private
hongbaoEffect
()
{
egret
.
Tween
.
get
(
this
[
"hongbao"
]).
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
,
egret
.
Ease
.
quadInOut
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
[
"hongbao"
]).
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
,
egret
.
Ease
.
quadInOut
).
call
(()
=>
{
egret
.
Tween
.
get
(
this
[
"hongbao"
]).
to
({
egret
.
Tween
.
get
(
this
[
"hongbao"
]).
to
({
scaleX
:
1
,
scaleX
:
1
,
scaleY
:
1
scaleY
:
1
...
@@ -243,9 +243,14 @@ class ScratchItem extends eui.ItemRenderer {
...
@@ -243,9 +243,14 @@ class ScratchItem extends eui.ItemRenderer {
let
s
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
let
s
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
source
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
source
=
this
.
data
.
avatar
||
"http://yun.duiba.com.cn/db_games/default_avatar.png"
;
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
img
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
//加个防连点,这里影响功能了,要加,但是这里没阻止整个场景的点击事件,再说了
this
.
touchEnabled
=
false
;
this
.
touchChildren
=
false
;
NetManager
.
ins
.
clickLog
(
getlogItem
(
50
));
NetManager
.
ins
.
clickLog
(
getlogItem
(
50
));
NetManager
.
ins
.
scratchGetShareCode
((
success
,
res
)
=>
{
NetManager
.
ins
.
scratchGetShareCode
((
success
,
res
)
=>
{
//shareCode为啥不缓存,每次好像都一样吧,还有下面失败是否要给个toast
if
(
!
success
)
{
this
.
touchEnabled
=
true
;
this
.
touchChildren
=
true
;
if
(
!
success
)
{
return
;
return
;
}
}
let
shareCode
=
res
.
data
;
// 分享码
let
shareCode
=
res
.
data
;
// 分享码
...
@@ -254,14 +259,14 @@ class ScratchItem extends eui.ItemRenderer {
...
@@ -254,14 +259,14 @@ class ScratchItem extends eui.ItemRenderer {
CFG
.
wxShareTitle
=
'萌狮消消消'
;
CFG
.
wxShareTitle
=
'萌狮消消消'
;
CFG
.
wxShareDesc
=
'超好玩的萌狮消消乐,快来和我一起玩吧~'
;
CFG
.
wxShareDesc
=
'超好玩的萌狮消消乐,快来和我一起玩吧~'
;
CFG
.
wxShareImg
=
"http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg"
;
CFG
.
wxShareImg
=
"http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg"
;
if
(
iswx
())
{
//微信端
if
(
iswx
())
{
//微信端
this
.
data
.
wxShareTip
.
visible
=
true
;
this
.
data
.
wxShareTip
.
visible
=
true
;
window
[
"invokeWX"
]();
window
[
"invokeWX"
]();
}
else
{
//端内
}
else
{
//端内
this
.
data
.
wxShareTip
.
visible
=
false
;
this
.
data
.
wxShareTip
.
visible
=
false
;
// window["scratchShare"](code);
// window["scratchShare"](code);
//0224修改,去掉原先邀请逻辑,新增口令逻辑
//0224修改,去掉原先邀请逻辑,新增口令逻辑
showShareCodePanel
(
CodeChannels
.
InvitePrize
,
code
)
showShareCodePanel
(
CodeChannels
.
Scratch
,
code
)
}
}
},
this
.
data
.
scratchTaskId
);
},
this
.
data
.
scratchTaskId
);
},
this
);
},
this
);
...
...
egret/src/panels/ShareCodePanel.ts
View file @
99c9d4e4
...
@@ -41,7 +41,7 @@ const panelMsg = {
...
@@ -41,7 +41,7 @@ const panelMsg = {
interface
ShareData
{
interface
ShareData
{
channel
:
CodeChannels
,
channel
:
CodeChannels
,
shareCode
?:
string
,
//0224期加体力和排行榜分享好友没有分享码
shareCode
?:
string
,
//0224期加体力和排行榜分享好友没有分享码
addFun
:
Function
,
//点击立即前往的额外操作
addFun
?
:
Function
,
//点击立即前往的额外操作
}
}
class
ShareCodePanel
extends
ComponentBase
{
class
ShareCodePanel
extends
ComponentBase
{
...
@@ -254,10 +254,18 @@ function linkWx() {
...
@@ -254,10 +254,18 @@ function linkWx() {
/**
/**
* 唤起微信朋友圈
* 唤起微信朋友圈
* 暂未实现
* 暂未实现
,也跳微信
*/
*/
function
linkWxpyq
()
{
function
linkWxpyq
()
{
var
locatUrl
=
"weixin://"
;
if
(
/ipad|iphone|mac/i
.
test
(
navigator
.
userAgent
))
{
var
ifr
=
document
.
createElement
(
"iframe"
);
ifr
.
src
=
locatUrl
;
ifr
.
style
.
display
=
"none"
;
document
.
body
.
appendChild
(
ifr
);
}
else
{
window
.
location
.
href
=
locatUrl
;
}
}
}
/**
/**
...
...
egret/src/panels/StartPanel.ts
View file @
99c9d4e4
...
@@ -21,6 +21,7 @@ import { addAdComp } from "./BoxPanel";
...
@@ -21,6 +21,7 @@ import { addAdComp } from "./BoxPanel";
import
{
getChapterData
}
from
"../something/chapters/getChapter"
;
import
{
getChapterData
}
from
"../something/chapters/getChapter"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
showShareCodePanel
,
CodeChannels
}
from
"./ShareCodePanel"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
StartPanel
extends
Panel
{
export
default
class
StartPanel
extends
Panel
{
static
currlevel
;
static
currlevel
;
...
@@ -114,17 +115,38 @@ export default class StartPanel extends Panel {
...
@@ -114,17 +115,38 @@ export default class StartPanel extends Panel {
});
});
})
})
}
else
}
else
// showShare(1);
// showShare(1);
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
if
(
window
[
"test0228"
])
{
NetManager
.
ins
.
hc_home
(()
=>
{
//如果之前没获取到,就再发接口,几率很低
SceneCtrl
.
instance
.
updateScene
();
if
(
!
DataManager
.
ins
.
getData
(
"getUserShareCode"
))
{
},
window
[
'collectRuleId'
]);
this
.
touchEnabled
=
false
wait
(
2000
).
then
(()
=>
{
this
.
touchChildren
=
false
showToast
(
'分享成功~'
);
NetManager
.
ins
.
getUserShareCode
((
s
,
res
)
=>
{
});
this
.
touchEnabled
=
true
})
this
.
touchChildren
=
true
});
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
}
})
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
}
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
NetManager
.
ins
.
hc_home
(()
=>
{
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功~'
);
});
})
});
}
}
}
}
return
;
return
;
}
}
...
...
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