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
9be9ce40
Commit
9be9ce40
authored
Mar 02, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
766f0cf3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
22 deletions
+127
-22
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+19
-0
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+8
-3
BloodPanel2.ts
egret/src/panels/BloodPanel2.ts
+7
-4
StartPanel.ts
egret/src/panels/StartPanel.ts
+65
-15
config.js
mock/config.js
+3
-0
getInvitedUserList.json
mock/happyclear/getInvitedUserList.json
+25
-0
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
9be9ce40
...
@@ -2415,4 +2415,23 @@ export class NetManager extends ABNetManager {
...
@@ -2415,4 +2415,23 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
* 查询邀请用户列表
* @param callback
*/
public
getInvitedUserList
(
callback
:
Function
)
{
const
net
:
INetData
=
{
name
:
"getInvitedUserList"
,
uri
:
window
[
'duiba'
]
+
'/activtySimpleShareCode/getInvitedUserList'
,
type
:
'get'
,
dataType
:
'json'
,
hideMsg
:
true
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
count
:
10
},
callback
:
callback
};
this
.
send
(
net
);
}
}
}
\ No newline at end of file
egret/src/panels/BloodPanel.ts
View file @
9be9ce40
...
@@ -17,11 +17,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
...
@@ -17,11 +17,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
BloodPanel
extends
Panel
{
export
default
class
BloodPanel
extends
Panel
{
//修改,暂时只能根据接口获取
private
askForEnergyCount
:
number
=
0
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
updateData
();
this
.
updateData
();
this
.
showlog
();
this
.
showlog
();
//获取下邀请人数,
NetManager
.
ins
.
getInvitedUserList
((
s
,
res
)
=>
{
if
(
s
)
this
.
askForEnergyCount
=
res
.
data
.
count
})
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
this
[
'resumeBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
[
'resumeBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
gotoNextLevel
();
gotoNextLevel
();
...
@@ -44,8 +49,8 @@ export default class BloodPanel extends Panel {
...
@@ -44,8 +49,8 @@ export default class BloodPanel extends Panel {
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
const
data
=
getHomeData
();
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领
${
data
.
askForEnergy
}
/
${
BloodPanel
.
MAX
}
)`
;
this
[
'invitTxt'
].
text
=
`(已领
${
this
.
askForEnergyCount
/*data.askForEnergy*/
}
/
${
BloodPanel
.
MAX
}
)`
;
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
this
.
askForEnergyCount
/*data.askForEnergy*/
>=
BloodPanel
.
MAX
)
{
this
[
'inviteBtn2'
].
visible
=
true
;
this
[
'inviteBtn2'
].
visible
=
true
;
}
}
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
...
@@ -127,7 +132,7 @@ export default class BloodPanel extends Panel {
...
@@ -127,7 +132,7 @@ export default class BloodPanel extends Panel {
if
(
iswx
())
{
if
(
iswx
())
{
//微信流程不变
//微信流程不变
getShareUrl
(
this
.
stage
);
getShareUrl
(
this
.
stage
);
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
this
.
askForEnergyCount
/*data.askForEnergy*/
>=
BloodPanel
.
MAX
)
{
showToast
(
'对不起,索要体力的机会已经用完了~'
);
showToast
(
'对不起,索要体力的机会已经用完了~'
);
return
;
return
;
}
}
...
...
egret/src/panels/BloodPanel2.ts
View file @
9be9ce40
...
@@ -16,13 +16,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
...
@@ -16,13 +16,16 @@ import { showShareCodePanel, CodeChannels } from "./ShareCodePanel";
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
export
default
class
BloodPanel2
extends
Panel
{
export
default
class
BloodPanel2
extends
Panel
{
//修改,暂时只能根据接口获取
private
askForEnergyCount
:
number
=
0
start
(
data
)
{
start
(
data
)
{
super
.
start
();
super
.
start
();
this
.
updateData
();
this
.
updateData
();
this
.
showlog
();
this
.
showlog
();
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
this
[
'price1Txt'
].
text
=
`
${
window
[
'price1'
]}
个元宝=1个体力值`
;
//获取下邀请人数,
NetManager
.
ins
.
getInvitedUserList
((
s
,
res
)
=>
{
if
(
s
)
this
.
askForEnergyCount
=
res
.
data
.
count
})
}
}
showlog
()
{
showlog
()
{
...
@@ -39,8 +42,8 @@ export default class BloodPanel2 extends Panel {
...
@@ -39,8 +42,8 @@ export default class BloodPanel2 extends Panel {
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
this
[
'bloodTxt'
].
text
=
`你的可用体力值为:
${
homeData
.
remainEnargy
}
`
;
const
data
=
getHomeData
();
const
data
=
getHomeData
();
this
[
'invitTxt'
].
text
=
`(已领
${
data
.
askForEnergy
}
/
${
BloodPanel
.
MAX
}
)`
;
this
[
'invitTxt'
].
text
=
`(已领
${
this
.
askForEnergyCount
/*data.askForEnergy*/
}
/
${
BloodPanel
.
MAX
}
)`
;
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
this
.
askForEnergyCount
/*data.askForEnergy*/
>=
BloodPanel
.
MAX
)
{
this
[
'inviteBtn2'
].
visible
=
true
;
this
[
'inviteBtn2'
].
visible
=
true
;
}
}
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
if
(
data
.
remainEnargy
>=
BLOOD_NUMS_MAX
)
{
//满了
...
@@ -124,7 +127,7 @@ export default class BloodPanel2 extends Panel {
...
@@ -124,7 +127,7 @@ export default class BloodPanel2 extends Panel {
if
(
iswx
())
{
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
getShareUrl
(
this
.
stage
);
//原先微信流程不变
//原先微信流程不变
if
(
data
.
askForEnergy
>=
BloodPanel
.
MAX
)
{
if
(
this
.
askForEnergyCount
/*data.askForEnergy*/
>=
BloodPanel
.
MAX
)
{
showToast
(
'对不起,索要体力的机会已经用完了~'
);
showToast
(
'对不起,索要体力的机会已经用完了~'
);
return
;
return
;
}
}
...
...
egret/src/panels/StartPanel.ts
View file @
9be9ce40
...
@@ -31,7 +31,8 @@ export default class StartPanel extends Panel {
...
@@ -31,7 +31,8 @@ export default class StartPanel extends Panel {
showlog
()
{
showlog
()
{
}
}
//修改,暂时只能根据接口获取
private
askForEnergyCount
:
number
=
0
start
(
data
)
{
start
(
data
)
{
this
.
showlog
()
this
.
showlog
()
super
.
start
();
super
.
start
();
...
@@ -40,6 +41,9 @@ export default class StartPanel extends Panel {
...
@@ -40,6 +41,9 @@ export default class StartPanel extends Panel {
this
[
'price4'
].
text
=
`-
${
window
[
'price4'
]}
元宝`
;
this
[
'price4'
].
text
=
`-
${
window
[
'price4'
]}
元宝`
;
const
homedata
=
getHomeData
();
const
homedata
=
getHomeData
();
//获取下邀请人数,
NetManager
.
ins
.
getInvitedUserList
((
s
,
res
)
=>
{
if
(
s
)
this
.
askForEnergyCount
=
res
.
data
.
count
})
if
(
data
>
homedata
.
levels
.
length
)
{
if
(
data
>
homedata
.
levels
.
length
)
{
addAdComp
(
84
,
901
,
this
,
29
);
addAdComp
(
84
,
901
,
this
,
29
);
NetManager
.
ins
.
showLog
(
getlogItem
(
29
));
NetManager
.
ins
.
showLog
(
getlogItem
(
29
));
...
@@ -85,25 +89,71 @@ export default class StartPanel extends Panel {
...
@@ -85,25 +89,71 @@ export default class StartPanel extends Panel {
this
[
'startBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_startBtn
,
this
);
this
[
'startBtn'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
this
.
onTap_startBtn
,
this
);
}
}
// onTap_startBtn() {
// const homeData = getHomeData();
// if (homeData.remainEnargy <= 0) {
// if (homeData.askForEnergy) {
// PanelCtrl.instance.show('blood2Panel');
// } else {
// if (iswx()) {
// getShareUrl(this.stage);
// } else
// showShare(1);
// NetManager.ins.hc_askForEnergy((success) => {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId']);
// wait(2000).then(() => {
// showToast('分享成功~');
// });
// })
// }
// return;
// }
// // Loading.instace.show();
// this.touchChildren = false;
// this.touchEnabled = false;
// // try {
// // if (window['getRST']) window['getRST']();
// // } catch (error) {
// // console.warn(error)
// // }
// hdGameDoDojoin(async (success) => {
// // Loading.instace.hide();
// this.touchChildren = true;
// this.touchEnabled = true;
// wait(5000).then(() => {
// updateMainTimerAfterGetData();
// });
// if (success) {
// // Loading.instace.show();
// this.hidePanel();
// try {
// const key = 'main2';
// await Promise.all([
// RES.getResAsync(`${key}_json`),
// RES.getResAsync(`${key}_png`)]);
// } catch (error) {
// }
// // Loading.instace.hide();
// SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, { chapter: this._level });
// StartPanel.currlevel = this._level
// }
// }, this._level);
// }
onTap_startBtn
()
{
onTap_startBtn
()
{
const
homeData
=
getHomeData
();
const
homeData
=
getHomeData
();
if
(
homeData
.
remainEnargy
<=
0
)
{
if
(
homeData
.
remainEnargy
<=
0
)
{
if
(
homeData
.
askForEnergy
)
{
if
(
/*homeData.askForEnergy*/
this
.
askForEnergyCount
)
{
PanelCtrl
.
instance
.
show
(
'blood2Panel'
);
PanelCtrl
.
instance
.
show
(
'blood2Panel'
);
}
else
{
}
else
{
// if(iswx()) {
// getShareUrl(this.stage);
// } else
// showShare(1);
// NetManager.ins.hc_askForEnergy((success) => {
// NetManager.ins.hc_home(() => {
// SceneCtrl.instance.updateScene();
// }, window['collectRuleId']);
// wait(2000).then(() => {
// showToast('分享成功~');
// });
// })
//0224修改,微信环境不变
if
(
iswx
())
{
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
getShareUrl
(
this
.
stage
);
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
NetManager
.
ins
.
hc_askForEnergy
((
success
)
=>
{
...
...
mock/config.js
View file @
9be9ce40
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
const
config
=
{
const
config
=
{
'/activtySimpleShareCode/getInvitedUserList'
:
{
data
:
'./happyclear/getInvitedUserList.json'
},
'/crecord/getrecord'
:
{
'/crecord/getrecord'
:
{
data
:
'./happyclear/getrecord.json'
data
:
'./happyclear/getrecord.json'
},
},
...
...
mock/happyclear/getInvitedUserList.json
0 → 100644
View file @
9be9ce40
{
"success"
:
true
,
"code"
:
""
,
"desc"
:
""
,
"data"
:{
"count"
:
5
,
"userList"
:[
{
"consumerId"
:
123
,
"nickname"
:
"小明"
,
"avatar"
:
"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
},
{
"consumerId"
:
456
,
"nickname"
:
"小黄"
,
"avatar"
:
"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
},
{
"consumerId"
:
123
,
"nickname"
:
"小明"
,
"avatar"
:
"//yun.duiba.com.cn/duibaManagerWeb/i6pouxupj0.png"
}
]
}
}
\ 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