Commit 17976493 by 修福龙

修复人脸语音通话问题

parent 4997068c
...@@ -5,6 +5,7 @@ import MIcon from 'react-native-vector-icons/MaterialCommunityIcons'; ...@@ -5,6 +5,7 @@ import MIcon from 'react-native-vector-icons/MaterialCommunityIcons';
import ModalStyles from './Modal/styles'; import ModalStyles from './Modal/styles';
import {colors, font} from '../utils/common'; import {colors, font} from '../utils/common';
import Touch from './Touch'; import Touch from './Touch';
import phone from '../assets/Vertical/phone.png';
const mStyles = { const mStyles = {
...ModalStyles, ...ModalStyles,
...@@ -63,7 +64,7 @@ class PhoneModal extends Component { ...@@ -63,7 +64,7 @@ class PhoneModal extends Component {
}; };
render() { render() {
const {onClose, ...props} = this.props; const {onCall, ...props} = this.props;
const {value} = this.state; const {value} = this.state;
return ( return (
<Modal styles={mStyles} {...props}> <Modal styles={mStyles} {...props}>
...@@ -78,11 +79,13 @@ class PhoneModal extends Component { ...@@ -78,11 +79,13 @@ class PhoneModal extends Component {
/> />
<Text style={styles.text}>安全验证手机号</Text> <Text style={styles.text}>安全验证手机号</Text>
</View> </View>
<View style={styles.right}> <Touch onPress={() => onCall()}>
<Touch onPress={() => onClose()}> <View style={styles.right}>
<Icon name="md-close" color={'#FFFFFF'} size={50} /> {/*<Icon name="md-close" color={'#FFFFFF'} size={50} />*/}
</Touch> <Text style={styles.text}>呼叫客服</Text>
</View> <Image style={styles.phone} source={phone} />
</View>
</Touch>
</View> </View>
<View style={styles.image}> <View style={styles.image}>
<Image <Image
...@@ -206,6 +209,7 @@ const styles = { ...@@ -206,6 +209,7 @@ const styles = {
right: { right: {
flexDirection: 'row-reverse', flexDirection: 'row-reverse',
alignItems: 'center', alignItems: 'center',
marginTop: 15,
}, },
img: { img: {
width: 80, width: 80,
...@@ -213,6 +217,12 @@ const styles = { ...@@ -213,6 +217,12 @@ const styles = {
marginRight: 10, marginRight: 10,
resizeMode: 'contain', resizeMode: 'contain',
}, },
phone: {
width: 40,
height: 40,
marginRight: 10,
resizeMode: 'contain',
},
image: { image: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
......
...@@ -5,6 +5,7 @@ import MIcon from 'react-native-vector-icons/MaterialCommunityIcons'; ...@@ -5,6 +5,7 @@ import MIcon from 'react-native-vector-icons/MaterialCommunityIcons';
import ModalStyles from './Modal/styles'; import ModalStyles from './Modal/styles';
import {colors, font} from '../utils/common'; import {colors, font} from '../utils/common';
import Touch from './Touch'; import Touch from './Touch';
import phone from '../assets/Vertical/phone.png';
const mStyles = { const mStyles = {
...ModalStyles, ...ModalStyles,
...@@ -52,10 +53,13 @@ class VerifyCodeModal extends Component { ...@@ -52,10 +53,13 @@ class VerifyCodeModal extends Component {
const {onSubmit} = this.props; const {onSubmit} = this.props;
if (index < 10 && value.length < 4) { if (index < 10 && value.length < 4) {
value += index; value += index;
if (value.length === 4) {
onSubmit(value);
}
} else if (index === 11) { } else if (index === 11) {
value = value.substr(0, value.length - 1); value = value.substr(0, value.length - 1);
} else if (index === 12) { } else if (index === 12) {
this.setState({value: ''}); // this.setState({value: ''});
onSubmit(value); onSubmit(value);
return; return;
} }
...@@ -63,7 +67,7 @@ class VerifyCodeModal extends Component { ...@@ -63,7 +67,7 @@ class VerifyCodeModal extends Component {
}; };
render() { render() {
const {onClose, ...props} = this.props; const {onCall, ...props} = this.props;
const {value} = this.state; const {value} = this.state;
return ( return (
<Modal styles={mStyles} {...props}> <Modal styles={mStyles} {...props}>
...@@ -78,11 +82,13 @@ class VerifyCodeModal extends Component { ...@@ -78,11 +82,13 @@ class VerifyCodeModal extends Component {
/> />
<Text style={styles.text}>安全验证手机号</Text> <Text style={styles.text}>安全验证手机号</Text>
</View> </View>
<View style={styles.right}> <Touch onPress={() => onCall()}>
<Touch onPress={() => onClose()}> <View style={styles.right}>
<Icon name="md-close" color={'#FFFFFF'} size={50} /> {/*<Icon name="md-close" color={'#FFFFFF'} size={50} />*/}
</Touch> <Text style={styles.text}>呼叫客服</Text>
</View> <Image style={styles.phone} source={phone} />
</View>
</Touch>
</View> </View>
<View style={styles.image}> <View style={styles.image}>
<Image <Image
...@@ -191,6 +197,7 @@ const styles = { ...@@ -191,6 +197,7 @@ const styles = {
right: { right: {
flexDirection: 'row-reverse', flexDirection: 'row-reverse',
alignItems: 'center', alignItems: 'center',
marginTop: 15,
}, },
img: { img: {
width: 80, width: 80,
...@@ -198,6 +205,12 @@ const styles = { ...@@ -198,6 +205,12 @@ const styles = {
marginRight: 10, marginRight: 10,
resizeMode: 'contain', resizeMode: 'contain',
}, },
phone: {
width: 40,
height: 40,
marginRight: 10,
resizeMode: 'contain',
},
image: { image: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
......
import React, {Component} from 'react'; import React, {Component} from 'react';
import {View, Text, Image, Dimensions, Modal} from 'react-native'; import {View, Text, Image, 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 RtcEngine from 'react-native-agora'; // import RtcEngine from 'react-native-agora';
...@@ -89,17 +89,17 @@ class FacePage extends Component { ...@@ -89,17 +89,17 @@ class FacePage extends Component {
} }
}; };
handleClose = () => { // handleClose = () => {
this.setState({ // this.setState({
phoneModal: false, // phoneModal: false,
}); // });
}; // };
//
handleCodeClose = () => { // handleCodeClose = () => {
this.setState({ // this.setState({
verifyCodeModal: false, // verifyCodeModal: false,
}); // });
}; // };
handleOrderClose = () => { handleOrderClose = () => {
this.setState({ this.setState({
...@@ -125,7 +125,7 @@ class FacePage extends Component { ...@@ -125,7 +125,7 @@ class FacePage extends Component {
window.socket.on('talkCall', this.handleTalkCall); window.socket.on('talkCall', this.handleTalkCall);
} }
if (!window.socket.hasListeners('talkLeave')) { if (!window.socket.hasListeners('talkLeave')) {
// 语音通话中 // 断开语音通话
window.socket.on('talkLeave', this.leaveC); window.socket.on('talkLeave', this.leaveC);
} }
} catch (e) { } catch (e) {
...@@ -142,7 +142,7 @@ class FacePage extends Component { ...@@ -142,7 +142,7 @@ class FacePage extends Component {
type: 'agora/agora', type: 'agora/agora',
}); });
await onTalkCall(data); await onTalkCall(data);
this.setState({ await this.setState({
talkCall: 1, talkCall: 1,
}); });
} catch (e) { } catch (e) {
...@@ -347,16 +347,18 @@ class FacePage extends Component { ...@@ -347,16 +347,18 @@ class FacePage extends Component {
visible={phoneModal} visible={phoneModal}
transparent transparent
// maskClosable // maskClosable
onClose={this.handleClose} // onClose={this.handleClose}
onRequestClose={this.handleClose} // onRequestClose={this.handleClose}
onCall={this.onCall}
onSubmit={this.onSubmit} onSubmit={this.onSubmit}
/> />
<VerifyCodeModal <VerifyCodeModal
visible={verifyCodeModal} visible={verifyCodeModal}
transparent transparent
// maskClosable // maskClosable
onClose={this.handleCodeClose} // onClose={this.handleCodeClose}
onRequestClose={this.handleCodeClose} // onRequestClose={this.handleCodeClose}
onCall={this.onCall}
onSubmit={this.onCodeSubmit} onSubmit={this.onCodeSubmit}
/> />
<OrderDetailsModal <OrderDetailsModal
......
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