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
98c6b890
Commit
98c6b890
authored
Dec 04, 2020
by
王崇仁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
刷脸页面和收银台添加跳转无障碍按钮
parent
94961a92
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
14 deletions
+27
-14
App.js
src/App.js
+5
-2
admin.js
src/models/admin.js
+5
-0
FacePage.js
src/pages/FacePage.js
+8
-7
VerticalPage.js
src/pages/VerticalPage.js
+9
-5
No files found.
src/App.js
View file @
98c6b890
...
...
@@ -20,6 +20,7 @@ import {counterInterval} from './utils/authInterval';
import
{
counterLogin
}
from
'./utils/authLogin'
;
import
{
host
}
from
'./utils/config'
;
import
pack
from
'../package.json'
;
import
AutoClick
from
'./utils/AutoClick'
;
const
{
width
:
_width
,
height
:
_height
}
=
Dimensions
.
get
(
'window'
);
...
...
@@ -80,13 +81,15 @@ class App extends React.Component {
this
.
setState
({
ready
:
true
});
}
componentDidMount
()
{
async
componentDidMount
()
{
if
(
process
.
env
.
NODE_ENV
===
'production'
)
Speech
.
speak
(
`当前版本
${
pack
.
version
}
`
);
codePush
.
sync
();
AppState
.
addEventListener
(
'change'
,
newState
=>
{
AppState
.
addEventListener
(
'change'
,
async
newState
=>
{
if
(
newState
===
'active'
)
{
codePush
.
sync
();
// 检查更新
let
autoClick
=
await
AutoClick
.
isSettingsOn
();
// 展示按钮
this
.
props
.
dispatch
({
type
:
'admin/autoClick'
,
autoClick
});
}
});
}
...
...
src/models/admin.js
View file @
98c6b890
...
...
@@ -7,6 +7,7 @@ export default {
state
:
{
auth
:
{},
socket
:
''
,
autoClick
:
true
,
},
reducers
:
{
setAuth
(
state
,
{
id
,
auth
,
login
})
{
...
...
@@ -35,6 +36,10 @@ export default {
state
.
socket
=
socket
;
return
{...
state
};
},
autoClick
(
state
,
{
autoClick
})
{
state
.
autoClick
=
autoClick
;
return
{...
state
};
},
},
effects
:
{
*
auth
(
action
,
{
put
,
call
})
{
...
...
src/pages/FacePage.js
View file @
98c6b890
...
...
@@ -23,6 +23,7 @@ import {qrHost} from '../utils/config';
import
Icons
from
'react-native-vector-icons/MaterialIcons'
;
import
AutoClick
from
'../utils/AutoClick'
;
@
connect
(({
admin
})
=>
({
admin
}))
class
FacePage
extends
Component
{
state
=
{
phoneModal
:
false
,
// 显示输入电话号码弹窗
...
...
@@ -37,7 +38,7 @@ class FacePage extends Component {
tip
:
''
,
tipsModal
:
false
,
faceType
:
'wxpay'
,
sleep
:
fals
e
,
sleep
:
tru
e
,
loadingModal
:
false
,
qrCode
:
''
,
goTipsModal
:
false
,
...
...
@@ -504,7 +505,7 @@ class FacePage extends Component {
}
else
{
flag
=
''
;
}
let
{
dispatch
}
=
this
.
props
;
let
{
dispatch
,
admin
}
=
this
.
props
;
if
(
faceType
===
'alipay'
)
{
styles
.
header
=
{...
styles
.
header
,
backgroundColor
:
'#1b7dc7'
};
styles
.
btnCome
=
{...
styles
.
btnCome
,
backgroundColor
:
'#1b7dc7'
};
...
...
@@ -596,14 +597,14 @@ class FacePage extends Component {
/
>
<
/Touch
>
<
/View
>
{
this
.
state
.
setting
&&
(
{
!
admin
.
autoClick
&&
(
<
Touch
onPress
=
{
this
.
setting
}
style
=
{{
position
:
'absolute'
,
width
:
100
,
height
:
100
,
bottom
:
200
,
width
:
scaleSize
(
100
)
,
height
:
scaleSize
(
100
)
,
bottom
:
scaleSize
(
200
)
,
right
:
0
,
backgroundColor
:
'rgba(0,0,0,0.1)'
,
alignItems
:
'center'
,
...
...
@@ -613,7 +614,7 @@ class FacePage extends Component {
}}
>
<
Icons
name
=
"accessibility"
style
=
{{
fontSize
:
60
,
color
:
'#fff'
}}
style
=
{{
fontSize
:
setSpText
(
60
)
,
color
:
'#fff'
}}
/
>
<
/Touch
>
)}
...
...
src/pages/VerticalPage.js
View file @
98c6b890
...
...
@@ -534,7 +534,7 @@ class VerticalPage extends Component {
style
=
{{
width
:
'10%'
,
flexDirection
:
'column'
,
justifyContent
:
'center
'
,
position
:
'relative
'
,
}}
>
<
View
style
=
{{
...
...
@@ -572,20 +572,24 @@ class VerticalPage extends Component {
/
>
<
/Touch
>
<
/View
>
{
this
.
state
.
setting
&&
(
{
!
admin
.
autoClick
&&
(
<
Touch
onPress
=
{
this
.
setting
}
style
=
{{
position
:
'absolute'
,
width
:
scaleSize
(
100
),
height
:
scaleSize
(
100
),
bottom
:
scaleSize
(
100
),
right
:
0
,
backgroundColor
:
'rgba(0,0,0,0.1)'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
borderRadius
:
10
,
paddingBottom
:
20
,
paddingTop
:
20
,
zIndex
:
999
,
}}
>
<
Icons
name
=
"accessibility"
style
=
{{
fontSize
:
60
,
color
:
'#fff'
}}
style
=
{{
fontSize
:
setSpText
(
60
)
,
color
:
'#fff'
}}
/
>
<
/Touch
>
)}
...
...
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