Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bh_face_counter
Overview
Overview
Details
Activity
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
黄天晨
bh_face_counter
Commits
4c285d87
Commit
4c285d87
authored
Jul 14, 2020
by
zeven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权设备等待页面
parent
3de7072c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
42 deletions
+93
-42
App.js
src/App.js
+3
-2
HomeLayout.js
src/components/HomeLayout.js
+55
-0
Placeholder.js
src/components/Placeholder.js
+32
-0
AuthPage.js
src/pages/AuthPage.js
+3
-40
No files found.
src/App.js
View file @
4c285d87
import
React
from
'react'
;
import
React
from
'react'
;
import
{
View
,
Dimensions
}
from
'react-native'
;
import
{
Dimensions
}
from
'react-native'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
AsyncStorage
from
'@react-native-community/async-storage'
;
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
qs
from
'qs'
;
import
qs
from
'qs'
;
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
io
from
'socket.io-client'
;
import
io
from
'socket.io-client'
;
import
Toast
from
'./components/Toast'
;
import
Toast
from
'./components/Toast'
;
import
Placeholder
from
'./components/Placeholder'
;
import
router
from
'./router'
;
import
router
from
'./router'
;
import
models
from
'./models'
;
import
models
from
'./models'
;
import
dva
from
'./utils/dva'
;
import
dva
from
'./utils/dva'
;
...
@@ -174,7 +175,7 @@ class App extends React.Component {
...
@@ -174,7 +175,7 @@ class App extends React.Component {
const
{
ready
,
curRoute
}
=
this
.
state
;
const
{
ready
,
curRoute
}
=
this
.
state
;
const
route
=
Object
.
keys
(
router
).
filter
(
name
=>
curRoute
===
name
)[
0
];
const
route
=
Object
.
keys
(
router
).
filter
(
name
=>
curRoute
===
name
)[
0
];
const
Component
=
router
[
route
];
const
Component
=
router
[
route
];
return
ready
?
<
Component
route
=
{
curRoute
}
/> : <
View
/
>
;
return
ready
?
<
Component
route
=
{
curRoute
}
/> : <
Placeholder
/
>
;
}
}
}
}
...
...
src/components/HomeLayout.js
0 → 100644
View file @
4c285d87
import
React
,
{
Component
}
from
'react'
;
import
{
Image
,
Text
,
View
}
from
'react-native'
;
class
HomeLayout
extends
Component
{
render
()
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
title
}
>
<
Image
style
=
{
styles
.
titleImg
}
source
=
{
require
(
'../assets/logo2.png'
)}
resizeMode
=
"contain"
/>
<
Image
style
=
{{
marginLeft
:
20
}}
source
=
{
require
(
'../assets/Vertical/24h.png'
)}
/
>
<
Text
style
=
{
styles
.
titleText
}
>
仲马购人工智能
<
/Text
>
<
/View
>
{
this
.
props
.
children
}
<
/View
>
);
}
}
const
styles
=
{
title
:
{
top
:
0
,
paddingLeft
:
30
,
flexDirection
:
'row'
,
height
:
100
,
width
:
'100%'
,
position
:
'absolute'
,
backgroundColor
:
'white'
,
alignItems
:
'center'
,
elevation
:
10
,
},
titleImg
:
{
width
:
80
,
height
:
80
,
},
titleText
:
{
color
:
'#333'
,
fontSize
:
40
,
marginLeft
:
30
,
},
container
:
{
flex
:
1
,
backgroundColor
:
'#F5F5F5'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
},
};
export
default
HomeLayout
;
src/components/Placeholder.js
0 → 100644
View file @
4c285d87
import
React
,
{
Component
}
from
'react'
;
import
{
View
,
Image
,
Text
}
from
'react-native'
;
import
HomeLayout
from
'./HomeLayout'
;
class
Placeholder
extends
Component
{
render
()
{
return
(
<
HomeLayout
>
<
View
style
=
{
styles
.
container
}
>
<
Image
source
=
{
require
(
'../assets/Vertical/face.gif'
)}
/
>
<
Text
style
=
{
styles
.
text
}
>
正在授权设备,请确保网络连接正常
~<
/Text
>
<
/View
>
<
/HomeLayout
>
);
}
}
const
styles
=
{
container
:
{
flex
:
1
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
background
:
'white'
,
},
text
:
{
fontSize
:
30
,
marginTop
:
20
,
color
:
'gray'
,
},
};
export
default
Placeholder
;
src/pages/AuthPage.js
View file @
4c285d87
...
@@ -5,6 +5,7 @@ import io from 'socket.io-client';
...
@@ -5,6 +5,7 @@ import io from 'socket.io-client';
import
axios
from
'axios'
;
import
axios
from
'axios'
;
import
{
counterLogin
}
from
'../utils/authLogin'
;
import
{
counterLogin
}
from
'../utils/authLogin'
;
import
config
from
'../utils/config'
;
import
config
from
'../utils/config'
;
import
HomeLayout
from
'../components/HomeLayout'
;
class
AuthPage
extends
Component
{
class
AuthPage
extends
Component
{
state
=
{};
state
=
{};
...
@@ -29,19 +30,7 @@ class AuthPage extends Component {
...
@@ -29,19 +30,7 @@ class AuthPage extends Component {
render
()
{
render
()
{
const
{
socket
}
=
this
.
state
;
const
{
socket
}
=
this
.
state
;
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
HomeLayout
>
<
View
style
=
{
styles
.
title
}
>
<
Image
style
=
{
styles
.
titleImg
}
source
=
{
require
(
'../assets/logo2.png'
)}
resizeMode
=
"contain"
/>
<
Image
style
=
{{
marginLeft
:
20
}}
source
=
{
require
(
'../assets/Vertical/24h.png'
)}
/
>
<
Text
style
=
{
styles
.
titleText
}
>
仲马购人工智能
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
qrcode
}
>
<
View
style
=
{
styles
.
qrcode
}
>
<
QRCode
<
QRCode
size
=
{
350
}
size
=
{
350
}
...
@@ -51,38 +40,12 @@ class AuthPage extends Component {
...
@@ -51,38 +40,12 @@ class AuthPage extends Component {
value
=
{
`
${
config
.
qrHost
}
/#/store-auth-
${
socket
}
`
}
value
=
{
`
${
config
.
qrHost
}
/#/store-auth-
${
socket
}
`
}
/
>
/
>
<
/View
>
<
/View
>
<
/
View
>
<
/
HomeLayout
>
);
);
}
}
}
}
const
styles
=
{
const
styles
=
{
title
:
{
top
:
0
,
paddingLeft
:
30
,
flexDirection
:
'row'
,
height
:
100
,
width
:
'100%'
,
position
:
'absolute'
,
backgroundColor
:
'white'
,
alignItems
:
'center'
,
elevation
:
10
,
},
titleImg
:
{
width
:
80
,
height
:
80
,
},
titleText
:
{
color
:
'#333'
,
fontSize
:
40
,
marginLeft
:
30
,
},
container
:
{
flex
:
1
,
backgroundColor
:
'#F5F5F5'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
},
qrcode
:
{
qrcode
:
{
padding
:
10
,
padding
:
10
,
backgroundColor
:
'white'
,
backgroundColor
:
'white'
,
...
...
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