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
6f2a5683
Commit
6f2a5683
authored
Oct 11, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev
parents
0cbf40d8
46d69171
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
239 additions
and
127 deletions
+239
-127
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+189
-112
InvitePrizePanelSkin.exml
egret/resource/skins/InvitePrizePanelSkin.exml
+1
-6
InviteRulePanelSkin.exml
egret/resource/skins/InviteRulePanelSkin.exml
+1
-1
InvitePanel.ts
egret/src/panels/InvitePanel.ts
+0
-2
InvitePrizePanel.ts
egret/src/panels/InvitePrizePanel.ts
+0
-3
config.js
mock/config.js
+12
-3
doHelp.json
mock/happyclear/doHelp.json
+7
-0
getInviteInfo.json
mock/happyclear/getInviteInfo.json
+22
-0
getShareCode.json
mock/happyclear/getShareCode.json
+7
-0
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
6f2a5683
...
@@ -10,22 +10,24 @@ import { IExposureData } from '../data/common/IExposureData';
...
@@ -10,22 +10,24 @@ import { IExposureData } from '../data/common/IExposureData';
import
{
GDispatcher
}
from
'../../tc/util/GDispatcher'
;
import
{
GDispatcher
}
from
'../../tc/util/GDispatcher'
;
import
onNotSuccess
from
'../../new_wx/onNotSuccess'
;
import
onNotSuccess
from
'../../new_wx/onNotSuccess'
;
import
{
showToast
}
from
'../../new_wx/ctrls/toastCtrl'
;
import
{
showToast
}
from
'../../new_wx/ctrls/toastCtrl'
;
// import { IExposureData } from '..';
// import { IExposureData } from '..';
export
class
NetManager
extends
ABNetManager
{
export
class
NetManager
extends
ABNetManager
{
private
static
instance
:
NetManager
;
private
static
instance
:
NetManager
;
public
static
get
ins
():
NetManager
{
public
static
get
ins
():
NetManager
{
if
(
!
this
.
instance
)
{
if
(
!
this
.
instance
)
{
this
.
instance
=
new
NetManager
();
this
.
instance
=
new
NetManager
();
}
}
return
this
.
instance
;
return
this
.
instance
;
}
}
private
isInit
:
boolean
;
private
isInit
:
boolean
;
constructor
()
{
constructor
()
{
super
();
super
();
if
(
this
.
isInit
)
{
if
(
this
.
isInit
)
{
throw
Error
(
TwLang
.
lang_001
);
throw
Error
(
TwLang
.
lang_001
);
}
}
this
.
isInit
=
true
;
this
.
isInit
=
true
;
...
@@ -96,7 +98,7 @@ export class NetManager extends ABNetManager {
...
@@ -96,7 +98,7 @@ export class NetManager extends ABNetManager {
*/
*/
public
addTimesForActivity
(
callback
:
Function
,
type
:
number
,
count
:
number
,
validType
:
number
):
void
{
public
addTimesForActivity
(
callback
:
Function
,
type
:
number
,
count
:
number
,
validType
:
number
):
void
{
let
activityId
:
number
;
let
activityId
:
number
;
if
(
type
==
1
)
{
if
(
type
==
1
)
{
activityId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
activityId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
}
else
{
}
else
{
activityId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
activityId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
...
@@ -106,7 +108,7 @@ export class NetManager extends ABNetManager {
...
@@ -106,7 +108,7 @@ export class NetManager extends ABNetManager {
addCount
:
count
,
addCount
:
count
,
activityId
:
activityId
activityId
:
activityId
};
};
if
(
validType
)
{
if
(
validType
)
{
param
.
validType
=
validType
;
param
.
validType
=
validType
;
}
}
...
@@ -147,15 +149,15 @@ export class NetManager extends ABNetManager {
...
@@ -147,15 +149,15 @@ export class NetManager extends ABNetManager {
public
openCollectGoodsPrize
(
callback
:
Function
,
collectRuleId
:
number
,
type
?:
number
):
void
{
public
openCollectGoodsPrize
(
callback
:
Function
,
collectRuleId
:
number
,
type
?:
number
):
void
{
let
actId
:
number
;
let
actId
:
number
;
let
param
:
any
;
let
param
:
any
;
if
(
type
==
1
)
{
if
(
type
==
1
)
{
actId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
actId
=
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
;
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
actId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
actId
=
DataManager
.
ins
.
customCfgData
.
oaId
;
}
}
if
(
type
)
{
if
(
type
)
{
param
=
{
collectRuleId
:
collectRuleId
,
actId
:
actId
}
param
=
{
collectRuleId
:
collectRuleId
,
actId
:
actId
}
}
else
{
}
else
{
param
=
{
collectRuleId
:
collectRuleId
};
param
=
{
collectRuleId
:
collectRuleId
};
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
NetName
.
OPEN_COLLECT
,
name
:
NetName
.
OPEN_COLLECT
,
...
@@ -236,14 +238,13 @@ export class NetManager extends ABNetManager {
...
@@ -236,14 +238,13 @@ export class NetManager extends ABNetManager {
uri
:
'/summer/getToyInfo'
,
uri
:
'/summer/getToyInfo'
,
type
:
'get'
,
type
:
'get'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
operatingActivityId
:
operatingActivityId
},
param
:
{
operatingActivityId
:
operatingActivityId
},
callback
:
callback
callback
:
callback
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
/**
* 开始游戏
* 开始游戏
* @param {string} isAgain 是否是再来一次
* @param {string} isAgain 是否是再来一次
...
@@ -253,7 +254,7 @@ export class NetManager extends ABNetManager {
...
@@ -253,7 +254,7 @@ export class NetManager extends ABNetManager {
public
doStart
(
callback
:
Function
,
isAgain
:
boolean
,
credits
?:
number
,
customizedType
?:
number
):
void
{
public
doStart
(
callback
:
Function
,
isAgain
:
boolean
,
credits
?:
number
,
customizedType
?:
number
):
void
{
let
addUrl
=
''
;
let
addUrl
=
''
;
if
(
isAgain
)
{
if
(
isAgain
)
{
addUrl
+=
'?dpm='
+
DataManager
.
ins
.
gameGetSubmitResultData
.
againExposure
.
dpm
;
addUrl
+=
'?dpm='
+
DataManager
.
ins
.
gameGetSubmitResultData
.
againExposure
.
dpm
;
}
}
...
@@ -262,11 +263,11 @@ export class NetManager extends ABNetManager {
...
@@ -262,11 +263,11 @@ export class NetManager extends ABNetManager {
oaId
:
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
oaId
:
DataManager
.
ins
.
gameCfgData
.
gameInfo
.
oaId
};
};
if
(
credits
)
{
if
(
credits
)
{
param
.
credits
=
credits
;
param
.
credits
=
credits
;
}
}
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
;
param
.
customizedType
=
customizedType
;
}
}
...
@@ -293,7 +294,7 @@ export class NetManager extends ABNetManager {
...
@@ -293,7 +294,7 @@ export class NetManager extends ABNetManager {
const
param
:
any
=
{
const
param
:
any
=
{
ticketId
:
ticketId
ticketId
:
ticketId
};
};
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
param
.
customizedType
=
customizedType
}
}
...
@@ -327,6 +328,7 @@ export class NetManager extends ABNetManager {
...
@@ -327,6 +328,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
/**
/**
* 复活
* 复活
*/
*/
...
@@ -345,6 +347,7 @@ export class NetManager extends ABNetManager {
...
@@ -345,6 +347,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
getToken
(
net
);
this
.
getToken
(
net
);
}
}
/**
/**
* 获得复活卡数量
* 获得复活卡数量
*/
*/
...
@@ -363,6 +366,7 @@ export class NetManager extends ABNetManager {
...
@@ -363,6 +366,7 @@ export class NetManager extends ABNetManager {
this
.
getToken
(
net
);
this
.
getToken
(
net
);
}
}
/**
/**
* 猜扑克
* 猜扑克
* @param {number} pluginId 插件ID
* @param {number} pluginId 插件ID
...
@@ -417,7 +421,7 @@ export class NetManager extends ABNetManager {
...
@@ -417,7 +421,7 @@ export class NetManager extends ABNetManager {
sgin
:
sign
,
sgin
:
sign
,
dynamicData
:
JSON
.
stringify
(
dynamicData
)
dynamicData
:
JSON
.
stringify
(
dynamicData
)
};
};
if
(
rankId
)
{
if
(
rankId
)
{
param
.
rankId
=
rankId
;
param
.
rankId
=
rankId
;
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
...
@@ -437,15 +441,20 @@ export class NetManager extends ABNetManager {
...
@@ -437,15 +441,20 @@ export class NetManager extends ABNetManager {
kk
=
kk
.
substring
(
0
,
16
);
kk
=
kk
.
substring
(
0
,
16
);
//补0;
//补0;
var
len
=
kk
.
length
;
var
len
=
kk
.
length
;
while
(
len
<
16
)
{
while
(
len
<
16
)
{
kk
=
kk
+
"0"
;
kk
=
kk
+
"0"
;
len
++
;
len
++
;
}
}
var
CryptoJS
=
window
[
"CryptoJS"
];
var
CryptoJS
=
window
[
"CryptoJS"
];
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
kk
);
var
key
=
CryptoJS
.
enc
.
Utf8
.
parse
(
kk
);
var
iv
=
CryptoJS
.
enc
.
Utf8
.
parse
(
kk
);
var
iv
=
CryptoJS
.
enc
.
Utf8
.
parse
(
kk
);
return
CryptoJS
.
AES
.
encrypt
(
data
,
key
,
{
iv
:
iv
,
mode
:
CryptoJS
.
mode
.
CBC
,
padding
:
CryptoJS
.
pad
.
ZeroPadding
}).
toString
();
return
CryptoJS
.
AES
.
encrypt
(
data
,
key
,
{
iv
:
iv
,
mode
:
CryptoJS
.
mode
.
CBC
,
padding
:
CryptoJS
.
pad
.
ZeroPadding
}).
toString
();
}
}
/**
/**
*
*
* @param callback
* @param callback
...
@@ -489,6 +498,7 @@ export class NetManager extends ABNetManager {
...
@@ -489,6 +498,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
hc_openTreasureBox
(
callback
:
Function
):
void
{
hc_openTreasureBox
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'hc_openTreasureBox'
,
name
:
'hc_openTreasureBox'
,
...
@@ -558,10 +568,10 @@ export class NetManager extends ABNetManager {
...
@@ -558,10 +568,10 @@ export class NetManager extends ABNetManager {
sgin
:
sign
,
sgin
:
sign
,
dynamicData
:
dynamicData
dynamicData
:
dynamicData
};
};
if
(
checkScore
)
{
if
(
checkScore
)
{
param
.
checkScore
=
checkScore
;
param
.
checkScore
=
checkScore
;
}
}
if
(
customizedType
)
{
if
(
customizedType
)
{
param
.
customizedType
=
customizedType
;
param
.
customizedType
=
customizedType
;
}
}
...
@@ -731,7 +741,7 @@ export class NetManager extends ABNetManager {
...
@@ -731,7 +741,7 @@ export class NetManager extends ABNetManager {
public
getPlugOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
:
Function
,
pollingCount
=
10
,
prizeLevel
?:
number
):
void
{
public
getPlugOrderStatus
(
callback
:
Function
,
orderId
:
number
,
pollingCheck
:
Function
,
pollingCount
=
10
,
prizeLevel
?:
number
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getPlugOrderStatus'
,
name
:
'getPlugOrderStatus'
,
uri
:
window
[
'duiba'
]
+
'/plugin/getOrderStatus'
,
uri
:
window
[
'duiba'
]
+
'/plugin/getOrderStatus'
,
type
:
'get'
,
type
:
'get'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
...
@@ -740,7 +750,7 @@ export class NetManager extends ABNetManager {
...
@@ -740,7 +750,7 @@ export class NetManager extends ABNetManager {
callback
:
callback
,
callback
:
callback
,
pollingCheck
:
pollingCheck
,
pollingCheck
:
pollingCheck
,
pollingCount
:
pollingCount
,
pollingCount
:
pollingCount
,
hideMsg
:
true
hideMsg
:
true
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
...
@@ -818,10 +828,11 @@ export class NetManager extends ABNetManager {
...
@@ -818,10 +828,11 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
getShareInfo
(
callback
:
Function
,
):
void
{
public
getShareInfo
(
callback
:
Function
,):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getShareInfo'
,
name
:
'getShareInfo'
,
uri
:
window
[
'duiba'
]
+
'/wechatShare/getShareInfo/v2'
,
uri
:
window
[
'duiba'
]
+
'/wechatShare/getShareInfo/v2'
,
type
:
'get'
,
type
:
'get'
,
hideMsg
:
true
,
hideMsg
:
true
,
dataType
:
'json'
,
dataType
:
'json'
,
...
@@ -833,6 +844,7 @@ export class NetManager extends ABNetManager {
...
@@ -833,6 +844,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
imgUrl
(
callback
:
Function
,
img64
:
string
):
void
{
public
imgUrl
(
callback
:
Function
,
img64
:
string
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'imgURL'
,
name
:
'imgURL'
,
...
@@ -862,6 +874,7 @@ export class NetManager extends ABNetManager {
...
@@ -862,6 +874,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
hc_getLevelInfo
(
callback
:
Function
,
getLevelInfo
:
number
):
void
{
public
hc_getLevelInfo
(
callback
:
Function
,
getLevelInfo
:
number
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'hc_getLevelInfo'
,
name
:
'hc_getLevelInfo'
,
...
@@ -877,12 +890,13 @@ export class NetManager extends ABNetManager {
...
@@ -877,12 +890,13 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
hc_exchange
(
callback
:
Function
,
propType
?:
number
):
void
{
public
hc_exchange
(
callback
:
Function
,
propType
?:
number
):
void
{
const
d
:
any
=
{
const
d
:
any
=
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
};
};
if
(
propType
)
{
if
(
propType
)
{
d
.
propType
=
propType
;
d
.
propType
=
propType
;
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
...
@@ -895,6 +909,7 @@ export class NetManager extends ABNetManager {
...
@@ -895,6 +909,7 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
hc_askForEnergy
(
callback
:
Function
):
void
{
public
hc_askForEnergy
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'hc_askForEnergy'
,
name
:
'hc_askForEnergy'
,
...
@@ -908,10 +923,11 @@ export class NetManager extends ABNetManager {
...
@@ -908,10 +923,11 @@ export class NetManager extends ABNetManager {
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
hc_useProp
(
callback
:
Function
,
propType
:
number
):
void
{
public
hc_useProp
(
callback
:
Function
,
propType
:
number
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'hc_useProp'
,
name
:
'hc_useProp'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/happyclear/useProp'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/happyclear/useProp'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
...
@@ -925,9 +941,9 @@ export class NetManager extends ABNetManager {
...
@@ -925,9 +941,9 @@ export class NetManager extends ABNetManager {
public
getMusicCategory
(
callback
:
Function
,
categoryID
?:
number
,
categoryCode
?,
liteVersion
?):
void
{
public
getMusicCategory
(
callback
:
Function
,
categoryID
?:
number
,
categoryCode
?,
liteVersion
?):
void
{
const
data
:
any
=
{};
const
data
:
any
=
{};
if
(
categoryID
)
data
.
categoryID
=
categoryID
;
if
(
categoryID
)
data
.
categoryID
=
categoryID
;
if
(
categoryCode
)
data
.
categoryCode
=
categoryCode
;
if
(
categoryCode
)
data
.
categoryCode
=
categoryCode
;
if
(
liteVersion
)
data
.
liteVersion
=
liteVersion
;
if
(
liteVersion
)
data
.
liteVersion
=
liteVersion
;
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getMusicCategory'
,
name
:
'getMusicCategory'
,
uri
:
'/aaw/music/category'
,
uri
:
'/aaw/music/category'
,
...
@@ -962,8 +978,8 @@ export class NetManager extends ABNetManager {
...
@@ -962,8 +978,8 @@ export class NetManager extends ABNetManager {
public
getMusicItem
(
callback
:
Function
,
songListId
,
itemId
):
void
{
public
getMusicItem
(
callback
:
Function
,
songListId
,
itemId
):
void
{
const
data
:
any
=
{};
const
data
:
any
=
{};
if
(
itemId
)
data
.
itemId
=
itemId
;
if
(
itemId
)
data
.
itemId
=
itemId
;
if
(
songListId
)
data
.
songListId
=
songListId
;
if
(
songListId
)
data
.
songListId
=
songListId
;
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getMusicItem'
,
name
:
'getMusicItem'
,
uri
:
'/aaw/music/item'
,
uri
:
'/aaw/music/item'
,
...
@@ -1018,10 +1034,10 @@ export class NetManager extends ABNetManager {
...
@@ -1018,10 +1034,10 @@ export class NetManager extends ABNetManager {
activityType
:
'hdtool'
,
activityType
:
'hdtool'
,
consumerId
:
window
[
'CFG'
].
consumerId
consumerId
:
window
[
'CFG'
].
consumerId
};
};
if
(
credits
)
{
if
(
credits
)
{
param
.
credits
=
credits
;
param
.
credits
=
credits
;
}
}
if
(
collectRuleId
)
{
if
(
collectRuleId
)
{
param
.
collectRuleId
=
collectRuleId
;
param
.
collectRuleId
=
collectRuleId
;
}
}
const
net
:
INetData
=
{
const
net
:
INetData
=
{
...
@@ -1242,7 +1258,7 @@ export class NetManager extends ABNetManager {
...
@@ -1242,7 +1258,7 @@ export class NetManager extends ABNetManager {
public
getSignInfo
(
callback
:
Function
,
signActivityId
:
number
):
void
{
public
getSignInfo
(
callback
:
Function
,
signActivityId
:
number
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getSignInfo'
,
name
:
'getSignInfo'
,
uri
:
window
[
'duiba'
]
+
'/signactivity/getSignInfo'
,
uri
:
window
[
'duiba'
]
+
'/signactivity/getSignInfo'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
...
@@ -1285,8 +1301,8 @@ export class NetManager extends ABNetManager {
...
@@ -1285,8 +1301,8 @@ export class NetManager extends ABNetManager {
public
doSign
(
callback
:
Function
,
signActivityId
:
number
):
void
{
public
doSign
(
callback
:
Function
,
signActivityId
:
number
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'dosign'
,
name
:
'dosign'
,
uri
:
window
[
'duiba'
]
+
'/signactivity/doSign'
,
uri
:
window
[
'duiba'
]
+
'/signactivity/doSign'
,
type
:
'post'
,
type
:
'post'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
...
@@ -1294,7 +1310,7 @@ export class NetManager extends ABNetManager {
...
@@ -1294,7 +1310,7 @@ export class NetManager extends ABNetManager {
detect
:
window
[
'detect'
],
detect
:
window
[
'detect'
],
deviceSessionId
:
window
[
'_device_session_id'
]
deviceSessionId
:
window
[
'_device_session_id'
]
},
},
hideMsg
:
true
,
hideMsg
:
true
,
callback
:
callback
callback
:
callback
};
};
this
.
send
(
net
);
this
.
send
(
net
);
...
@@ -1669,7 +1685,7 @@ export class NetManager extends ABNetManager {
...
@@ -1669,7 +1685,7 @@ export class NetManager extends ABNetManager {
* @param net
* @param net
*/
*/
public
getToken
(
net
:
INetData
):
void
{
public
getToken
(
net
:
INetData
):
void
{
if
(
window
[
'getDuibaToken'
])
{
if
(
window
[
'getDuibaToken'
])
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
window
[
'getDuibaToken'
]((
tokenObj
:
any
)
=>
{
net
.
param
.
token
=
tokenObj
.
token
;
net
.
param
.
token
=
tokenObj
.
token
;
this
.
send
(
net
);
this
.
send
(
net
);
...
@@ -1700,12 +1716,12 @@ export class NetManager extends ABNetManager {
...
@@ -1700,12 +1716,12 @@ export class NetManager extends ABNetManager {
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
gTime
:
string
=
'?_='
+
GTime
.
getTimestamp
();
let
realUrl
:
string
=
net
.
uri
;
let
realUrl
:
string
=
net
.
uri
;
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
if
(
realUrl
.
indexOf
(
'?'
)
!=
-
1
)
{
gTime
=
'&_='
+
GTime
.
getTimestamp
();
gTime
=
'&_='
+
GTime
.
getTimestamp
();
}
}
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
//url加参数等特殊需求(例如再玩一次需要在dostart接口的url上加埋点)
if
(
net
.
addUrl
)
{
if
(
net
.
addUrl
)
{
realUrl
+=
net
.
addUrl
;
realUrl
+=
net
.
addUrl
;
}
}
...
@@ -1801,19 +1817,19 @@ export class NetManager extends ABNetManager {
...
@@ -1801,19 +1817,19 @@ export class NetManager extends ABNetManager {
}
}
public
remainDuration
(
remain
,
first
,
from
=
1
):
void
{
public
remainDuration
(
remain
,
first
,
from
=
1
):
void
{
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'remainDuration'
,
name
:
'remainDuration'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/api/remainDuration'
,
uri
:
window
[
'duiba'
]
+
'/customActivity/api/remainDuration'
,
type
:
'get'
,
type
:
'get'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
{
param
:
{
id
:
DataManager
.
ins
.
customCfgData
.
hdToolId
,
id
:
DataManager
.
ins
.
customCfgData
.
hdToolId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityType
:
'hdtool'
,
activityType
:
'hdtool'
,
remain
:
remain
,
remain
:
remain
,
first
:
first
,
first
:
first
,
from
:
from
from
:
from
},
},
callback
:
null
,
callback
:
null
,
hideMsg
:
true
hideMsg
:
true
...
@@ -1830,30 +1846,30 @@ export class NetManager extends ABNetManager {
...
@@ -1830,30 +1846,30 @@ export class NetManager extends ABNetManager {
if
(
net
.
name
==
'hc_home'
)
{
if
(
net
.
name
==
'hc_home'
)
{
// if(result.data.refectionCountdown==null)
// if(result.data.refectionCountdown==null)
// result.data.refectionCountdown==0;
// result.data.refectionCountdown==0;
if
(
result
.
data
.
refectionCountdown
==
0
)
if
(
result
.
data
.
refectionCountdown
==
0
)
result
.
data
.
refectionCountdown
=
5
;
result
.
data
.
refectionCountdown
=
5
;
result
.
data
.
refectionCountdown
+=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
result
.
data
.
refectionCountdown
+=
Math
.
floor
(
new
Date
().
getTime
()
/
1000
);
}
}
//数据处理
//数据处理
const
data
:
Data
=
DataManager
.
ins
.
updateData
(
net
.
name
,
result
,
net
.
param
);
const
data
:
Data
=
DataManager
.
ins
.
updateData
(
net
.
name
,
result
,
net
.
param
);
//接口成功
//接口成功
if
(
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
if
(
net
.
pollingCount
&&
net
.
pollingCheck
(
data
))
{
net
.
pollingCount
-=
1
;
net
.
pollingCount
-=
1
;
//轮询接口特殊处理
//轮询接口特殊处理
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
send
(
net
);
this
.
send
(
net
);
},
500
);
},
500
);
}
else
if
(
net
.
callback
)
{
}
else
if
(
net
.
callback
)
{
if
(
net
.
pollingCheck
&&
net
.
pollingCount
==
0
&&
net
.
pollingCheck
(
data
))
{
if
(
net
.
pollingCheck
&&
net
.
pollingCount
==
0
&&
net
.
pollingCheck
(
data
))
{
result
.
message
=
'系统异常,请稍后再试。'
;
result
.
message
=
'系统异常,请稍后再试。'
;
data
[
'success'
]
=
false
;
data
[
'success'
]
=
false
;
}
}
net
.
callback
(
data
.
success
,
data
||
result
);
net
.
callback
(
data
.
success
,
data
||
result
);
}
}
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
,
result
.
message
||
result
.
desc
||
result
.
msg
);
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
,
result
.
message
||
result
.
desc
||
result
.
msg
);
}
}
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
if
(
!
data
.
success
&&
!
net
.
hideMsg
)
{
onNotSuccess
(
data
,
net
.
name
)
onNotSuccess
(
data
,
net
.
name
)
}
}
}
}
...
@@ -1866,14 +1882,75 @@ export class NetManager extends ABNetManager {
...
@@ -1866,14 +1882,75 @@ export class NetManager extends ABNetManager {
* @param message
* @param message
*/
*/
protected
onError
(
net
:
INetData
):
void
{
protected
onError
(
net
:
INetData
):
void
{
if
(
net
.
callback
)
{
if
(
net
.
callback
)
{
net
.
callback
(
false
);
net
.
callback
(
false
);
}
}
if
(
!
net
.
hideMsg
)
{
if
(
!
net
.
hideMsg
)
{
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
);
GDispatcher
.
dispatchEvent
(
ABNetManager
.
ERROR
,
net
);
showToast
(
'网络开小差了,再试一次吧'
);
showToast
(
'网络开小差了,再试一次吧'
);
}
}
}
}
// tslint:disable-next-line:max-file-line-count
// tslint:disable-next-line:max-file-line-count
/////////////////////////////// 消消乐邀请有礼 /////////////////////////////////////
/**
* 邀请有礼-获取邀请码
* @param callback
*/
public
getShareCode
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
name
:
NetName
.
CUSTOM_THROUGH_SUBMIT
,
uri
:
'/customActivity/happyclear/getShareCode'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
},
callback
:
callback
};
this
.
send
(
net
);
}
/**
* 邀请有礼-助力
* @param callback
* @param shareCode 分享码
* @param orderId 参与关卡流水记录id
*/
public
doHelp
(
callback
:
Function
,
shareCode
:
any
,
orderId
:
number
):
void
{
const
net
:
INetData
=
{
name
:
NetName
.
CUSTOM_THROUGH_SUBMIT
,
uri
:
'/customActivity/happyclear/doHelp'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
shareCode
:
shareCode
,
orderId
:
orderId
},
callback
:
callback
};
this
.
send
(
net
);
}
/**
* 获取邀请详情
* @param callback
*/
public
getInvateInfo
(
callback
:
Function
):
void
{
const
net
:
INetData
=
{
name
:
NetName
.
CUSTOM_THROUGH_SUBMIT
,
uri
:
'/customActivity/happyclear/invitationInfo'
,
type
:
'post'
,
dataType
:
'json'
,
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
},
callback
:
callback
};
this
.
send
(
net
);
}
///////////////////////////////////////////////////////////////////////////////////
}
}
\ No newline at end of file
egret/resource/skins/InvitePrizePanelSkin.exml
View file @
6f2a5683
...
@@ -20,10 +20,5 @@
...
@@ -20,10 +20,5 @@
</e:Skin>
</e:Skin>
</e:skinName>
</e:skinName>
</e:Button>
</e:Button>
<e:Group
x=
"84"
y=
"845.33"
>
<e:Component
y=
"845.33"
skinName=
"ADSmallSkin"
horizontalCenter=
"0"
/>
<e:Image
y=
"0"
source=
"invite_prize_ad_png"
x=
"0"
/>
<e:Image
id=
"ad_ico"
source=
""
x=
"48"
y=
"55.67"
/>
<e:Label
id=
"label1"
text=
"Label"
x=
"277.5"
y=
"77.5"
textColor=
"0xe5150e"
size=
"24"
/>
<e:Label
id=
"label2"
text=
"Label"
x=
"262.5"
y=
"124.5"
textColor=
"0xE5150E"
size=
"34"
bold=
"true"
/>
</e:Group>
</e:Skin>
</e:Skin>
\ No newline at end of file
egret/resource/skins/InviteRulePanelSkin.exml
View file @
6f2a5683
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</e:layout>
</e:layout>
</e:Group>
</e:Group>
</e:Scroller>
</e:Scroller>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
14"
y=
"280
"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
08"
y=
"322
"
>
<e:skinName>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
...
...
egret/src/panels/InvitePanel.ts
View file @
6f2a5683
...
@@ -4,9 +4,7 @@ import layers from "../../libs/new_wx/views/layers";
...
@@ -4,9 +4,7 @@ import layers from "../../libs/new_wx/views/layers";
import
ComponentBase
from
"../../libs/new_wx/components/ComponentBase"
;
import
ComponentBase
from
"../../libs/new_wx/components/ComponentBase"
;
import
{
iswx
}
from
"../iswx"
;
import
{
iswx
}
from
"../iswx"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
InviteRulePanel
from
"./InviteRulePanel"
;
import
InviteRulePanel
from
"./InviteRulePanel"
;
import
Loading
from
"../../libs/new_wx/components/Loading"
;
export
default
class
InvitePanel
extends
Panel
{
export
default
class
InvitePanel
extends
Panel
{
public
prizeImg
:
eui
.
Image
;
public
prizeImg
:
eui
.
Image
;
...
...
egret/src/panels/InvitePrizePanel.ts
View file @
6f2a5683
...
@@ -10,9 +10,6 @@ export default class InvitePrizePanel extends Panel {
...
@@ -10,9 +10,6 @@ export default class InvitePrizePanel extends Panel {
public
prizeImg
:
eui
.
Image
;
public
prizeImg
:
eui
.
Image
;
public
closeBtn
:
eui
.
Button
;
public
closeBtn
:
eui
.
Button
;
public
ok_btn
:
eui
.
Button
;
public
ok_btn
:
eui
.
Button
;
public
ad_ico
:
eui
.
Image
;
public
label1
:
eui
.
Label
;
public
label2
:
eui
.
Label
;
start
()
{
start
()
{
super
.
start
();
super
.
start
();
...
...
mock/config.js
View file @
6f2a5683
...
@@ -108,8 +108,17 @@ const config = {
...
@@ -108,8 +108,17 @@ const config = {
},
},
'/hdtool/recon/ngame/resurrectionStatus'
:
{
'/hdtool/recon/ngame/resurrectionStatus'
:
{
data
:
'./resurrectionStatus.json'
data
:
'./resurrectionStatus.json'
}
},
//////////////////// 消消乐邀请有礼 ////////////////////
'/customActivity/happyclear/getShareCode'
:
{
data
:
'./happyclear/getShareCode.json'
},
'/customActivity/happyclear/doHelp'
:
{
data
:
'./happyclear/doHelp.json'
},
'/customActivity/happyclear/invitationInfo'
:
{
data
:
'./happyclear/getInviteInfo.json'
},
}
}
for
(
let
item
in
config
)
{
for
(
let
item
in
config
)
{
...
...
mock/happyclear/doHelp.json
0 → 100644
View file @
6f2a5683
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1566199822308
,
"data"
:
""
}
\ No newline at end of file
mock/happyclear/getInviteInfo.json
0 → 100644
View file @
6f2a5683
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1566199822308
,
"data"
:{
"invitationId"
:
"活动id"
,
"invitationCount"
:
1
,
"img"
:
"图片"
,
"sysTime"
:
1566199822308
,
"endTime"
:
1566199822308
,
"invitationUser"
:[
{
"nickname"
:
"nickname"
,
"avatar"
:
"avatar"
}
],
"completeFlag"
:
true
,
"openPriz"
:
true
,
"openPrizMsg"
:
"图片"
}
}
\ No newline at end of file
mock/happyclear/getShareCode.json
0 → 100644
View file @
6f2a5683
{
"success"
:
true
,
"code"
:
null
,
"desc"
:
null
,
"timestamp"
:
1566199822308
,
"data"
:
""
}
\ 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