diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a3cf888f48cbe9c9a539481a550625360835a35c..de2b84065d9ce802e674fe19bb73cf017f112fab 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" - android:windowSoftInputMode="adjustResize" + android:windowSoftInputMode="stateAlwaysHidden|adjustPan" android:exported="true"> diff --git a/component/Map/App.js b/component/Map/App.js deleted file mode 100644 index 06e6ef8cdb45f77fff052e38c97ae309228ee069..0000000000000000000000000000000000000000 --- a/component/Map/App.js +++ /dev/null @@ -1,31 +0,0 @@ -// In App.js in a new project - -import * as React from 'react'; -import {View, Text} from 'react-native'; -import {NavigationContainer} from '@react-navigation/native'; -import {createNativeStackNavigator} from '@react-navigation/native-stack'; - -function HomeScreen() { - return ( - - Home Screen12 - - // - // - // - ); -} - -const Stack = createNativeStackNavigator(); - -function App() { - return ( - - - - - - ); -} - -export default App; diff --git a/component/Map/ExampleOne.js b/component/Map/ExampleOne.js deleted file mode 100644 index 8f9e48770ac90ae575dbae4e1afaed533e601645..0000000000000000000000000000000000000000 --- a/component/Map/ExampleOne.js +++ /dev/null @@ -1,49 +0,0 @@ -import React, {Component} from 'react'; -import {Dimensions, Image, StyleSheet, View} from 'react-native'; -import {Table, Row, Rows} from 'react-native-table-component'; -const {width, height} = Dimensions.get('window'); -export default class ExampleOne extends Component { - constructor(props) { - super(props); - this.state = { - tableHead: ['教室', '空余位置', '容量', '教师类型'], - tableData: [ - ['1', '2', '3', '4'], - ['a', 'b', 'c', 'd'], - ['1', '2', '3', '456\n789'], - ['a', 'b', 'c', 'd'], - ], - }; - } - - render() { - const state = this.state; - return ( - - - - -
- -
- ); - } -} - -const styles = StyleSheet.create({ - container: {flex: 1, padding: 16, paddingTop: 30, backgroundColor: '#fff'}, - head: {height: 40, backgroundColor: '#f1f8ff'}, - text: {margin: 2, textAlign: 'center', fontWeight: '100'}, -}); diff --git a/component/Map/ExampleThree.js b/component/Map/ExampleThree.js deleted file mode 100644 index 486ec669f86acaca7cf3e4a5653b981b0ecdcf86..0000000000000000000000000000000000000000 --- a/component/Map/ExampleThree.js +++ /dev/null @@ -1,66 +0,0 @@ -import React, {Component} from 'react'; -import {StyleSheet, View, ScrollView} from 'react-native'; -import {Table, TableWrapper, Row} from 'react-native-table-component'; - -export default class ExampleThree extends Component { - constructor(props) { - super(props); - this.state = { - tableHead: ['教室', '空余位置', '容量', '教师类型'], - widthArr: [40, 60, 80, 100], - }; - } - - render() { - const state = this.state; - const tableData = []; - for (let i = 0; i < 30; i += 1) { - const rowData = []; - for (let j = 0; j < 9; j += 1) { - rowData.push(`${i}${j}`); - } - tableData.push(rowData); - } - - return ( - - - - - -
- - - {tableData.map((rowData, index) => ( - - ))} -
-
-
-
-
- ); - } -} - -const styles = StyleSheet.create({ - container: {flex: 1, padding: 16, paddingTop: 30, backgroundColor: '#fff'}, - header: {height: 50, backgroundColor: '#537791'}, - text: {textAlign: 'center', fontWeight: '100'}, - dataWrapper: {marginTop: -1}, - row: {height: 40, backgroundColor: '#E7E6E1'}, -}); diff --git a/component/Map/ExampleTwo.js b/component/Map/ExampleTwo.js deleted file mode 100644 index 971cfe22576c79becf31f0ea939e64f609da621e..0000000000000000000000000000000000000000 --- a/component/Map/ExampleTwo.js +++ /dev/null @@ -1,64 +0,0 @@ -import React, {Component} from 'react'; -import {StyleSheet, View} from 'react-native'; -import { - Table, - TableWrapper, - Row, - Rows, - Col, -} from 'react-native-table-component'; - -export default class ExampleTwo extends Component { - constructor(props) { - super(props); - this.state = { - tableHead: ['', 'Head1', 'Head2', 'Head3'], - tableTitle: ['Title', 'Title2', 'Title3', 'Title4'], - tableData: [ - ['1', '2', '3'], - ['a', 'b', 'c'], - ['1', '2', '3'], - ['a', 'b', 'c'], - ], - }; - } - - render() { - const state = this.state; - return ( - - - - - - - -
-
- ); - } -} - -const styles = StyleSheet.create({ - container: {flex: 1, padding: 16, paddingTop: 30, backgroundColor: '#fff'}, - head: {height: 40, backgroundColor: '#f1f8ff'}, - wrapper: {flexDirection: 'row'}, - title: {flex: 1, backgroundColor: '#f6f8fa'}, - row: {height: 28}, - text: {textAlign: 'center'}, -}); diff --git a/component/Map/Login/LoginView.js b/component/Map/Login/LoginView.js new file mode 100644 index 0000000000000000000000000000000000000000..eb1ad4395652459ea384ebe410feac5c70f5f989 --- /dev/null +++ b/component/Map/Login/LoginView.js @@ -0,0 +1,196 @@ +import React, {Component} from 'react'; +import { + StyleSheet, + Text, + View, + Dimensions, + TextInput, + Button, + Image, + TouchableOpacity, + ImageBackground, +} from 'react-native'; +import Icon from 'react-native-vector-icons/AntDesign'; + +/** + * 此组件为福大教务处登录验证界面 + * ReactNative 调用软键盘时将底部导航栏或者底部position样式顶飞 + * 解决办法 + * 根据路径 + * android/app/src/main/AndroidManifest.xml,修改android:windowSoftInputMode的属性值 + * 原内容 android:windowSoftInputMode="adjustResize" + * 修改后 android:windowSoftInputMode="stateAlwaysHidden|adjustPan"> + */ +const {width, height, scale} = Dimensions.get('window'); +class LoginView extends Component { + constructor(props) { + super(props); + this.state = { + username: null, + password: null, + verificationcode: null, + iconnum: true, + verify_url: 'https://jwcjwxt1.fzu.edu.cn/plus/verifycode.asp?n=', + }; + } + changeusername = text => { + this.setState({username: text}); + }; + changepassword = text => { + this.setState({password: text}); + }; + changeverificationcode = text => { + this.setState({verificationcode: text}); + }; + changeiconnum = () => { + this.setState({iconnum: !this.state.iconnum}); + }; + render() { + const {navigation} = this.props; + return ( + + + + 教务处登录 + + + + + + { + this.changeusername(text); + }} + /> + + + { + this.changepassword(text); + }} + /> + + + { + this.changeverificationcode(text); + }} + /> + { + this.setState({ + verify_url: + 'https://jwcjwxt1.fzu.edu.cn/plus/verifycode.asp?n=' + + Math.random(), + }); + }}> + + + + { + navigation.navigate('SchoolMapHome'); + }}> + 登录 + + + + {this.state.iconnum ? ( + + ) : ( + + )} + + 阅读并同意用户协议和隐私政策 + + + + + ); + } +} + +const styles = StyleSheet.create({ + container: { + alignItems: 'center', + flex: 1, + flexDirection: 'column', + backgroundColor: '#dddddd', + }, + iconStyle: { + width: 80, + height: 80, + marginTop: 50, + marginBottom: 30, + borderRadius: 40, + borderWidth: 2, + borderColor: 'white', + }, + textInputStyle: { + width: width - width / 2, + backgroundColor: '#F6ECE1', + marginBottom: 1, + paddingLeft: 10, + textAlign: 'left', + borderBottomWidth: 1, + borderBottomColor: '#797979', + }, + textInputStyle2: { + height: 38, + width: width - width / 2 - width * 0.2, + backgroundColor: '#F6ECE1', + marginBottom: 1, + paddingLeft: 10, + textAlign: 'left', + }, +}); +export default LoginView; diff --git a/component/Map/Navigation/Mapstack.js b/component/Map/Navigation/Mapstack.js new file mode 100644 index 0000000000000000000000000000000000000000..f2e6b55c40fbb4b5d019fc50971ba739d031be44 --- /dev/null +++ b/component/Map/Navigation/Mapstack.js @@ -0,0 +1,47 @@ +import React from 'react'; +import {createNativeStackNavigator} from '@react-navigation/native-stack'; +import LoginView from '../Login/LoginView'; +import SchoolMapHome from '../SchoolMap/SchoolMapHome'; +import RecommendView from '../Top/RecommendView'; +import SettingView from '../Top/SettingView'; + +/** + * 此组件用于设置导航 + */ +const Stack = createNativeStackNavigator(); + +function Mapstack() { + return ( + + + + + + + ); +} +export default Mapstack; diff --git a/component/Map/RadioModalItem.js b/component/Map/RadioModalItem.js deleted file mode 100644 index 78639b14ee8a3da430541f84a5dcacaba9f1d83b..0000000000000000000000000000000000000000 --- a/component/Map/RadioModalItem.js +++ /dev/null @@ -1,124 +0,0 @@ -//没啥用,留着纪念 -import React, {Component} from 'react'; -import { - View, - StyleSheet, - Navigator, - TouchableHighlight, - Text, - ScrollView, - Image, - ListView, -} from 'react-native'; -var Dimensions = require('Dimensions'); -var width = Dimensions.get('window').width; -var height = Dimensions.get('window').height; -import RadioModal from 'react-native-radio-master'; -var datas = [ - { - selecteId: 13, - content: 'Apple', - selected: false, - }, - { - selecteId: 14, - content: 'Banana', - selected: false, - }, - { - selecteId: 15, - content: 'Orange', - selected: false, - }, - { - selecteId: 16, - content: 'Watermelon', - selected: true, - }, - { - selecteId: 17, - content: 'Grape', - selected: false, - }, -]; - -export default class RadioModalItem extends Component { - constructor(props) { - super(props); - this.state = { - language: datas[3].selecteId, - item: datas[3].content, - initItem: '选项a', - initId: '0', - }; - } - render() { - return ( - - - The selected:{this.state.item} - - - Unique identification: - {this.state.language} - - - this.setState({language: id, item: item}) - } - seledImg={require('./imgs/selected.png')} - selImg={require('./imgs/select.png')} - selnoneImg={require('./imgs/selectnone.png')} - dataOption={datas} - style={{ - flexDirection: 'row', - flexWrap: 'wrap', - alignItems: 'flex-start', - flex: 1, - backgroundColor: '#ffffff', - padding: 5, - marginTop: 10, - }} - /> - - The selected: - {this.state.initItem} - - - Unique identification: - {this.state.initId} - - - this.setState({initId: id, initItem: item}) - } - style={{ - flexDirection: 'row', - flexWrap: 'wrap', - alignItems: 'flex-start', - flex: 1, - backgroundColor: '#ffffff', - padding: 5, - marginTop: 10, - }}> - 选项a - - 选项b - - 选项c - 选项d - - - ); - } -} diff --git a/component/Map/ControlPanel.js b/component/Map/RightSidebar/ControlPanel.js similarity index 55% rename from component/Map/ControlPanel.js rename to component/Map/RightSidebar/ControlPanel.js index 9b85a37842de00f7803f88c2dded336df9788d58..ee8916762fea410fe949abae52a9efe4f25fc6cf 100644 --- a/component/Map/ControlPanel.js +++ b/component/Map/RightSidebar/ControlPanel.js @@ -2,46 +2,35 @@ import React, {Component} from 'react'; import { Dimensions, - Image, - ScrollView, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; -import ExampleOne from './ExampleOne'; +import EmptyClassroomForm from './EmptyClassroomForm'; import Icon from 'react-native-vector-icons/AntDesign'; +/** + * 此组件为侧边栏的主容器 + */ + const {width, height} = Dimensions.get('window'); -import ExampleTwo from './ExampleTwo'; -import ExampleThree from './ExampleThree'; export default class ControlPanel extends Component { render() { const state = this.state; let {closeDrawer} = this.props; return ( - // - // - // Control Panel - // - // Close Drawer - // - // - // - - {this.props.buildingnum} + + {/*{this.props.buildingnum}*/} - + - - - + ); } } - const styles = StyleSheet.create({ container: { flex: 1, diff --git a/component/Map/RightSidebar/EmptyClassroomForm.js b/component/Map/RightSidebar/EmptyClassroomForm.js new file mode 100644 index 0000000000000000000000000000000000000000..4fd96757fead957d5fe91837c8bcd6c6074ff20c --- /dev/null +++ b/component/Map/RightSidebar/EmptyClassroomForm.js @@ -0,0 +1,73 @@ +import React, {Component} from 'react'; +import {Dimensions, Image, ScrollView, StyleSheet, View} from 'react-native'; +import {Table, Row, Rows} from 'react-native-table-component'; +const {width, height} = Dimensions.get('window'); +/** + * 此组件显示右边侧边栏显示的内容包括教室表格和教室图片 + */ + +export default class EmptyClassroomForm extends Component { + constructor(props) { + super(props); + this.state = { + tableHead: ['教室', '空余位置', '容量', '教室类型'], + tableData: [ + ['1', '2', '3', '4'], + ['a', 'b', 'c', 'd'], + ['1', '2', '3', '456\n789'], + ['a', 'b', 'c', 'd'], + ], + }; + } + + render() { + const state = this.state; + return ( + + + + + +
+ + + +
+
+ ); + } +} + +const styles = StyleSheet.create({ + container: {flex: 1, padding: 16, paddingTop: 15, backgroundColor: '#F6B972'}, + head: {height: 40, backgroundColor: '#F6B972'}, + text: {margin: 2, textAlign: 'center', fontWeight: '100', color: 'white'}, +}); diff --git a/component/Map/SchoolMap.js b/component/Map/SchoolMap/SchoolMap.js similarity index 96% rename from component/Map/SchoolMap.js rename to component/Map/SchoolMap/SchoolMap.js index 3514fd5a3bc708ed96c4fd1a88840c50f79fcad9..5526a4d903e2f44c68589b63472373a269368ea6 100644 --- a/component/Map/SchoolMap.js +++ b/component/Map/SchoolMap/SchoolMap.js @@ -1,10 +1,12 @@ import {Component} from 'react'; -import {Text, View} from 'react-native'; +import {View} from 'react-native'; import {MapView, Marker} from 'react-native-amap3d'; import React from 'react'; - import Icon from 'react-native-vector-icons/FontAwesome5'; -import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'; + +/** + * 此组件为福大旗山校区地图组件 + */ class SchoolMap extends Component { constructor(props) { super(props); @@ -27,8 +29,7 @@ class SchoolMap extends Component { }} onPress={({nativeEvent}) => console.log(nativeEvent)}> {/*主内容区*/} -