Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-game-template
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
崔立强
db-game-template
Commits
ffbd7daf
Commit
ffbd7daf
authored
May 22, 2021
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
爱德2021年5月份迭代,加入light接口。
parent
1ef87837
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
7908 additions
and
30 deletions
+7908
-30
NetManager.ts
egret/libs/tw/manager/NetManager.ts
+19
-5
Start1Skin.exml
egret/resource/skins/Start1Skin.exml
+1
-1
const.ts
egret/src/const.ts
+38
-0
StartItem.ts
egret/src/start1/StartItem.ts
+63
-20
StartScene1.ts
egret/src/start1/StartScene1.ts
+1
-1
config.js
mock/config.js
+3
-0
index.json
mock/esports/index.json
+3
-3
light.json
mock/esports/light.json
+5
-0
yarn.lock
yarn.lock
+7775
-0
No files found.
egret/libs/tw/manager/NetManager.ts
View file @
ffbd7daf
...
@@ -983,24 +983,38 @@ export class NetManager extends ABNetManager {
...
@@ -983,24 +983,38 @@ export class NetManager extends ABNetManager {
}
}
public
yyh_index
(
callback
:
Function
):
void
{
public
yyh_index
(
callback
:
Function
):
void
{
const
param
:
any
=
{
const
param
:
any
=
{
appID
:
window
[
"appId"
]
appID
:
window
[
"appId"
]
};
};
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'yyh_index'
,
name
:
'yyh_index'
,
uri
:
'/projectx/'
+
window
[
'projectID'
]
+
'/lightenYun/join.do?_='
+
new
Date
().
getTime
(),
//'/projectx/'+window['projectID']+'/join_1/join.do?_=' +new Date().getTime(),
uri
:
'/projectx/'
+
window
[
'projectID'
]
+
'/lightenYun/join.do?_='
+
new
Date
().
getTime
(),
//'/projectx/'+window['projectID']+'/join_1/join.do?_=' +new Date().getTime(),
type
:
'get'
,
type
:
'get'
,
dataType
:
'json'
,
dataType
:
'json'
,
param
:
param
,
param
:
param
,
callback
:
callback
,
callback
:
callback
,
hideMsg
:
true
hideMsg
:
true
};
};
this
.
send
(
net
);
this
.
send
(
net
);
}
}
public
yyh_light
(
param
,
callback
:
Function
):
void
{
console
.
log
(
"调用点亮"
)
const
net
:
INetData
=
{
name
:
'yyh_index'
,
uri
:
'/projectx/'
+
window
[
'projectID'
]
+
'/lightYun/light.do?_='
+
new
Date
().
getTime
(),
//'/projectx/'+window['projectID']+'/join_1/join.do?_=' +new Date().getTime(),
type
:
'get'
,
dataType
:
'json'
,
param
:
param
,
callback
:
callback
,
hideMsg
:
true
};
this
.
getToken
(
net
);
}
public
getProjectUserInfo
(
callback
:
Function
):
void
{
public
getProjectUserInfo
(
callback
:
Function
):
void
{
const
param
:
any
=
{
const
param
:
any
=
{
};
};
const
net
:
INetData
=
{
const
net
:
INetData
=
{
name
:
'getProjectUserInfo'
,
name
:
'getProjectUserInfo'
,
...
...
egret/resource/skins/Start1Skin.exml
View file @
ffbd7daf
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<e:Image
id=
"line2"
source=
"start选中_png"
x=
"60"
y=
"72"
visible=
"false"
/>
<e:Image
id=
"line2"
source=
"start选中_png"
x=
"60"
y=
"72"
visible=
"false"
/>
</e:Group>
</e:Group>
</e:Group>
</e:Group>
<e:Label
id=
"tips"
text=
"我完成的活动1个"
y=
"408"
textColor=
"0x2d2d2d"
right=
"38"
size=
"28"
/>
<e:Label
id=
"tips"
text=
"我完成的活动1个"
y=
"408"
textColor=
"0x2d2d2d"
right=
"38"
size=
"28"
visible=
"false"
/>
<e:Scroller
id=
"scroll"
width=
"698"
y=
"479"
height=
"675"
scrollPolicyH=
"off"
scrollPolicyV=
"on"
x=
"29"
>
<e:Scroller
id=
"scroll"
width=
"698"
y=
"479"
height=
"675"
scrollPolicyH=
"off"
scrollPolicyV=
"on"
x=
"29"
>
<e:Group>
<e:Group>
<e:List
id=
"list"
width=
"698"
itemRendererSkinName=
"ItemSkin"
>
<e:List
id=
"list"
width=
"698"
itemRendererSkinName=
"ItemSkin"
>
...
...
egret/src/const.ts
0 → 100644
View file @
ffbd7daf
export
function
getToken
()
{
console
.
log
(
'尝试获取token'
);
return
new
Promise
((
s
,
j
)
=>
{
if
(
window
.
location
.
port
==
'8080'
)
{
s
(
'dev-token'
);
}
else
{
if
(
window
[
'getPxToken'
])
{
window
[
'getPxToken'
](
function
(
e
,
token
)
{
switch
(
e
)
{
case
'net error'
:
// showToast(`getToken: ${e}`);
s
(
null
);
break
;
case
'need login'
:
// showToast(`getToken: ${e}`);
s
(
null
);
break
;
case
'state invalid'
:
// showToast(`getToken: ${e}`);
s
(
null
);
break
;
default
:
if
(
token
)
{
s
(
token
);
}
else
{
// showToast(`getToken: invalid key`);
s
(
null
);
}
break
;
}
});
}
else
{
// showToast(`getToken: no ready`);
s
(
null
);
}
}
})
}
\ No newline at end of file
egret/src/start1/StartItem.ts
View file @
ffbd7daf
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
getSkinPath
from
"../../libs/new_wx/utils/getSkinPath"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
getToken
}
from
"../const"
;
export
default
class
StartItem
extends
eui
.
ItemRenderer
{
export
default
class
StartItem
extends
eui
.
ItemRenderer
{
...
@@ -6,32 +10,71 @@ export default class StartItem extends eui.ItemRenderer {
...
@@ -6,32 +10,71 @@ export default class StartItem extends eui.ItemRenderer {
super
();
super
();
this
.
skinName
=
getSkinPath
(
'Item'
);
this
.
skinName
=
getSkinPath
(
'Item'
);
}
}
/**
* activityStatus:
* 0:未开始
* 1:进行中
* 2:已结束
*/
dataChanged
()
{
dataChanged
()
{
if
(
this
.
data
.
activityStatus
!=
0
){
this
.
touchChildren
=
false
;
this
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,()
=>
{
if
(
this
.
data
.
activityStatus
!=
0
)
{
location
.
href
=
this
.
data
.
activityUrl
;
if
(
this
.
hasEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
))
return
;
},
this
);
this
.
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
this
.
touchEnabled
=
false
;
setTimeout
(()
=>
{
if
(
this
)
this
.
touchEnabled
=
true
;
},
2000
)
console
.
log
(
"点击了"
,
parseInt
(
this
.
data
.
activityId
))
if
(
this
.
data
.
activityStatus
==
2
)
{
console
.
log
(
"跳转了"
)
location
.
href
=
this
.
data
.
activityUrl
;
}
else
{
let
activityId
=
parseInt
(
this
.
data
.
activityId
);
const
{
data
}
=
DataManager
.
ins
.
getData
(
'yyh_index'
);
if
(
activityId
>=
3
&&
!
isNaN
(
activityId
)
&&
data
.
lighten
!=
1
)
{
getToken
().
then
((
token
)
=>
{
if
(
!
token
)
{
showToast
(
'网络异常,请稍后重试'
);
return
;
}
NetManager
.
ins
.
yyh_light
({
activityId
:
this
.
data
.
activityId
,
token
:
token
},
(
success
,
res
)
=>
{
console
.
log
(
"调接口跳转了,,,-->>"
,
res
)
if
(
!
success
)
{
showToast
(
'网络异常,请稍后重试'
)
return
;
}
location
.
href
=
this
.
data
.
activityUrl
;
})
}).
catch
(()
=>
{
showToast
(
'网络异常,请稍后重试'
)
})
}
else
{
location
.
href
=
this
.
data
.
activityUrl
;
}
}
},
this
);
}
}
this
[
'img0'
].
visible
=
false
;
this
[
'img2'
].
visible
=
false
;
this
[
'img1'
].
visible
=
false
;
this
[
'status0'
].
visible
=
false
;
this
[
'status1'
].
visible
=
false
;
this
[
'status2'
].
visible
=
false
;
this
[
'status3'
].
visible
=
false
;
this
[
`status
${
this
.
data
.
userStatus
}
`
].
visible
=
true
;
this
[
'img0'
].
visible
=
false
;
this
[
`img
${
this
.
data
.
activityStatus
}
`
].
visible
=
true
;
this
[
'img2'
].
visible
=
false
;
this
[
'img1'
].
visible
=
false
;
this
[
'status0'
].
visible
=
false
;
this
[
'status1'
].
visible
=
false
;
this
[
'status2'
].
visible
=
false
;
this
[
'status3'
].
visible
=
false
;
this
[
`status
${
this
.
data
.
userStatus
}
`
].
visible
=
true
;
this
[
`img
${
this
.
data
.
activityStatus
}
`
].
visible
=
true
;
if
(
this
.
data
.
userStatus
==
3
)
{
if
(
this
.
data
.
userStatus
==
3
)
{
this
[
`img
${
this
.
data
.
activityStatus
}
`
].
visible
=
false
;
this
[
`img
${
this
.
data
.
activityStatus
}
`
].
visible
=
false
;
}
}
if
(
this
.
data
.
activityStatus
==
2
||
this
.
data
.
activityStatus
==
0
)
{
if
(
this
.
data
.
activityStatus
==
2
||
this
.
data
.
activityStatus
==
0
)
{
if
(
this
.
data
.
userStatus
!=
3
)
if
(
this
.
data
.
userStatus
!=
3
)
this
[
`status
${
this
.
data
.
userStatus
}
`
].
visible
=
false
;
this
[
`status
${
this
.
data
.
userStatus
}
`
].
visible
=
false
;
}
}
}
}
}
}
\ No newline at end of file
egret/src/start1/StartScene1.ts
View file @
ffbd7daf
...
@@ -18,7 +18,7 @@ export default class Start1Scene extends Scene {
...
@@ -18,7 +18,7 @@ export default class Start1Scene extends Scene {
console
.
error
(
"显示xxx"
,
data
);
console
.
error
(
"显示xxx"
,
data
);
this
[
'notLightImg'
].
visible
=
!
data
.
lighten
;
this
[
'notLightImg'
].
visible
=
!
data
.
lighten
;
this
[
'lightImg'
].
visible
=
data
.
lighten
;
this
[
'lightImg'
].
visible
=
data
.
lighten
;
this
[
'tips'
].
text
=
`我完成的活动
${
data
.
completeCount
}
个`
;
//
this['tips'].text = `我完成的活动${data.completeCount}个`;
this
.
list
.
itemRenderer
=
StartItem
;
this
.
list
.
itemRenderer
=
StartItem
;
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
data
.
activityList
);
this
.
list
.
dataProvider
=
new
eui
.
ArrayCollection
(
data
.
activityList
);
...
...
mock/config.js
View file @
ffbd7daf
...
@@ -6,6 +6,9 @@ const config = {
...
@@ -6,6 +6,9 @@ const config = {
'/projectx/p0a89d550/lightenYun/join.do'
:
{
'/projectx/p0a89d550/lightenYun/join.do'
:
{
data
:
'./esports/index.json'
data
:
'./esports/index.json'
},
},
'/projectx/p0a89d550/lightYun/light.do'
:
{
data
:
'./esports/light.json'
},
'/customActivity/esports/recentlyGetJoinTimes'
:
{
'/customActivity/esports/recentlyGetJoinTimes'
:
{
data
:
'./esports/recentlyGetJoinTimes.json'
data
:
'./esports/recentlyGetJoinTimes.json'
},
},
...
...
mock/esports/index.json
View file @
ffbd7daf
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
"activityList"
:
[{
"activityList"
:
[{
"activityId"
:
""
,
"activityId"
:
""
,
"activityUrl"
:
"https://campaign.geely.com/special/2019/10/dhmls?userId="
,
"activityUrl"
:
"https://campaign.geely.com/special/2019/10/dhmls?userId="
,
"userStatus"
:
0
,
"userStatus"
:
1
,
"sourceType"
:
1
,
"sourceType"
:
1
,
"activityName"
:
"吉利向上马拉松"
,
"activityName"
:
"吉利向上马拉松"
,
"activityStatus"
:
2
,
"activityStatus"
:
1
,
"banner"
:
"https://yun.duiba.com.cn/db_games/jldhlogo.png"
,
"banner"
:
"https://yun.duiba.com.cn/db_games/jldhlogo.png"
,
"completeTime"
:
0
,
"completeTime"
:
0
,
"startTime"
:
1572624000
,
"startTime"
:
1572624000
,
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
},
{
},
{
"activityId"
:
""
,
"activityId"
:
""
,
"activityUrl"
:
"http://aghzapi.zjkczn.com/h5/pages/luckyActivity/#/"
,
"activityUrl"
:
"http://aghzapi.zjkczn.com/h5/pages/luckyActivity/#/"
,
"userStatus"
:
0
,
"userStatus"
:
1
,
"sourceType"
:
1
,
"sourceType"
:
1
,
"activityName"
:
"中国移动高校迎光跑"
,
"activityName"
:
"中国移动高校迎光跑"
,
"activityStatus"
:
0
,
"activityStatus"
:
0
,
...
...
mock/esports/light.json
0 → 100644
View file @
ffbd7daf
{
"code"
:
"commodo quis consequat velit"
,
"message"
:
"fugiat commodo dolore officia"
,
"success"
:
true
}
\ No newline at end of file
yarn.lock
0 → 100644
View file @
ffbd7daf
This diff is collapsed.
Click to expand it.
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