Commit 94961a92 by 王崇仁

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

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