Commit 98c6b890 by 王崇仁

刷脸页面和收银台添加跳转无障碍按钮

parent 94961a92
......@@ -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});
}
});
}
......
......@@ -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}) {
......
......@@ -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: false,
sleep: true,
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>
)}
......
......@@ -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>
)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment