Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
icbcRPG
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
icbcRPG
Commits
79b1c046
Commit
79b1c046
authored
Dec 21, 2020
by
zhangjinzhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增mock
parent
213de510
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
159 additions
and
10 deletions
+159
-10
index.js
project/mock/e-family/index.js
+93
-0
proxy.js
project/mock/proxy.js
+8
-1
apicfg.js
project/src/api/apicfg.js
+5
-0
dataCenter.js
project/src/dataCenter.js
+13
-0
loading.jsx
project/src/pages/loading/loading.jsx
+2
-1
main3.jsx
project/src/pages/main3/main3.jsx
+30
-8
widgetConfig.js
project/src/pages/main3/widgetConfig.js
+8
-0
No files found.
project/mock/e-family/index.js
0 → 100644
View file @
79b1c046
export
const
homeInfo
=
{
"code"
:
null
,
"data"
:
{
"result"
:
true
,
"type"
:
"joyBean"
,
"awardName"
:
"100欢趣豆"
},
"message"
:
null
,
"success"
:
true
}
export
const
updateUinfo
=
{
"code"
:
null
,
"data"
:
true
,
"message"
:
null
,
"success"
:
true
}
export
const
doshare
=
{
"code"
:
null
,
"data"
:
true
,
"message"
:
null
,
"success"
:
true
}
export
const
signInfo
=
{
"code"
:
null
,
"data"
:
{
"continuousDays"
:
0
,
"needPopup"
:
true
,
"signLists"
:
[
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
100
,
"day"
:
1
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
100
,
"day"
:
2
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
200
,
"day"
:
3
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
100
,
"day"
:
4
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
100
,
"day"
:
5
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"欢趣豆"
,
"awardValue"
:
100
,
"day"
:
6
,
"ruleId"
:
""
,
"type"
:
"joyBean"
},
{
"awardName"
:
"大牌券"
,
"awardValue"
:
null
,
"day"
:
7
,
"ruleId"
:
"ru_1"
,
"type"
:
"daPaiCoupons"
}
],
"todaySigned"
:
false
},
"message"
:
null
,
"success"
:
true
}
export
const
dosign
=
{
"code"
:
null
,
"data"
:
{
"result"
:
true
,
"type"
:
"joyBean"
,
"awardName"
:
"100欢趣豆"
},
"message"
:
null
,
"success"
:
true
}
\ No newline at end of file
project/mock/proxy.js
View file @
79b1c046
import
*
as
common
from
'./common'
;
import
*
as
common
from
'./common'
;
import
*
as
collect_0722
from
'./collect_0722'
;
import
*
as
collect_0722
from
'./collect_0722'
;
import
*
as
efamily
from
'./e-family'
;
let
projectId
=
window
.
CFG
.
projectId
||
''
;
let
projectId
=
window
.
CFG
.
projectId
||
''
;
export
default
{
export
default
{
get
:
{
get
:
{
[
`/projectx/
${
projectId
}
/projectRule.query`
]:
common
.
rule
[
`/projectx/
${
projectId
}
/projectRule.query`
]:
common
.
rule
,
[
`/projectx/
${
projectId
}
/e-family/index.do`
]:
efamily
.
homeInfo
,
[
`/projectx/
${
projectId
}
/e-family/update.do`
]:
efamily
.
updateUinfo
,
[
`/projectx/
${
projectId
}
/e-family/share.do`
]:
efamily
.
doshare
,
[
`/projectx/
${
projectId
}
/e-family/signInfo.do`
]:
efamily
.
signInfo
,
[
`/projectx/
${
projectId
}
/e-family/sign.do`
]:
efamily
.
dosign
,
},
},
post
:
{
post
:
{
[
`/projectx/
${
projectId
}
/join.do`
]:
collect_0722
.
join
[
`/projectx/
${
projectId
}
/join.do`
]:
collect_0722
.
join
...
...
project/src/api/apicfg.js
View file @
79b1c046
...
@@ -5,6 +5,11 @@ const apiCfg = {
...
@@ -5,6 +5,11 @@ const apiCfg = {
uri
:
`join.do`
,
uri
:
`join.do`
,
method
:
"post"
method
:
"post"
},
},
homeInfo
:
`/projectx/
${
projectId
}
/e-family/index.do`
,
updateUinfo
:
`/projectx/
${
projectId
}
/e-family/update.do`
,
doshare
:
`/projectx/
${
projectId
}
/e-family/share.do`
,
signInfo
:
`/projectx/
${
projectId
}
/e-family/signInfo.do`
,
dosign
:
`/projectx/
${
projectId
}
/e-family/sign.do`
,
}
}
export
default
apiCfg
;
export
default
apiCfg
;
project/src/dataCenter.js
0 → 100644
View file @
79b1c046
const
Datas
=
new
Map
();
const
dataCenter
=
{
setData
:
(
key
,
value
)
=>
{
Datas
.
set
(
key
,
value
);
},
getData
:
(
key
)
=>
{
return
Datas
.
get
(
key
)
}
}
export
default
dataCenter
project/src/pages/loading/loading.jsx
View file @
79b1c046
...
@@ -17,7 +17,8 @@ class Loading extends Component {
...
@@ -17,7 +17,8 @@ class Loading extends Component {
};
};
}
}
componentDidMount
()
{
async
componentDidMount
()
{
const
homeInfo
=
await
API
.
homeInfo
();
Promise
.
all
([
this
.
getCountdown
(),
API
.
getRule
()]).
then
(([,
res
])
=>
{
Promise
.
all
([
this
.
getCountdown
(),
API
.
getRule
()]).
then
(([,
res
])
=>
{
this
.
oncomplete
(
res
);
this
.
oncomplete
(
res
);
});
});
...
...
project/src/pages/main3/main3.jsx
View file @
79b1c046
...
@@ -5,15 +5,18 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
...
@@ -5,15 +5,18 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
import
{
Aup
,
AUPOP
,
AUP_MBX_STATE
}
from
'../../pop'
;
import
{
Aup
,
AUPOP
,
AUP_MBX_STATE
}
from
'../../pop'
;
import
'./main3.less'
;
import
'./main3.less'
;
import
{
CanvasWidget
}
from
'spark-utils'
;
import
{
Guideact
}
from
'@spark/guideact'
;
import
{
widgetConfig
}
from
'./widgetConfig'
;
let
_widget
;
class
Main3
extends
Component
{
class
Main3
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
resList
:
resList
,
resList
:
resList
,
nickname
:
'nickname'
,
nickname
:
'nickname'
,
avatar
:
1
,
avatar
:
1
,
num
:
"1123"
num
:
"1123"
};
};
}
}
...
@@ -27,8 +30,22 @@ class Main3 extends Component {
...
@@ -27,8 +30,22 @@ class Main3 extends Component {
}
}
}
}
onReady
(
widget
)
{
_widget
=
widget
;
}
onEvent
(
type
,
payload
)
{
console
.
log
(
type
,
payload
);
}
onAssetsProcess
(
loaded
,
total
)
{
console
.
log
(
`assets load process:
${
loaded
}
/
${
total
}
`
)
}
onAssetsComplete
()
{
console
.
log
(
`assets load complete`
)
}
render
()
{
render
()
{
const
{
avatar
,
nickname
,
num
}
=
this
.
state
;
const
{
avatar
,
nickname
,
num
}
=
this
.
state
;
return
(
return
(
<
div
className=
"main3 "
uuid=
"8754a9d1-7453-474b-b722-7cb71483ae85"
>
<
div
className=
"main3 "
uuid=
"8754a9d1-7453-474b-b722-7cb71483ae85"
>
<
img
<
img
...
@@ -43,17 +60,17 @@ class Main3 extends Component {
...
@@ -43,17 +60,17 @@ class Main3 extends Component {
uuid=
"5316b02a-5b8e-4355-b556-cd801852df7e"
uuid=
"5316b02a-5b8e-4355-b556-cd801852df7e"
src=
{
this
.
state
.
resList
[
'31522099-3ea6-4d2b-ae84-99e2877bd2d0'
].
url
}
src=
{
this
.
state
.
resList
[
'31522099-3ea6-4d2b-ae84-99e2877bd2d0'
].
url
}
/>
/>
{
avatar
==
1
&&
<
img
{
avatar
==
1
&&
<
img
className=
"main3_avatar1 "
className=
"main3_avatar1 "
uuid=
"f2277018-36fd-4f47-9124-d73324505dff"
uuid=
"f2277018-36fd-4f47-9124-d73324505dff"
src=
{
this
.
state
.
resList
[
'6dda365e-565e-4e15-9fc9-89b5e173dcd9'
].
url
}
src=
{
this
.
state
.
resList
[
'6dda365e-565e-4e15-9fc9-89b5e173dcd9'
].
url
}
/>
}
/>
}
{
avatar
==
2
&&
<
img
{
avatar
==
2
&&
<
img
className=
"main3_avatar2 "
className=
"main3_avatar2 "
uuid=
"07d1620b-d31e-4ef7-a63a-9b0ef49497da"
uuid=
"07d1620b-d31e-4ef7-a63a-9b0ef49497da"
src=
{
this
.
state
.
resList
[
'6ff31046-e036-4218-8cc9-5d715dfa64a1'
].
url
}
src=
{
this
.
state
.
resList
[
'6ff31046-e036-4218-8cc9-5d715dfa64a1'
].
url
}
/>
}
/>
}
{
avatar
==
3
&&
<
img
{
avatar
==
3
&&
<
img
className=
"main3_avatar3 "
className=
"main3_avatar3 "
uuid=
"dc2306b9-90e0-4e98-a967-e0f263a3217a"
uuid=
"dc2306b9-90e0-4e98-a967-e0f263a3217a"
src=
{
this
.
state
.
resList
[
'b4aa3a56-6a4f-4984-9aa2-1932c35de3b4'
].
url
}
src=
{
this
.
state
.
resList
[
'b4aa3a56-6a4f-4984-9aa2-1932c35de3b4'
].
url
}
...
@@ -134,6 +151,11 @@ class Main3 extends Component {
...
@@ -134,6 +151,11 @@ class Main3 extends Component {
uuid=
"c27fef65-4506-42f8-85df-207999e11de1"
uuid=
"c27fef65-4506-42f8-85df-207999e11de1"
src=
{
this
.
state
.
resList
[
'56b64b91-4e9a-49bd-bfd0-20d10b6e6556'
].
url
}
src=
{
this
.
state
.
resList
[
'56b64b91-4e9a-49bd-bfd0-20d10b6e6556'
].
url
}
/>
/>
<
CanvasWidget
className=
"canvas-widget"
widgetFactory=
{
Guideact
}
widgetConfig=
{
widgetConfig
}
onEvent=
{
this
.
onEvent
.
bind
(
this
)
}
onReady=
{
this
.
onReady
.
bind
(
this
)
}
onAssetsProcess=
{
this
.
onAssetsProcess
.
bind
(
this
)
}
onAssetsComplete=
{
this
.
onAssetsComplete
.
bind
(
this
)
}
/>
</
div
>
</
div
>
);
);
}
}
...
...
project/src/pages/main3/widgetConfig.js
0 → 100644
View file @
79b1c046
export
let
widgetConfig
=
{
props
:{
},
assets
:[
]
}
\ 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