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
162f6fdd
Commit
162f6fdd
authored
Dec 22, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a84ab89c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
31 deletions
+42
-31
index.js
project/mock/e-family/index.js
+5
-16
index.html
project/public/index.html
+1
-1
app.jsx
project/src/app.jsx
+5
-1
sign.jsx
project/src/components/sign/sign.jsx
+16
-5
loading.jsx
project/src/pages/loading/loading.jsx
+4
-7
main3.jsx
project/src/pages/main3/main3.jsx
+11
-1
No files found.
project/mock/e-family/index.js
View file @
162f6fdd
export
const
homeInfo
=
{
"code"
:
null
,
"data"
:
{
"canUpdateNickName"
:
false
,
"canUpdateNickName"
:
null
,
"figures"
:
[
{
"figureId"
:
"4"
},
{
"figureId"
:
"5"
},
{
"figureId"
:
"7"
}
{
"figureId"
:
"1"
},
{
"figureId"
:
"2"
},
{
"figureId"
:
"3"
}
],
"newUser"
:
true
,
"userInfo"
:
{
"figureId"
:
"1"
,
"joyBeans"
:
10000
,
"nickName"
:
"霞霞"
}
"userInfo"
:
null
},
"message"
:
null
,
"success"
:
true
}
export
const
updateUinfo
=
{
"code"
:
null
,
"data"
:
true
,
...
...
@@ -39,7 +28,7 @@ export const signInfo = {
"code"
:
null
,
"data"
:
{
"continuousDays"
:
0
,
"needPopup"
:
true
,
"needPopup"
:
1
,
"signLists"
:
[
{
"awardName"
:
"欢趣豆"
,
...
...
project/public/index.html
View file @
162f6fdd
...
...
@@ -5,7 +5,7 @@
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
>
<meta
name=
"theme-color"
content=
"#000000"
>
<title>
React App
</title>
<title>
e趣小镇
</title>
<script
src=
"getTokenKey"
id=
"scriptkey"
></script>
<script
id=
"scriptjs"
src=
"//yun.duiba.com.cn/js-libs/px-token/0.0.4/px-token.min.js"
></script>
<script
src=
"//yun.duiba.com.cn/js-libs/rem/1.1.0/rem.min.js"
></script>
...
...
project/src/app.jsx
View file @
162f6fdd
...
...
@@ -25,6 +25,10 @@ class App extends Component {
// }, 1000);
// }
eventHandler
=
()
=>
{
console
.
log
(
'eventHandler'
)
}
navigateTo
=
(
page
,
pagedata
)
=>
{
this
.
setState
({
page
,
pagedata
})
}
...
...
@@ -36,7 +40,7 @@ class App extends Component {
{
page
==
'loading'
&&
<
Loading
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Loading
>
}
{
page
==
'mainpage'
&&
<
Main3
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Main3
>
}
{
page
==
'detail'
&&
<
Detail2
data=
{
pagedata
}
navigateTo=
{
this
.
navigateTo
}
></
Detail2
>
}
<
AUPOP
AUPopState=
{
AUP_MBX_STATE
}
></
AUPOP
>
<
AUPOP
eventHandler=
{
this
.
eventHandler
}
AUPopState=
{
AUP_MBX_STATE
}
></
AUPOP
>
</>
);
}
...
...
project/src/components/sign/sign.jsx
View file @
162f6fdd
...
...
@@ -2,15 +2,18 @@
import
React
,
{
Component
}
from
'react'
;
import
resList
from
'../../resconfig/resList'
;
//import API from '../../api';
import
'./sign.less'
;
import
{
Toast
,
Loading
,
Badge
,
CountDownButton
,
InputNumber
}
from
'@spark/ui'
;
import
API
from
'../../api'
;
class
Sign
extends
Component
{
constructor
(
props
)
{
super
(
props
);
const
{
todaySigned
}
=
props
.
data
;
this
.
state
=
{
resList
:
resList
,
todaySigned
};
}
...
...
@@ -20,7 +23,14 @@ class Sign extends Component {
},
1000
);
}
doSign
=
()
=>
{
API
.
dosign
().
then
((
res
)
=>
{
this
.
props
.
ctx
.
updateMoney
();
})
}
render
()
{
const
{
todaySigned
}
=
this
.
state
;
return
(
<
div
className=
"sign "
uuid=
"14a66aed-4e41-4fea-9d16-6aa02c1bad5a"
>
<
img
...
...
@@ -272,16 +282,17 @@ class Sign extends Component {
+100
</
span
>
</
div
>
<
img
{
todaySigned
&&
<
img
className=
"sign_signed_btn "
uuid=
"d8ca8cb8-92f1-4512-aead-d674cac5a46c"
src=
{
this
.
state
.
resList
[
'534772d2-3e5a-487d-8236-8913de270cb0'
].
url
}
/>
<
img
/>
}
{
!
todaySigned
&&
<
img
onClick=
{
this
.
doSign
}
className=
"sign_btn "
uuid=
"4dfe2b82-10bd-4442-a01e-65c18869a18e"
src=
{
this
.
state
.
resList
[
'13b618c4-cd2a-4037-9664-b77381fbfade'
].
url
}
/>
/>
}
<
div
className=
"signed_7 "
uuid=
"7b91c31c-0de4-4148-9887-6ab24e963258"
>
<
img
className=
"signed_7_bg "
...
...
project/src/pages/loading/loading.jsx
View file @
162f6fdd
...
...
@@ -86,21 +86,18 @@ class Loading extends Component {
}
oncomplete
()
{
this
.
props
.
navigateTo
(
'mainpage'
)
;
let
isnewUser
;
let
homeinfo
=
dataCenter
.
getData
(
Store
.
homeinfo
);
if
(
homeinfo
){
const
{
newUser
}
=
homeinfo
;
if
(
newUser
){
//新用户,走选择,然后再走引导,引导结束后,走签到
Aup
.
show
(
'Select'
,
{},
this
);
}
else
{
API
.
signInfo
().
then
((
res
)
=>
{
const
{
needPopup
}
=
res
.
data
;
if
(
needPopup
)
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
})
isnewUser
=
1
;
}
}
this
.
props
.
navigateTo
(
'mainpage'
,{
isnewUser
});
}
render
()
{
...
...
project/src/pages/main3/main3.jsx
View file @
162f6fdd
...
...
@@ -23,6 +23,10 @@ class Main3 extends Component {
};
}
updateMoney
(){
console
.
log
(
'update money'
)
}
onClick_userinfo
=
()
=>
{
Aup
.
show
(
'Userinfo'
,
{},
this
);
// console.log('onClick_signBtn')
...
...
@@ -32,7 +36,6 @@ class Main3 extends Component {
API
.
signInfo
().
then
((
res
)
=>
{
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
})
// console.log('onClick_signBtn')
}
onClick_shareBtn
=
()
=>
{
...
...
@@ -50,6 +53,13 @@ class Main3 extends Component {
componentDidMount
()
{
this
.
initEvent
();
if
(
!
this
.
props
.
data
.
isnewUser
)
{
API
.
signInfo
().
then
((
res
)
=>
{
const
{
needPopup
}
=
res
.
data
;
if
(
needPopup
)
Aup
.
show
(
'Sign'
,
res
.
data
,
this
);
})
}
}
initEvent
()
{
GDispatcher
.
addEventListener
(
Store
.
homeinfo
,
this
.
freshHomeInfo
,
this
);
...
...
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