Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wfc13
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wildfirecode13
wfc13
Commits
b916b3b6
Commit
b916b3b6
authored
Aug 05, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d39a24c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
6 deletions
+52
-6
WebNet.ts
project/src/WebNet.ts
+18
-5
IndexScene.ts
project/src/scenes/IndexScene.ts
+16
-0
ShareScene.ts
project/src/scenes/ShareScene.ts
+18
-1
No files found.
project/src/WebNet.ts
View file @
b916b3b6
...
...
@@ -15,6 +15,22 @@ let mergeData = {
* web接口枚举,mock 文件名类似aaa/homeInfo.do
*/
export
enum
WebNetName
{
/**
* 获取规则
*/
projectRule
=
"/projectx/{projectId}/projectRule.query"
,
carouselInfo
=
"/projectx/{projectId}/carousel/carouselInfo.do"
,
acquireExperienceAmount
=
"/projectx/{projectId}/wallet/acquireExperienceAmount.do"
,
myWallet
=
"/projectx/{projectId}/wallet/myWallet.do"
,
withDraw
=
"/projectx/{projectId}/wallet/withDraw.do"
,
alreadyAcquired
=
"/projectx/{projectId}/wallet/alreadyAcquired.do"
,
acquireOtherExperienceAmount
=
"/projectx/{projectId}/wallet/acquireOtherExperienceAmount.do"
,
createItem
=
"/projectx/{projectId}/shareAssist/createItem.do"
,
assist
=
"/projectx/{projectId}/shareAssist/assist.do"
,
/**
* 首页
*/
...
...
@@ -24,7 +40,7 @@ export enum WebNetName {
*/
canshare
=
"/projectx/{projectId}/game/canshare.do"
,
carouselInfo
=
"/projectx/{projectId}/carousel/carouselInfo.do"
,
/**
* 参与
*/
...
...
@@ -34,10 +50,7 @@ export enum WebNetName {
*/
queryResult
=
"/projectx/{projectId}/game/queryResult.do"
,
/**
* 获取规则
*/
projectRule
=
"/projectx/{projectId}/projectRule.query"
}
//返回数据类型
...
...
project/src/scenes/IndexScene.ts
View file @
b916b3b6
...
...
@@ -2,6 +2,7 @@ import { unwatchPageVisibility, watchPageVisibility } from '@spark/utils';
import
{
closeCurrentPanel
,
showPanel
}
from
"../../module/ctrls"
;
import
PanelCtrl
from
'../../module/ctrls/panelCtrl'
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
Marquee
from
'../common/Marquee'
;
import
{
DrawPanel
}
from
'../panels/draw'
;
import
{
ShareFailPanel
}
from
'../panels/share_fail'
;
import
{
ShareSuccessPanel
}
from
'../panels/share_success'
;
...
...
@@ -26,6 +27,21 @@ export class IndexScene extends Scene {
showPanel
(
DrawPanel
,
data
);
},
this
);
sendWebNet
(
WebNetName
.
carouselInfo
).
then
(
res
=>
{
console
.
log
(
'carouselInfo '
,
res
);
const
template
=
'{phone}邀请了{friend}位好友,获得了{amount}体验金'
;
const
datas
=
res
.
data
.
map
(
item
=>
{
let
str
=
template
.
replace
(
'{phone}'
,
item
.
nickname
);
str
=
str
.
replace
(
'{friend}'
,
item
.
friend
);
str
=
str
.
replace
(
'{amount}'
,
item
.
amount
);
return
str
});
const
q
=
this
.
addChild
(
new
Marquee
(
datas
));
q
.
y
=
50
;
q
.
x
=
50
;
});
}
async
showSharePanel
()
{
...
...
project/src/scenes/ShareScene.ts
View file @
b916b3b6
import
{
showPanel
}
from
"../../module/ctrls"
;
import
{
Scene
}
from
"../../module/views/Scene"
;
import
Marquee
from
"../common/Marquee"
;
import
getObject
from
"../getObject"
;
import
{
PrizePanel
}
from
"../panels/prize"
;
import
{
sendWebNet
,
WebNetName
}
from
"../WebNet"
;
export
class
ShareScene
extends
Scene
{
get
groupNames
()
{
return
[
"share"
]
}
get
skinName
()
{
return
"share"
}
...
...
@@ -13,7 +15,22 @@ export class ShareScene extends Scene {
async
start
(
data
)
{
super
.
start
();
console
.
log
(
'ShareScene query>>'
,
JSON
.
stringify
(
data
.
query
))
console
.
log
(
'ShareScene query>>'
,
JSON
.
stringify
(
data
.
query
));
sendWebNet
(
WebNetName
.
carouselInfo
).
then
(
res
=>
{
console
.
log
(
'carouselInfo '
,
res
);
const
template
=
'{phone}邀请了{friend}位好友,获得了{amount}体验金'
;
const
datas
=
res
.
data
.
map
(
item
=>
{
let
str
=
template
.
replace
(
'{phone}'
,
item
.
nickname
);
str
=
str
.
replace
(
'{friend}'
,
item
.
friend
);
str
=
str
.
replace
(
'{amount}'
,
item
.
amount
);
return
str
});
const
q
=
this
.
addChild
(
new
Marquee
(
datas
));
q
.
y
=
50
;
q
.
x
=
50
;
});
}
initEvents
()
{
...
...
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