diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ea88065790e00142ce56f676426e67c9abf6d579..4ac4741f9030d72f99338f0ba3080451b32426f1 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,7 +10,6 @@ android:roundIcon="@mipmap/ic_launcher_round" android:usesCleartextTraffic="true" android:allowBackup="false" - android:usesCleartextTraffic="true" android:theme="@style/AppTheme"> - + {/**/}
{ - this.setState({ - flag: id, - }); - }; - _selectbuilding = (index, value) => { - console.log(index + '--' + value); - this.setState({ - building: value, - }); - }; - _selectfloor = (index, value) => { - console.log(index + '--' + value); - this.setState({ - floor: index + 1, + constructor() { + super(); + this.state = { + flag: null, + building: null, + floor: null, + buildsListsetting: null, + }; + } + _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() { - 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; + + + + + checkCallBack = id => { + this.setState({ + flag: id, + }); + }; + _selectbuilding = (index, value) => { + console.log(index + '--' + value); + this.setState({ + 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 ( - - - - 偏好设置 - - - - - - - - - - - 人少 - + render() { + const {navigation} = this.props; + const {buildsListsort} = this.props.route.params; + // console.log('pppppp', this.state.buildsListsetting); + // console.log('处理后', buildsListsort); + return ( + + + + 偏好设置 + + + + + + + + + - + + 人少 + - - 人多 - + - - - - - { - // console.log('this.state.flag', this.state.flag); - // console.log('this.state.building', this.state.building); - // console.log('this.state.floor', this.state.floor); - if ( - this.state.flag == null || - this.state.building == null || - this.state.floor == null - ) { - alert('请设置偏好,微笑'); - } else { - navigation.navigate('RecommendView', { - list: this.state.buildsListsetting, - build: this.state.building, - floor: this.state.floor, - flag: this.state.flag, - }); - } - }}> - - 开始匹配 - - - - - - - - ); - } + + 人多 + + + + + + + { + // console.log('this.state.flag', this.state.flag); + // console.log('this.state.building', this.state.building); + // console.log('this.state.floor', this.state.floor); + if ( + this.state.flag == null || + this.state.building == null || + this.state.floor == null + ) { + + ToastAndroid.show('请设置偏好~~(^v^)', 500); + } else { + navigation.navigate('RecommendView', { + list: this.state.buildsListsetting, + build: this.state.building, + floor: this.state.floor, + flag: this.state.flag, + }); + } + }}> + + 开始匹配 + + + + + + + + ); + } } + const styles = StyleSheet.create({ - container: { - flexDirection: 'column', - flex: 1, - backgroundColor: '#F6B972', - }, - box1: { - flexDirection: 'row', - flex: 1, - justifyContent: 'center', - // backgroundColor: 'black', - }, - box1image: { - height: deviceHeightDp / 25, - width: deviceWidthDp / 25, - resizeMode: 'contain', - }, - box1text: { - textAlign: 'center', - paddingTop: 5, - color: '#FFFFFF', - }, - box2: { - flex: 1, - }, - box3: { - flex: 1, - }, - box4: { - flexDirection: 'row', - flex: 1, - }, - box4image: { - width: null, - height: null, - flex: 1.2, - resizeMode: 'contain', - }, - text: { - fontSize: 22, - color: '#FFFFFF', - textAlignVertical: 'center', - flex: 1, - textAlign: 'right', - }, - box5: { - flex: 1, - alignItems: 'flex-end', - }, - box5image: { - width: null, - height: null, - flex: 1, - resizeMode: 'contain', - }, - box6: { - flex: 1, - }, + container: { + flexDirection: 'column', + flex: 1, + backgroundColor: '#F6B972', + }, + box1: { + flexDirection: 'row', + flex: 1, + justifyContent: 'center', + // backgroundColor: 'black', + }, + box1image: { + height: deviceHeightDp / 25, + width: deviceWidthDp / 25, + resizeMode: 'contain', + }, + box1text: { + textAlign: 'center', + paddingTop: 5, + color: '#FFFFFF', + }, + box2: { + flex: 1, + }, + box3: { + flex: 1, + }, + box4: { + flexDirection: 'row', + flex: 1, + }, + box4image: { + width: null, + height: null, + flex: 1.2, + resizeMode: 'contain', + }, + text: { + fontSize: 22, + color: '#FFFFFF', + textAlignVertical: 'center', + flex: 1, + textAlign: 'right', + }, + box5: { + flex: 1, + alignItems: 'flex-end', + }, + box5image: { + width: null, + height: null, + flex: 1, + resizeMode: 'contain', + }, + box6: { + flex: 1, + }, }); export default SettingView; diff --git a/package.json b/package.json index e6e6838f4333a63b5344b9dda38ed75083f8a492..7d77abb4303f0b0348279f8bdcf36a2ea2c7a699 100644 --- a/package.json +++ b/package.json @@ -13,18 +13,23 @@ "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "axios": "^0.26.1", + "moment": "^2.29.3", "prop-types": "^15.8.1", "react": "17.0.2", "react-native": "0.68.1", "react-native-action-button": "^2.8.5", + "react-native-amap3d": "^3.0.7", + "react-native-common-date-picker": "^2.3.7", + "react-native-drawer": "^2.5.1", "react-native-elements": "^3.4.2", "react-native-flexi-radio-button": "^0.2.2", + "react-native-image-crop-picker": "^0.37.3", "react-native-modal-dropdown": "^1.0.2", "react-native-safe-area-context": "^4.2.4", - "react-native-image-crop-picker": "^0.37.3", "react-native-screens": "^3.13.1", "react-native-splash-screen": "^3.3.0", "react-native-tab-navigator": "^0.3.4", + "react-native-table-component": "^1.2.2", "react-native-vector-icons": "^9.1.0", "react-navigation": "^4.4.4", "react-redux": "^8.0.1", diff --git a/page/Home/index.js b/page/Home/index.js index 3b7df8090a4f27a304334a3812ecd05184d0d711..c8623820d8f40c0a0009a1c3b960dfe363071ee2 100644 --- a/page/Home/index.js +++ b/page/Home/index.js @@ -11,6 +11,7 @@ class Home extends Component { } UNSAFE_componentWillMount() { + if (Platform.OS === 'android') { BackHandler.addEventListener('hardwareBackPress', this.onBackAndroid); } @@ -24,6 +25,7 @@ class Home extends Component { onBackAndroid = () => { + //禁用返回键 if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) { BackHandler.exitApp(); //直接退出APP diff --git a/yarn.lock b/yarn.lock index 490beb86a07af408ef3a3d5a8c9cbd6db7a92d2c..f61d45e94274004b36202551b990739221aea541 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4513,6 +4513,11 @@ jsonify@~0.0.0: array-includes "^3.1.4" 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: version "3.2.2" resolved "https://registry.npmmirror.com/kind-of/-/kind-of-3.2.2.tgz" @@ -5034,6 +5039,11 @@ mkdirp@^0.5.1: dependencies: 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: version "2.0.0" resolved "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz" @@ -5596,7 +5606,7 @@ prompts@^2.0.1, prompts@^2.4.0: kleur "^3.0.3" 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" resolved "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -5683,6 +5693,13 @@ react-native-action-button@^2.8.5: dependencies: 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: version "0.0.13" 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: jscodeshift "^0.13.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: version "3.4.2" 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: immutable "^3.8.1" 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: version "9.1.0" 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: resolved "https://registry.npmmirror.com/sudo-prompt/-/sudo-prompt-9.2.1.tgz" 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: version "5.5.0" resolved "https://registry.npmmirror.com/supports-color/-/supports-color-5.5.0.tgz" @@ -6804,6 +6846,11 @@ tsutils@^3.17.1: dependencies: 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: version "0.4.0" resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz"