Commit 94961a92 by 王崇仁

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

parent 58ff831d
......@@ -20,6 +20,8 @@ import Toast from '../components/Toast';
import Screensaver from '../components/Screensaver';
import {width, setSpText, scaleSize} from '../utils/screen';
import {qrHost} from '../utils/config';
import Icons from 'react-native-vector-icons/MaterialIcons';
import AutoClick from '../utils/AutoClick';
class FacePage extends Component {
state = {
......@@ -35,11 +37,12 @@ class FacePage extends Component {
tip: '',
tipsModal: false,
faceType: 'wxpay',
sleep: true,
sleep: false,
loadingModal: false,
qrCode: '',
goTipsModal: false,
type: '',
setting: false,
};
async componentWillMount() {
......@@ -55,8 +58,14 @@ class FacePage extends Component {
this.setState({faceType: 'alipay'});
}
}
const setting = await AutoClick.isSettingsOn();
if (!setting) this.setState({setting: true}); // 展示按钮
}
setting = async () => {
await AutoClick.goSetting(); // 按钮跳转设置
};
async componentDidMount() {
this.listen();
}
......@@ -587,6 +596,27 @@ class FacePage extends Component {
/>
</Touch>
</View>
{this.state.setting && (
<Touch
onPress={this.setting}
style={{
position: 'absolute',
width: 100,
height: 100,
bottom: 200,
right: 0,
backgroundColor: 'rgba(0,0,0,0.1)',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 10,
zIndex: 999,
}}>
<Icons
name="accessibility"
style={{fontSize: 60, color: '#fff'}}
/>
</Touch>
)}
<Touch onPress={this.face} style={styles.btnCome} feedback={false}>
<View style={styles.click}>
<Image
......@@ -745,6 +775,7 @@ const styles = {
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'space-around',
position: 'relative',
},
faceRecogn: {
flex: 0.7,
......
......@@ -4,9 +4,11 @@ import AsyncStorage from '@react-native-community/async-storage';
import Swiper from 'react-native-swiper';
import QRCode from 'react-native-qrcode-svg';
import Icon from 'react-native-vector-icons/Ionicons';
import Icons from 'react-native-vector-icons/MaterialIcons';
// import { connect } from 'react-redux';
import CounterMixins from './CounterMixins';
import NP from '../utils/np';
import AutoClick from '../utils/AutoClick';
import Touch from '../components/Touch';
import logo from '../assets/Vertical/logo.png';
import counterText from '../assets/Vertical/counterText.png';
......@@ -36,6 +38,7 @@ class VerticalPage extends Component {
talkCall: 2, // 0请求通话,1通话中,2,已挂断通话,待机状态
faceType: 'wxpay',
hintVisible: false,
setting: false,
};
async componentWillMount() {
......@@ -52,8 +55,14 @@ class VerticalPage extends Component {
this.setState({faceType: 'alipay'});
}
}
const setting = await AutoClick.isSettingsOn();
if (!setting) this.setState({setting: true}); // 展示按钮
}
setting = async () => {
await AutoClick.goSetting(); // 按钮跳转设置
};
async componentDidMount() {
this.listen();
}
......@@ -521,7 +530,12 @@ class VerticalPage extends Component {
renderItem={({item, index}) => this.renderCell(item, index)}
/>
</View>
<View style={{width: '10%', flexDirection: 'column'}}>
<View
style={{
width: '10%',
flexDirection: 'column',
justifyContent: 'center',
}}>
<View
style={{
height: width > 801 ? 81 : scaleHeight(118),
......@@ -558,6 +572,23 @@ class VerticalPage extends Component {
/>
</Touch>
</View>
{this.state.setting && (
<Touch
onPress={this.setting}
style={{
backgroundColor: 'rgba(0,0,0,0.1)',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 10,
paddingBottom: 20,
paddingTop: 20,
}}>
<Icons
name="accessibility"
style={{fontSize: 60, color: '#fff'}}
/>
</Touch>
)}
</View>
</View>
<View
......
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