提交 31c16ad6 编写于 作者: YYYTDMS's avatar YYYTDMS

330_修改bug

上级 2235abce
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Image, StyleSheet, Text, View, Dimensions, Button} from 'react-native'; import {Image, StyleSheet, Text, View, Dimensions, Button, PanResponder} from 'react-native';
/** /**
* 推荐界面 * 推荐界面
*/ */
...@@ -11,6 +11,30 @@ class RecommendView extends Component { ...@@ -11,6 +11,30 @@ class RecommendView extends Component {
result: '未有符合条件的教室', result: '未有符合条件的教室',
}; };
} }
_panResponder = PanResponder.create({
onStartShouldSetPanResponder: () => true,
onMoveShouldSetPanResponder: () => true,
onPanResponderGrant: () => {
// console.log('开始移动:');
},
onPanResponderMove: (evt, gs) => {
// console.log('正在移动:X轴:' + gs.dx + ',Y轴:' + gs.dy);
},
onPanResponderRelease: (evt, gs) => {
// console.log('结束移动:X轴移动了:' + gs.dx + ',Y轴移动了:' + gs.dy);
if (gs.dx > 50) {
// console.log('由左向右');
} else if (gs.dx < -50) {
// console.log('由右向左');
} else if (gs.dy > 50) {
// console.log('由上向下');
} else if (gs.dy < -50) {
// console.log('由下向上');
// this.props.navigation.back();
this.props.navigation.goBack()
}
},
});
componentDidMount() { componentDidMount() {
const {list, build, floor, flag} = this.props.route.params; const {list, build, floor, flag} = this.props.route.params;
...@@ -55,7 +79,7 @@ class RecommendView extends Component { ...@@ -55,7 +79,7 @@ class RecommendView extends Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container} >
<Text style={{color: 'white', fontSize: 30, padding: 10}}>推荐</Text> <Text style={{color: 'white', fontSize: 30, padding: 10}}>推荐</Text>
<Text <Text
style={{marginLeft: 10, color: 'white', padding: 10, fontSize: 25}}> style={{marginLeft: 10, color: 'white', padding: 10, fontSize: 25}}>
...@@ -90,7 +114,7 @@ class RecommendView extends Component { ...@@ -90,7 +114,7 @@ class RecommendView extends Component {
}} }}
/> />
</View> </View>
<View style={{flex: 1}}> <View style={{flex: 1}} {...this._panResponder.panHandlers}>
<Image <Image
source={require('../../../images/Map/Emptydata.png')} source={require('../../../images/Map/Emptydata.png')}
style={{ style={{
......
...@@ -28,8 +28,8 @@ class SettingView extends Component { ...@@ -28,8 +28,8 @@ class SettingView extends Component {
buildsListsetting: null, buildsListsetting: null,
}; };
} }
_panResponder = PanResponder.create({
_panResponder = PanResponder.create({
onStartShouldSetPanResponder: () => true, onStartShouldSetPanResponder: () => true,
onMoveShouldSetPanResponder: () => true, onMoveShouldSetPanResponder: () => true,
onPanResponderGrant: () => { onPanResponderGrant: () => {
...@@ -54,9 +54,6 @@ class SettingView extends Component { ...@@ -54,9 +54,6 @@ class SettingView extends Component {
}, },
}); });
checkCallBack = id => { checkCallBack = id => {
this.setState({ this.setState({
flag: id, flag: id,
...@@ -101,7 +98,7 @@ class SettingView extends Component { ...@@ -101,7 +98,7 @@ class SettingView extends Component {
// console.log('pppppp', this.state.buildsListsetting); // console.log('pppppp', this.state.buildsListsetting);
// console.log('处理后', buildsListsort); // console.log('处理后', buildsListsort);
return ( return (
<View style={styles.container} {...this._panResponder.panHandlers}> <View style={styles.container} >
<View style={styles.box1}> <View style={styles.box1}>
<Image <Image
source={require('../../../images/Map/Behavior.png')} source={require('../../../images/Map/Behavior.png')}
...@@ -199,7 +196,7 @@ class SettingView extends Component { ...@@ -199,7 +196,7 @@ class SettingView extends Component {
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{flex: 10}}> <View style={{flex: 10}} {...this._panResponder.panHandlers}>
<Image <Image
source={require('../../../images/Map/loading.png')} source={require('../../../images/Map/loading.png')}
style={styles.box5image} style={styles.box5image}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册