提交 87d9c2bb 编写于 作者: YYYTDMS's avatar YYYTDMS

330_合并地图完成

上级 ef3ecccb
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:allowBackup="false" android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
......
...@@ -16,7 +16,7 @@ class MyHeader extends Component { ...@@ -16,7 +16,7 @@ class MyHeader extends Component {
backgroundColor="transparent" backgroundColor="transparent"
barStyle="dark-content" barStyle="dark-content"
/> />
<Divider style={styles.divider} /> {/*<Divider style={styles.divider} />*/}
<Header <Header
backgroundColor={'#CE9561'} backgroundColor={'#CE9561'}
centerComponent={{ centerComponent={{
......
import {Component} from 'react'; import {Component} from 'react';
import React from 'react'; import React from 'react';
import { import {
Dimensions, Dimensions,
Image, Image,
View, View,
Text, Text,
StyleSheet, StyleSheet,
TouchableOpacity, TouchableOpacity, ToastAndroid,
} from 'react-native'; } from 'react-native';
const deviceWidthDp = Dimensions.get('window').width; const deviceWidthDp = Dimensions.get('window').width;
const deviceHeightDp = Dimensions.get('window').height; const deviceHeightDp = Dimensions.get('window').height;
import DropDownModal from '../SingleComponent/DropDownModal'; import DropDownModal from '../SingleComponent/DropDownModal';
import RadioView from '../SingleComponent/RadioView'; import RadioView from '../SingleComponent/RadioView';
import {PanResponder} from 'react-native';
/** /**
* 偏好设置界面 * 偏好设置界面
*/ */
class SettingView extends Component { class SettingView extends Component {
constructor() { constructor() {
super(); super();
this.state = { this.state = {
flag: null, flag: null,
building: null, building: null,
floor: null, floor: null,
buildsListsetting: null, buildsListsetting: null,
}; };
} }
checkCallBack = id => { _panResponder = PanResponder.create({
this.setState({
flag: id, onStartShouldSetPanResponder: () => true,
}); onMoveShouldSetPanResponder: () => true,
}; onPanResponderGrant: () => {
_selectbuilding = (index, value) => { // console.log('开始移动:');
console.log(index + '--' + value); },
this.setState({ onPanResponderMove: (evt, gs) => {
building: value, // console.log('正在移动:X轴:' + gs.dx + ',Y轴:' + gs.dy);
}); },
}; onPanResponderRelease: (evt, gs) => {
_selectfloor = (index, value) => { // console.log('结束移动:X轴移动了:' + gs.dx + ',Y轴移动了:' + gs.dy);
console.log(index + '--' + value); if (gs.dx > 50) {
this.setState({ // console.log('由左向右');
floor: index + 1, } 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() {
const {buildsListsort} = this.props.route.params;
const {x1, x2, x3, zl, d1, d2, d3, w1, w2, w3, w4} =
this.props.route.params.buildsListsort; checkCallBack = id => {
const buildName = [x1, x2, x3, zl, d1, d2, d3, w1, w2, w3, w4]; this.setState({
if (JSON.stringify(buildsListsort) == '{}') { flag: id,
console.log(''); });
} else { };
console.log('传参', buildsListsort); _selectbuilding = (index, value) => {
for (let i = 0; i < buildName.length; i++) { console.log(index + '--' + value);
buildName[i].sort((a, b) => { this.setState({
return a.people_num - b.people_num; building: value,
});
};
_selectfloor = (index, value) => {
console.log(index + '--' + value);
this.setState({
floor: index + 1,
}); });
} };
this.setState({buildsListsetting: buildsListsort}, () => {
console.log('回调', this.state.buildsListsetting); componentDidMount() {
}); const {buildsListsort} = this.props.route.params;
const {x1, x2, x3, zl, d1, d2, d3, w1, w2, w3, w4} =
this.props.route.params.buildsListsort;
const buildName = [x1, x2, x3, zl, d1, d2, d3, w1, w2, w3, w4];
if (JSON.stringify(buildsListsort) == '{}') {
console.log('');
} else {
console.log('传参', buildsListsort);
for (let i = 0; i < buildName.length; i++) {
buildName[i].sort((a, b) => {
return a.people_num - b.people_num;
});
}
this.setState({buildsListsetting: buildsListsort}, () => {
console.log('回调', this.state.buildsListsetting);
});
}
} }
}
render() {
const {navigation} = this.props;
const {buildsListsort} = this.props.route.params;
// console.log('pppppp', this.state.buildsListsetting);
// console.log('处理后', buildsListsort);
return (
<View style={styles.container}>
<View style={styles.box1}>
<Image
source={require('../../../images/Map/Behavior.png')}
style={styles.box1image}
/>
<Text style={styles.box1text}>偏好设置</Text>
</View>
<View style={styles.box2}>
<DropDownModal
data={[
'西3楼',
'西2楼',
'西1楼',
'中楼',
'东1楼',
'东2楼',
'东3楼',
'文1楼',
'东2楼',
'东3楼',
'东4楼',
]}
title={'区域'}
imgSource={require('../../../images/Map/regionalRules.png')}
onChoosed={this._selectbuilding}
/>
</View>
<View style={styles.box3}>
<DropDownModal
data={['1楼', '2楼', '3楼', '4楼', '5楼']}
title={'楼层'}
imgSource={require('../../../images/Map/floor.png')}
onChoosed={this._selectfloor}
/>
</View>
<View style={styles.box4}>
<Image
source={require('../../../images/Map/Mytalent.png')}
style={styles.box4image}
/>
<View style={{flex: 2}}> render() {
<Text style={styles.text}>人少</Text> const {navigation} = this.props;
</View> const {buildsListsort} = this.props.route.params;
// console.log('pppppp', this.state.buildsListsetting);
// console.log('处理后', buildsListsort);
return (
<View style={styles.container} {...this._panResponder.panHandlers}>
<View style={styles.box1}>
<Image
source={require('../../../images/Map/Behavior.png')}
style={styles.box1image}
/>
<Text style={styles.box1text}>偏好设置</Text>
</View>
<View style={styles.box2}>
<DropDownModal
data={[
'西3楼',
'西2楼',
'西1楼',
'中楼',
'东1楼',
'东2楼',
'东3楼',
'文1楼',
'东2楼',
'东3楼',
'东4楼',
]}
title={'区域'}
imgSource={require('../../../images/Map/regionalRules.png')}
onChoosed={this._selectbuilding}
/>
</View>
<View style={styles.box3}>
<DropDownModal
data={['1楼', '2楼', '3楼', '4楼', '5楼']}
title={'楼层'}
imgSource={require('../../../images/Map/floor.png')}
onChoosed={this._selectfloor}
/>
</View>
<View style={styles.box4}>
<Image
source={require('../../../images/Map/Mytalent.png')}
style={styles.box4image}
/>
<RadioView <View style={{flex: 2}}>
id={1} <Text style={styles.text}>人少</Text>
onCheck={this.checkCallBack} </View>
checked={this.state.flag === 1}
/>
<View style={{flex: 2}}> <RadioView
<Text style={styles.text}>人多</Text> id={1}
</View> onCheck={this.checkCallBack}
checked={this.state.flag === 1}
/>
<RadioView <View style={{flex: 2}}>
id={2} <Text style={styles.text}>人多</Text>
onCheck={this.checkCallBack} </View>
checked={this.state.flag === 2}
/> <RadioView
<View style={{flex: 1.5}} /> id={2}
</View> onCheck={this.checkCallBack}
<View style={styles.box5}> checked={this.state.flag === 2}
<TouchableOpacity />
style={{ <View style={{flex: 1.5}}/>
backgroundColor: '#F6C354', </View>
width: deviceWidthDp / 4, <View style={styles.box5}>
height: deviceHeightDp / 20, <TouchableOpacity
marginBottom: 20, style={{
justifyContent: 'center', backgroundColor: '#F6C354',
marginRight: 30, width: deviceWidthDp / 4,
}} height: deviceHeightDp / 20,
onPress={() => { marginBottom: 20,
// console.log('this.state.flag', this.state.flag); justifyContent: 'center',
// console.log('this.state.building', this.state.building); marginRight: 30,
// console.log('this.state.floor', this.state.floor); }}
if ( onPress={() => {
this.state.flag == null || // console.log('this.state.flag', this.state.flag);
this.state.building == null || // console.log('this.state.building', this.state.building);
this.state.floor == null // console.log('this.state.floor', this.state.floor);
) { if (
alert('请设置偏好,微笑'); this.state.flag == null ||
} else { this.state.building == null ||
navigation.navigate('RecommendView', { this.state.floor == null
list: this.state.buildsListsetting, ) {
build: this.state.building,
floor: this.state.floor, ToastAndroid.show('请设置偏好~~(^v^)', 500);
flag: this.state.flag, } else {
}); navigation.navigate('RecommendView', {
} list: this.state.buildsListsetting,
}}> build: this.state.building,
<Text style={{color: '#FFFFFF', textAlign: 'center'}}> floor: this.state.floor,
开始匹配 flag: this.state.flag,
</Text> });
</TouchableOpacity> }
</View> }}>
<View style={{flex: 10}}> <Text style={{color: '#FFFFFF', textAlign: 'center'}}>
<Image 开始匹配
source={require('../../../images/Map/loading.png')} </Text>
style={styles.box5image} </TouchableOpacity>
/> </View>
</View> <View style={{flex: 10}}>
</View> <Image
); source={require('../../../images/Map/loading.png')}
} style={styles.box5image}
/>
</View>
</View>
);
}
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flexDirection: 'column', flexDirection: 'column',
flex: 1, flex: 1,
backgroundColor: '#F6B972', backgroundColor: '#F6B972',
}, },
box1: { box1: {
flexDirection: 'row', flexDirection: 'row',
flex: 1, flex: 1,
justifyContent: 'center', justifyContent: 'center',
// backgroundColor: 'black', // backgroundColor: 'black',
}, },
box1image: { box1image: {
height: deviceHeightDp / 25, height: deviceHeightDp / 25,
width: deviceWidthDp / 25, width: deviceWidthDp / 25,
resizeMode: 'contain', resizeMode: 'contain',
}, },
box1text: { box1text: {
textAlign: 'center', textAlign: 'center',
paddingTop: 5, paddingTop: 5,
color: '#FFFFFF', color: '#FFFFFF',
}, },
box2: { box2: {
flex: 1, flex: 1,
}, },
box3: { box3: {
flex: 1, flex: 1,
}, },
box4: { box4: {
flexDirection: 'row', flexDirection: 'row',
flex: 1, flex: 1,
}, },
box4image: { box4image: {
width: null, width: null,
height: null, height: null,
flex: 1.2, flex: 1.2,
resizeMode: 'contain', resizeMode: 'contain',
}, },
text: { text: {
fontSize: 22, fontSize: 22,
color: '#FFFFFF', color: '#FFFFFF',
textAlignVertical: 'center', textAlignVertical: 'center',
flex: 1, flex: 1,
textAlign: 'right', textAlign: 'right',
}, },
box5: { box5: {
flex: 1, flex: 1,
alignItems: 'flex-end', alignItems: 'flex-end',
}, },
box5image: { box5image: {
width: null, width: null,
height: null, height: null,
flex: 1, flex: 1,
resizeMode: 'contain', resizeMode: 'contain',
}, },
box6: { box6: {
flex: 1, flex: 1,
}, },
}); });
export default SettingView; export default SettingView;
...@@ -11,6 +11,7 @@ class Home extends Component { ...@@ -11,6 +11,7 @@ class Home extends Component {
} }
UNSAFE_componentWillMount() { UNSAFE_componentWillMount() {
if (Platform.OS === 'android') { if (Platform.OS === 'android') {
BackHandler.addEventListener('hardwareBackPress', this.onBackAndroid); BackHandler.addEventListener('hardwareBackPress', this.onBackAndroid);
} }
...@@ -24,6 +25,7 @@ class Home extends Component { ...@@ -24,6 +25,7 @@ class Home extends Component {
onBackAndroid = () => { onBackAndroid = () => {
//禁用返回键 //禁用返回键
if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) { if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) {
BackHandler.exitApp(); //直接退出APP BackHandler.exitApp(); //直接退出APP
......
...@@ -4513,6 +4513,11 @@ jsonify@~0.0.0: ...@@ -4513,6 +4513,11 @@ jsonify@~0.0.0:
array-includes "^3.1.4" array-includes "^3.1.4"
object.assign "^4.1.2" object.assign "^4.1.2"
kdbush@^3.0.0:
version "3.0.0"
resolved "https://registry.npmmirror.com/kdbush/-/kdbush-3.0.0.tgz#f8484794d47004cc2d85ed3a79353dbe0abc2bf0"
integrity sha512-hRkd6/XW4HTsA9vjVpY9tuXJYLSlelnkTmVFu4M9/7MIYQtFcHpbugAU7UbOfjOiVSVYl2fqgBuJ32JUmRo5Ew==
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2" version "3.2.2"
resolved "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz" resolved "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz"
...@@ -5034,6 +5039,11 @@ mkdirp@^0.5.1: ...@@ -5034,6 +5039,11 @@ mkdirp@^0.5.1:
dependencies: dependencies:
minimist "^1.2.6" minimist "^1.2.6"
moment@^2.29.3:
version "2.29.3"
resolved "https://registry.npmmirror.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3"
integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==
ms@2.0.0: ms@2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz" resolved "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz"
...@@ -5596,7 +5606,7 @@ prompts@^2.0.1, prompts@^2.4.0: ...@@ -5596,7 +5606,7 @@ prompts@^2.0.1, prompts@^2.4.0:
kleur "^3.0.3" kleur "^3.0.3"
sisteransi "^1.0.5" sisteransi "^1.0.5"
prop-types@*, prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.7.2, prop-types@^15.8.1: prop-types@*, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.7.2, prop-types@^15.8.1:
version "15.8.1" version "15.8.1"
resolved "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" resolved "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
...@@ -5683,6 +5693,13 @@ react-native-action-button@^2.8.5: ...@@ -5683,6 +5693,13 @@ react-native-action-button@^2.8.5:
dependencies: dependencies:
prop-types "^15.5.10" prop-types "^15.5.10"
react-native-amap3d@^3.0.7:
version "3.0.7"
resolved "https://registry.npmmirror.com/react-native-amap3d/-/react-native-amap3d-3.0.7.tgz#51c38ef14d15d55abf52ac0dd34d762a0b88eabd"
integrity sha512-bvER80OSLh/vQe8blY0Cr0NZCD3Yc0pcddOZU+51wS9r8z75QqDFW7lATvDsk3d5PDn+hUYK1XPyKG7rdBf8qw==
dependencies:
supercluster "^7.1.4"
react-native-codegen@^0.0.13: react-native-codegen@^0.0.13:
version "0.0.13" version "0.0.13"
resolved "https://registry.npmmirror.com/react-native-codegen/-/react-native-codegen-0.0.13.tgz" resolved "https://registry.npmmirror.com/react-native-codegen/-/react-native-codegen-0.0.13.tgz"
...@@ -5693,6 +5710,19 @@ react-native-codegen@^0.0.13: ...@@ -5693,6 +5710,19 @@ react-native-codegen@^0.0.13:
jscodeshift "^0.13.1" jscodeshift "^0.13.1"
nullthrows "^1.1.1" nullthrows "^1.1.1"
react-native-common-date-picker@^2.3.7:
version "2.3.7"
resolved "https://registry.npmmirror.com/react-native-common-date-picker/-/react-native-common-date-picker-2.3.7.tgz#c9fc6759a36e99e5ab230e9bd3171cad7472e4e3"
integrity sha512-XAell1MdBDjOkmHl6PxkNRstUvdrQmj36tu2zgTPR/EA3Db0Sr/LhwO+pdcA3XlJ7bPWt89tNantM16obzBz6Q==
react-native-drawer@^2.5.1:
version "2.5.1"
resolved "https://registry.npmmirror.com/react-native-drawer/-/react-native-drawer-2.5.1.tgz#08b9314184f48c724f1b467f8859797369798654"
integrity sha512-cxcQNbSWy5sbGi7anSVp6EDr6JarOBMY9lbFOeLFeVYbONiudoqRKbgEsSDgSw3/LFCLvUXK5zdjXCOedeytxQ==
dependencies:
prop-types "^15.5.8"
tween-functions "^1.0.1"
react-native-elements@^3.4.2: react-native-elements@^3.4.2:
version "3.4.2" version "3.4.2"
resolved "https://registry.npmmirror.com/react-native-elements/-/react-native-elements-3.4.2.tgz" resolved "https://registry.npmmirror.com/react-native-elements/-/react-native-elements-3.4.2.tgz"
...@@ -5774,6 +5804,11 @@ react-native-tab-navigator@^0.3.4: ...@@ -5774,6 +5804,11 @@ react-native-tab-navigator@^0.3.4:
immutable "^3.8.1" immutable "^3.8.1"
prop-types "^15.5.10" prop-types "^15.5.10"
react-native-table-component@^1.2.2:
version "1.2.2"
resolved "https://registry.npmmirror.com/react-native-table-component/-/react-native-table-component-1.2.2.tgz#1c9bdcd8f1fd7edf10d1e93ebc3b7877ecd74def"
integrity sha512-7bbsi5431iWcjj3toASh8lFHGi6AG/+MTd4M7GuksXKxx/CFs/Qwv1Ys7D2wgyuYKe3hxWNfSVrteFj0tOYXYw==
react-native-vector-icons@^9.1.0: react-native-vector-icons@^9.1.0:
version "9.1.0" version "9.1.0"
resolved "https://registry.npmmirror.com/react-native-vector-icons/-/react-native-vector-icons-9.1.0.tgz#52eaa205f5954d567b7048eb93d58ac854a2c59e" resolved "https://registry.npmmirror.com/react-native-vector-icons/-/react-native-vector-icons-9.1.0.tgz#52eaa205f5954d567b7048eb93d58ac854a2c59e"
...@@ -6619,6 +6654,13 @@ sudo-prompt@^9.0.0: ...@@ -6619,6 +6654,13 @@ sudo-prompt@^9.0.0:
resolved "https://registry.npmmirror.com/sudo-prompt/-/sudo-prompt-9.2.1.tgz" resolved "https://registry.npmmirror.com/sudo-prompt/-/sudo-prompt-9.2.1.tgz"
integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw== integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==
supercluster@^7.1.4:
version "7.1.5"
resolved "https://registry.npmmirror.com/supercluster/-/supercluster-7.1.5.tgz#65a6ce4a037a972767740614c19051b64b8be5a3"
integrity sha512-EulshI3pGUM66o6ZdH3ReiFcvHpM3vAigyK+vcxdjpJyEbIIrtbmBdY23mGgnI24uXiGFvrGq9Gkum/8U7vJWg==
dependencies:
kdbush "^3.0.0"
supports-color@^5.3.0: supports-color@^5.3.0:
version "5.5.0" version "5.5.0"
resolved "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz" resolved "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz"
...@@ -6804,6 +6846,11 @@ tsutils@^3.17.1: ...@@ -6804,6 +6846,11 @@ tsutils@^3.17.1:
dependencies: dependencies:
tslib "^1.8.1" tslib "^1.8.1"
tween-functions@^1.0.1:
version "1.2.0"
resolved "https://registry.npmmirror.com/tween-functions/-/tween-functions-1.2.0.tgz#1ae3a50e7c60bb3def774eac707acbca73bbc3ff"
integrity sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==
type-check@^0.4.0, type-check@~0.4.0: type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz" resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册