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
dc1bd305
Commit
dc1bd305
authored
Jun 03, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改单个广告获取
parent
e72d3292
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
26 deletions
+42
-26
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-2
DataManager.ts
egret/libs/tw/manager/DataManager.ts
+3
-1
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+3
-2
AdSmallComp.ts
egret/src/mapScene/AdSmallComp.ts
+2
-2
MapScene.ts
egret/src/mapScene/MapScene.ts
+30
-17
getAdBtn.ts
egret/src/mapScene/getAdBtn.ts
+1
-1
ADPanel.ts
egret/src/panels/ADPanel.ts
+1
-1
No files found.
egret/libs/new_wx/MainBase.ts
View file @
dc1bd305
...
@@ -540,7 +540,7 @@ export default class MainBase extends eui.UILayer {
...
@@ -540,7 +540,7 @@ export default class MainBase extends eui.UILayer {
return
new
Promise
((
r
)
=>
{
return
new
Promise
((
r
)
=>
{
NetManager
.
ins
.
hc_advert
(()
=>
{
NetManager
.
ins
.
hc_advert
(()
=>
{
r
();
r
();
})
}
,
3
)
});
});
}
}
...
@@ -636,7 +636,7 @@ export default class MainBase extends eui.UILayer {
...
@@ -636,7 +636,7 @@ export default class MainBase extends eui.UILayer {
//获取分享加体力的shareCode,不影响初始化场景,不进await
//获取分享加体力的shareCode,不影响初始化场景,不进await
NetManager
.
ins
.
getUserShareCode
(()
=>
{
})
NetManager
.
ins
.
getUserShareCode
(()
=>
{
})
MapScene
.
adData
=
DataManager
.
ins
.
getData
(
'hc_advert'
);
MapScene
.
adData
=
DataManager
.
ins
.
getData
(
'hc_advert
_3
'
);
Buried
.
init
();
Buried
.
init
();
///////////
///////////
...
...
egret/libs/tw/manager/DataManager.ts
View file @
dc1bd305
...
@@ -618,9 +618,11 @@ export class DataManager extends ABDataManager {
...
@@ -618,9 +618,11 @@ export class DataManager extends ABDataManager {
data
=
this
.
_getRecordData
;
data
=
this
.
_getRecordData
;
default
:
default
:
if
(
name
==
"hc_advert"
){
if
(
name
==
"hc_advert"
){
this
[
this
.
getKey
(
name
+
"_"
+
param
.
type
)]
=
result
;
console
.
log
(
"新广告,分展示位单个区别获取"
,
name
,
result
,
param
);
console
.
log
(
"新广告,分展示位单个区别获取"
,
name
,
result
,
param
);
}
else
{
this
[
this
.
getKey
(
name
)]
=
result
;
}
}
this
[
this
.
getKey
(
name
)]
=
result
;
}
}
this
.
dispatchEvent
(
new
egret
.
Event
(
'dataUpdate'
,
false
,
false
,
name
));
this
.
dispatchEvent
(
new
egret
.
Event
(
'dataUpdate'
,
false
,
false
,
name
));
return
data
||
result
;
return
data
||
result
;
...
...
egret/libs/tw/manager/NetManager.ts
View file @
dc1bd305
...
@@ -1461,7 +1461,7 @@ export class NetManager extends ABNetManager {
...
@@ -1461,7 +1461,7 @@ export class NetManager extends ABNetManager {
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
hc_advert
(
callback
:
Function
):
void
{
public
hc_advert
(
callback
:
Function
,
type
):
void
{
var
deviceId
:
string
=
''
;
var
deviceId
:
string
=
''
;
var
cityCode
:
string
=
''
;
var
cityCode
:
string
=
''
;
const
net
:
INetData
=
{
const
net
:
INetData
=
{
...
@@ -1472,7 +1472,8 @@ export class NetManager extends ABNetManager {
...
@@ -1472,7 +1472,8 @@ export class NetManager extends ABNetManager {
param
:
{
param
:
{
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
activityId
:
DataManager
.
ins
.
customCfgData
.
actId
,
deviceId
:
deviceId
,
deviceId
:
deviceId
,
cityCode
:
cityCode
cityCode
:
cityCode
,
type
:
type
},
},
hideMsg
:
true
,
hideMsg
:
true
,
callback
:
callback
callback
:
callback
...
...
egret/src/mapScene/AdSmallComp.ts
View file @
dc1bd305
...
@@ -17,7 +17,7 @@ export default class AdSmallComp extends ComponentBase {
...
@@ -17,7 +17,7 @@ export default class AdSmallComp extends ComponentBase {
this
[
'img'
].
mask
=
this
[
'adsmask'
];
this
[
'img'
].
mask
=
this
[
'adsmask'
];
}
}
NetManager
.
ins
.
hc_advert
(()
=>
{
NetManager
.
ins
.
hc_advert
(()
=>
{
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_advert'
);
const
{
data
}
=
DataManager
.
ins
.
getData
(
'hc_advert
_2
'
);
let
{
popupAdvert
}
=
data
;
let
{
popupAdvert
}
=
data
;
if
(
popupAdvert
==
null
)
if
(
popupAdvert
==
null
)
popupAdvert
=
{
enable
:
false
,
advertList
:
[]
}
popupAdvert
=
{
enable
:
false
,
advertList
:
[]
}
...
@@ -34,7 +34,7 @@ export default class AdSmallComp extends ComponentBase {
...
@@ -34,7 +34,7 @@ export default class AdSmallComp extends ComponentBase {
snpmAdStatic
.
snpmAdReport
(
"show"
,
"bottom"
,
result
);
snpmAdStatic
.
snpmAdReport
(
"show"
,
"bottom"
,
result
);
this
.
data
.
img
=
result
.
img
;
this
.
data
.
img
=
result
.
img
;
}
}
});
}
,
2
);
this
[
'img'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
[
'img'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
result
.
url
.
length
>
2
){
if
(
result
.
url
.
length
>
2
){
...
...
egret/src/mapScene/MapScene.ts
View file @
dc1bd305
...
@@ -171,7 +171,7 @@ export default class MapScene extends Scene {
...
@@ -171,7 +171,7 @@ export default class MapScene extends Scene {
this
.
updateAdData
();
this
.
updateAdData
();
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
NetManager
.
ins
.
getSignInfo
(()
=>
{
NetManager
.
ins
.
getSignInfo
(
async
()
=>
{
const
parmas
=
[];
const
parmas
=
[];
const
panels
=
[];
const
panels
=
[];
const
result
=
this
.
sendInvite
(
panels
,
parmas
);
const
result
=
this
.
sendInvite
(
panels
,
parmas
);
...
@@ -187,22 +187,35 @@ export default class MapScene extends Scene {
...
@@ -187,22 +187,35 @@ export default class MapScene extends Scene {
const
nowTimerStr2
=
date
.
getTime
()
+
''
;
const
nowTimerStr2
=
date
.
getTime
()
+
''
;
const
oldTimerStr2
=
localStorage
.
getItem
(
'nowTimer2Str'
+
window
[
'CFG'
].
consumerId
);
const
oldTimerStr2
=
localStorage
.
getItem
(
'nowTimer2Str'
+
window
[
'CFG'
].
consumerId
);
if
(
nowTimerStr2
!=
oldTimerStr2
){
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
||
{};
console
.
log
(
"时间上需要弹出广告"
);
let
{
noticeAdvert
}
=
hc_advert
;
var
adpro
=
new
Promise
(
res
=>
{
if
(
noticeAdvert
==
null
)
{
NetManager
.
ins
.
hc_advert
(()
=>
{
noticeAdvert
=
{
enable
:
false
}
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert_1'
).
data
||
{};
}
console
.
log
(
"1广告数据"
,
hc_advert
);
noticeAdvert
=
DataManager
.
ins
.
solveAdvertData
(
noticeAdvert
);
let
{
noticeAdvert
}
=
hc_advert
;
if
(
noticeAdvert
==
null
)
{
if
(
noticeAdvert
&&
noticeAdvert
.
enable
&&
nowTimerStr2
!=
oldTimerStr2
)
{
noticeAdvert
=
{
enable
:
false
}
// if (!adTag) {
}
panels
.
push
(
'ad'
);
noticeAdvert
=
DataManager
.
ins
.
solveAdvertData
(
noticeAdvert
);
// adTag = true;
if
(
noticeAdvert
&&
noticeAdvert
.
enable
){
// }
panels
.
push
(
'ad'
);
localStorage
.
setItem
(
'nowTimer2Str'
+
window
[
'CFG'
].
consumerId
,
nowTimerStr2
);
localStorage
.
setItem
(
'nowTimer2Str'
+
window
[
'CFG'
].
consumerId
,
nowTimerStr2
);
}
},
1
);
});
await
adpro
;
console
.
log
(
"时间弹出广告结束"
);
}
}
// if (noticeAdvert && noticeAdvert.enable && nowTimerStr2 != oldTimerStr2) {
// // if (!adTag) {
// panels.push('ad');
// // adTag = true;
// // }
// localStorage.setItem('nowTimer2Str' + window['CFG'].consumerId, nowTimerStr2);
// }
const
backData
=
DataManager
.
ins
.
getData
(
'hc_hasBackReward'
);
const
backData
=
DataManager
.
ins
.
getData
(
'hc_hasBackReward'
);
if
(
backData
.
success
)
{
if
(
backData
.
success
)
{
backData
.
success
=
false
;
backData
.
success
=
false
;
...
@@ -1035,7 +1048,7 @@ export default class MapScene extends Scene {
...
@@ -1035,7 +1048,7 @@ export default class MapScene extends Scene {
// 更新广告数据
// 更新广告数据
updateAdData
()
{
updateAdData
()
{
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
||
{};
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert
_3
'
).
data
||
{};
let
{
mapAdvert
}
=
hc_advert
;
let
{
mapAdvert
}
=
hc_advert
;
if
(
mapAdvert
==
null
)
if
(
mapAdvert
==
null
)
mapAdvert
=
{
enable
:
false
,
advertList
:
[]
}
mapAdvert
=
{
enable
:
false
,
advertList
:
[]
}
...
@@ -1439,7 +1452,7 @@ export default class MapScene extends Scene {
...
@@ -1439,7 +1452,7 @@ export default class MapScene extends Scene {
* 查询邀请信息
* 查询邀请信息
*/
*/
getInviteInfo
()
{
getInviteInfo
()
{
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
||
{};
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert
_3
'
).
data
||
{};
let
{
mapAdvert
}
=
hc_advert
;
let
{
mapAdvert
}
=
hc_advert
;
mapAdvert
=
DataManager
.
ins
.
solveAdvertData
(
mapAdvert
);
mapAdvert
=
DataManager
.
ins
.
solveAdvertData
(
mapAdvert
);
// tslint:disable-next-line: cyclomatic-complexity
// tslint:disable-next-line: cyclomatic-complexity
...
...
egret/src/mapScene/getAdBtn.ts
View file @
dc1bd305
...
@@ -2,7 +2,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
...
@@ -2,7 +2,7 @@ import { DataManager } from "../../libs/tw/manager/DataManager";
export
default
()
=>
{
export
default
()
=>
{
const
hc_advert
:
any
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
||
{};
const
hc_advert
:
any
=
DataManager
.
ins
.
getData
(
'hc_advert
_3
'
).
data
||
{};
let
{
mapAdvert
}
=
hc_advert
;
let
{
mapAdvert
}
=
hc_advert
;
if
(
mapAdvert
==
null
)
if
(
mapAdvert
==
null
)
mapAdvert
=
{
enable
:
false
,
advertList
:
[]
}
mapAdvert
=
{
enable
:
false
,
advertList
:
[]
}
...
...
egret/src/panels/ADPanel.ts
View file @
dc1bd305
...
@@ -11,7 +11,7 @@ export default class ADPanel extends Panel {
...
@@ -11,7 +11,7 @@ export default class ADPanel extends Panel {
this
.
showlog
();
this
.
showlog
();
let
result
;
let
result
;
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert'
).
data
;
const
hc_advert
=
DataManager
.
ins
.
getData
(
'hc_advert
_1
'
).
data
;
let
{
noticeAdvert
}
=
hc_advert
;
let
{
noticeAdvert
}
=
hc_advert
;
noticeAdvert
=
DataManager
.
ins
.
solveAdvertData
(
noticeAdvert
);
noticeAdvert
=
DataManager
.
ins
.
solveAdvertData
(
noticeAdvert
);
this
.
visible
=
noticeAdvert
.
enable
;
this
.
visible
=
noticeAdvert
.
enable
;
...
...
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