提交 62ce44ac 编写于 作者: ItbGcthate's avatar ItbGcthate

304_merge

......@@ -4,6 +4,7 @@ import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
......
rootProject.name = 'FZUStudyRoom'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
......
import axios from 'axios';
// 全局设置 axios 发送请求带上cookie
axios.defaults.withCredentials = true;
/**
* 登录福大教务处接口
*/
function login(data) {
let logincheck_url = 'https://jwcjwxt1.fzu.edu.cn/logincheck.asp';
let logincheck_header = {
Referer: 'https://jwch.fzu.edu.cn/html/login/1.html',
Origin: 'https://jwch.fzu.edu.cn',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': '49',
Connection: 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/4.9.0',
};
axios.post(logincheck_url, data, {headers: logincheck_header}).then(res => {
console.log('get response:', res);
alert(JSON.stringify(res));
});
}
export {login};
import React, {Component} from 'react';
import {View, StyleSheet, Dimensions, Text, Image} from 'react-native';
import ActionButton from 'react-native-action-button';
import {Icon} from 'react-native-vector-icons/Icon';
class HoverButton extends Component {
constructor() {
super();
}
render() {
return (
<ActionButton
size={70}
renderIcon={() => (
<Image
style={styles.image}
source={require('../../images/Data/菜单.png')}
/>
)}
onLongPress={() => {
this.props.changeSelectedTab('个人信息');
console.log('个人信息');
}}
hideShadow={true}
buttonColor="rgba(255,255,255,0)"
position="right"
verticalOrientation="up">
<ActionButton.Item
buttonColor="rgba(255,255,255,0)"
// title="排行榜"
onPress={() => {
this.props.changeSelectedTab('排行榜');
console.log('排行榜');
}}>
<Image
style={styles.image}
source={require('../../images/Data/排行榜.png')}
/>
<Text style={styles.actionButtonText}>排行榜</Text>
</ActionButton.Item>
<ActionButton.Item
buttonColor="rgba(255,255,255,0)"
// title="我的成就"
onPress={() => {
this.props.changeSelectedTab('我的成就');
console.log('我的成就');
}}>
<Image
style={styles.image}
source={require('../../images/Data/成就.png')}
/>
<Text style={styles.actionButtonText}>我的成就</Text>
</ActionButton.Item>
<ActionButton.Item
buttonColor="rgba(255,255,255,0)"
// title="数据分析"
onPress={() => {
this.props.changeSelectedTab('数据分析');
console.log('数据分析');
}}>
<Image
style={styles.image}
source={require('../../images/Data/数据分析.png')}
/>
<Text style={styles.actionButtonText}>数据分析</Text>
</ActionButton.Item>
<ActionButton.Item
buttonColor="rgba(255,255,255,0)"
// title="自习概览"
onPress={() => {
this.props.changeSelectedTab('自习概览');
console.log('自习概览');
}}>
<Image
style={styles.image}
source={require('../../images/Data/自习概览.png')}
/>
<Text style={styles.actionButtonText}>自习概览</Text>
</ActionButton.Item>
</ActionButton>
);
}
}
const styles = StyleSheet.create({
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
image: {
height: 45,
width: 45,
},
actionButtonView: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
actionButtonIcon: {
fontSize: 20,
height: 22,
color: 'white',
},
actionButtonText: {
fontSize: 14,
color: '#9f5022',
},
});
export default HoverButton;
......@@ -17,7 +17,6 @@ class Map extends Component {
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
//opacity: 0.5,
flex: 1,
},
text: {
......
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
class Achievement extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View
style={{
display: this.props.show ? 'flex' : 'none',
backgroundColor: '#F2E2CE',
flex: 1,
}}>
<Text style={styles.text}>成就模块</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
});
export default Achievement;
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
class Analysis extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View
style={{
display: this.props.show ? 'flex' : 'none',
backgroundColor: '#F2E2CE',
flex: 1,
}}>
<Text style={styles.text}>数据分析模块</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
});
export default Analysis;
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
class Outline extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View
style={{
display: this.props.show ? 'flex' : 'none',
backgroundColor: '#F2E2CE',
flex: 1,
}}>
<Text style={styles.text}>自习概览模块</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
});
export default Outline;
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
class Rank extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View
style={{
display: this.props.show ? 'flex' : 'none',
backgroundColor: '#F2E2CE',
flex: 1,
}}>
<Text style={styles.text}>排行榜模块</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
});
export default Rank;
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
import {View, Text, StyleSheet, Image} from 'react-native';
import HoverButton from '../HoverButton';
import Person from './person';
import Achievement from './Data/Achievement';
import Analysis from './Data/Analysis';
import Outline from './Data/Outline';
import Rank from './Data/Rank';
class Mine extends Component {
constructor() {
super();
constructor(props) {
super(props);
this.state = {
showPerson: true,
showAchievement: false,
showOutline: false,
showAnalysis: false,
showRank: false,
};
this.changeSelectedTab = this.changeSelectedTab.bind(this);
}
changeSelectedTab(selectedTab) {
if (this.state.showPerson === true) {
this.setState({
showPerson: false,
});
}
if (this.state.showAchievement === true) {
this.setState({
showAchievement: false,
});
}
if (this.state.showOutline === true) {
this.setState({
showOutline: false,
});
}
if (this.state.showAnalysis === true) {
this.setState({
showAnalysis: false,
});
}
if (this.state.showRank === true) {
this.setState({
showRank: false,
});
}
switch (selectedTab) {
case '排行榜':
this.setState({
showRank: true,
});
break;
case '我的成就':
this.setState({
showAchievement: true,
});
break;
case '数据分析':
this.setState({
showAnalysis: true,
});
break;
case '自习概览':
this.setState({
showOutline: true,
});
break;
case '个人信息':
this.setState({
showPerson: true,
});
break;
}
this.setState({
selectedTab: selectedTab,
});
}
render() {
return (
<View style={styles.container}>
<Text style={styles.text}>Mine个人主页模块</Text>
<Person show={this.state.showPerson} />
<Achievement show={this.state.showAchievement} />
<Outline show={this.state.showOutline} />
<Analysis show={this.state.showAnalysis} />
<Rank show={this.state.showRank} />
<HoverButton changeSelectedTab={this.changeSelectedTab} />
</View>
);
}
......@@ -17,7 +97,6 @@ class Mine extends Component {
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
//opacity: 0.5,
flex: 1,
},
text: {
......
import React, {Component} from 'react';
import {View, Text, StyleSheet} from 'react-native';
class person extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View
style={{
display: this.props.show ? 'flex' : 'none',
backgroundColor: '#F2E2CE',
flex: 1,
}}>
<Text style={styles.text}>个人信息模块</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#ffa3a3',
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
});
export default person;
......@@ -14,10 +14,10 @@ class Navigation extends Component {
return (
<TabNavigator
tabBarStyle={{
backgroundColor: '#CE9561',
height: 'auto',
color: 'red',
paddingBottom: 15,
borderStyle: 'solid',
backgroundColor: '#CE9561',
paddingBottom: 0,
}}>
<TabNavigator.Item
selected={this.state.selectedTab === '地图'}
......@@ -88,12 +88,13 @@ class Navigation extends Component {
this.setState({selectedTab: ''});
this.props.changeName('');
}}>
<Mine />
<Mine changeName={this.props.changeName} />
</TabNavigator.Item>
</TabNavigator>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
......@@ -101,7 +102,7 @@ const styles = StyleSheet.create({
flex: 1,
},
icon: {
height: 40,
height: 30,
width: 40,
},
tabText: {
......
......@@ -31,7 +31,6 @@ class Study extends Component {
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
//opacity: 0.5,
flex: 1,
},
text: {
......
......@@ -12,7 +12,11 @@ import App from './page/App';
//tabBarStyle: TabBar.propTypes.style,这句进入控件注释掉就没有下面这句报错
//Warning: Failed prop type: TabNavigator: prop type `tabBarStyle` is invalid; it must be a function
LogBox.ignoreLogs([
'Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`',
'ViewPropTypes will be removed from React Native',
'Warning: componentWillReceiveProps has been renamed',
'Warning: Failed prop type: Invalid prop `name` of value `ios-done-all-outline` supplied to `Icon`',
'Warning: Failed prop type: TabNavigator: prop type `tabBarStyle` is invalid;',
'ViewPropTypes will be removed from React Native.',
]);
......
......@@ -30,6 +30,22 @@
9FCFB9ECE9754F7A8960A2A6 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 38EDB81619ED4459B675FA8F /* Octicons.ttf */; };
D2035C817D1B480EAE27C1FF /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 2B3C634860304F31B81496CF /* SimpleLineIcons.ttf */; };
494E7E23813E4574A6160D0E /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 039184A4E86E42778C904917 /* Zocial.ttf */; };
1F81846709A540FDA82D1F09 /* AntDesign.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5DE44C6374DB449896A96A91 /* AntDesign.ttf */; };
351805693657406E9B9A404E /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EC2D7CB24AE049CC8212BA91 /* Entypo.ttf */; };
FE31339BF5C446579A90A55E /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8119E14C5E764E43B7B849C6 /* EvilIcons.ttf */; };
9D6B88FE95B64EE7A7CB5C13 /* Feather.ttf in Resources */ = {isa = PBXBuildFile; fileRef = ADF4FCEC6DE14F5CA21DD38C /* Feather.ttf */; };
588F77AFB90549FFA9CBC978 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6DD8B3DAEEE14DB28277522B /* FontAwesome.ttf */; };
99FB780441E140E9B4046034 /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 37FE6248E18F4F15A61B27E1 /* FontAwesome5_Brands.ttf */; };
C791AD0B4533401CAF81EAA5 /* FontAwesome5_Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 717A529D0CDB49029B7C9389 /* FontAwesome5_Regular.ttf */; };
536B85871FFA46F3B641D907 /* FontAwesome5_Solid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CBE09DF7798246F499FF1941 /* FontAwesome5_Solid.ttf */; };
CC302C40EBB5428DACF8A37E /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F403CDE893004D0C86BD9676 /* Fontisto.ttf */; };
C306EE430EB34209AA6F4598 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EE02B88FC4D74C66934F88D6 /* Foundation.ttf */; };
91089E5223B44FA4BC40144F /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 720650C64888494EA8557263 /* Ionicons.ttf */; };
BE3341CFC56A49A78F9AFCFB /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A1218C6080B24F03943A774C /* MaterialCommunityIcons.ttf */; };
76A33D2886744291B015356B /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4B4F880DEBA34215A9C8B8C5 /* MaterialIcons.ttf */; };
BF3CC4D9A0B04DE0AE8B918C /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 40750DA77B054D5BB6C85729 /* Octicons.ttf */; };
389668C6CFC24A35BD1D6CBE /* SimpleLineIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 21A573BC58DE46E097227DBE /* SimpleLineIcons.ttf */; };
DB20BB2130254DEAA3154437 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FE47793CC1834DE49BBE2125 /* Zocial.ttf */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -76,6 +92,22 @@
38EDB81619ED4459B675FA8F /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/_react-native-vector-icons@9.1.0@react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
2B3C634860304F31B81496CF /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../node_modules/_react-native-vector-icons@9.1.0@react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
039184A4E86E42778C904917 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/_react-native-vector-icons@9.1.0@react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
5DE44C6374DB449896A96A91 /* AntDesign.ttf */ = {isa = PBXFileReference; name = "AntDesign.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
EC2D7CB24AE049CC8212BA91 /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
8119E14C5E764E43B7B849C6 /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
ADF4FCEC6DE14F5CA21DD38C /* Feather.ttf */ = {isa = PBXFileReference; name = "Feather.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
6DD8B3DAEEE14DB28277522B /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
37FE6248E18F4F15A61B27E1 /* FontAwesome5_Brands.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Brands.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
717A529D0CDB49029B7C9389 /* FontAwesome5_Regular.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Regular.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
CBE09DF7798246F499FF1941 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; name = "FontAwesome5_Solid.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
F403CDE893004D0C86BD9676 /* Fontisto.ttf */ = {isa = PBXFileReference; name = "Fontisto.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
EE02B88FC4D74C66934F88D6 /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
720650C64888494EA8557263 /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
A1218C6080B24F03943A774C /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; name = "MaterialCommunityIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
4B4F880DEBA34215A9C8B8C5 /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
40750DA77B054D5BB6C85729 /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
21A573BC58DE46E097227DBE /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; name = "SimpleLineIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
FE47793CC1834DE49BBE2125 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -200,6 +232,22 @@
38EDB81619ED4459B675FA8F /* Octicons.ttf */,
2B3C634860304F31B81496CF /* SimpleLineIcons.ttf */,
039184A4E86E42778C904917 /* Zocial.ttf */,
5DE44C6374DB449896A96A91 /* AntDesign.ttf */,
EC2D7CB24AE049CC8212BA91 /* Entypo.ttf */,
8119E14C5E764E43B7B849C6 /* EvilIcons.ttf */,
ADF4FCEC6DE14F5CA21DD38C /* Feather.ttf */,
6DD8B3DAEEE14DB28277522B /* FontAwesome.ttf */,
37FE6248E18F4F15A61B27E1 /* FontAwesome5_Brands.ttf */,
717A529D0CDB49029B7C9389 /* FontAwesome5_Regular.ttf */,
CBE09DF7798246F499FF1941 /* FontAwesome5_Solid.ttf */,
F403CDE893004D0C86BD9676 /* Fontisto.ttf */,
EE02B88FC4D74C66934F88D6 /* Foundation.ttf */,
720650C64888494EA8557263 /* Ionicons.ttf */,
A1218C6080B24F03943A774C /* MaterialCommunityIcons.ttf */,
4B4F880DEBA34215A9C8B8C5 /* MaterialIcons.ttf */,
40750DA77B054D5BB6C85729 /* Octicons.ttf */,
21A573BC58DE46E097227DBE /* SimpleLineIcons.ttf */,
FE47793CC1834DE49BBE2125 /* Zocial.ttf */,
);
name = Resources;
sourceTree = "<group>";
......@@ -317,6 +365,22 @@
9FCFB9ECE9754F7A8960A2A6 /* Octicons.ttf in Resources */,
D2035C817D1B480EAE27C1FF /* SimpleLineIcons.ttf in Resources */,
494E7E23813E4574A6160D0E /* Zocial.ttf in Resources */,
1F81846709A540FDA82D1F09 /* AntDesign.ttf in Resources */,
351805693657406E9B9A404E /* Entypo.ttf in Resources */,
FE31339BF5C446579A90A55E /* EvilIcons.ttf in Resources */,
9D6B88FE95B64EE7A7CB5C13 /* Feather.ttf in Resources */,
588F77AFB90549FFA9CBC978 /* FontAwesome.ttf in Resources */,
99FB780441E140E9B4046034 /* FontAwesome5_Brands.ttf in Resources */,
C791AD0B4533401CAF81EAA5 /* FontAwesome5_Regular.ttf in Resources */,
536B85871FFA46F3B641D907 /* FontAwesome5_Solid.ttf in Resources */,
CC302C40EBB5428DACF8A37E /* Fontisto.ttf in Resources */,
C306EE430EB34209AA6F4598 /* Foundation.ttf in Resources */,
91089E5223B44FA4BC40144F /* Ionicons.ttf in Resources */,
BE3341CFC56A49A78F9AFCFB /* MaterialCommunityIcons.ttf in Resources */,
76A33D2886744291B015356B /* MaterialIcons.ttf in Resources */,
BF3CC4D9A0B04DE0AE8B918C /* Octicons.ttf in Resources */,
389668C6CFC24A35BD1D6CBE /* SimpleLineIcons.ttf in Resources */,
DB20BB2130254DEAA3154437 /* Zocial.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -19,6 +19,8 @@ target 'FZUStudyRoom' do
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'FZUStudyRoomTests' do
inherit! :complete
# Pods for testing
......
......@@ -4,7 +4,8 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack';
import Home from './Home/index';
import Login from './Login';
import OnlineStudy from '../component/OnlineStudy';
import Stop from './StopTestPage';
import HoverButton from '../component/HoverButton';
//入口
const App: () => Node = () => {
const Stack = createNativeStackNavigator();
......
......@@ -12,17 +12,17 @@ class Home extends Component {
}
//测试一下请求能否正常使用,后期删除就行
componentDidMount() {
getTest().then(
res => {
console.log('get response:', res);
alert(JSON.stringify(res));
},
error => {
console.log('get response failed!');
},
);
}
// componentDidMount() {
// getTest().then(
// res => {
// console.log('get response:', res);
// alert(JSON.stringify(res));
// },
// error => {
// console.log('get response failed!');
// },
// );
// }
changeName(name) {
this.setState({
......@@ -42,7 +42,6 @@ class Home extends Component {
const styles = StyleSheet.create({
container: {
backgroundColor: '#F2E2CE',
//opacity: 0.5,
flex: 1,
},
text: {
......
import React, {Component} from 'react';
import {
View,
BackHandler,
StyleSheet,
Dimensions,
TouchableOpacity,
Text,
ToastAndroid,
Platform,
} from 'react-native';
const {width, height} = Dimensions.get('window');
class Stop extends Component {
constructor() {
super();
this.onBackAndroid = this.onBackAndroid.bind(this);
}
UNSAFE_componentWillMount() {
if (Platform.OS === 'android') {
BackHandler.addEventListener('hardwareBackPress', this.onBackAndroid);
}
}
componentWillUnmount() {
if (Platform.OS === 'android') {
BackHandler.removeEventListener('hardwareBackPress', this.onBackAndroid);
}
}
onBackAndroid = () => {
//禁用返回键
// if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) {
// BackHandler.exitApp(); //直接退出APP
// } else {
// this.lastBackPressed = Date.now();
// ToastAndroid.show('再按一次退出应用', 1000); //提示
// return true;
// }
ToastAndroid.show('您在禅定模式,无法退出', 1000); //提示
return true;
};
render() {
return (
<View style={styles.container}>
{/*<TouchableOpacity onPress={() => this.onPress()} >*/}
{/* <Text style={styles.text}>单击按钮</Text>*/}
{/*</TouchableOpacity>*/}
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#F4CB8C',
opacity: 0.5,
flex: 1,
},
text: {
fontSize: 50,
fontWeight: 'bold',
textAlign: 'center',
},
buttonStyle: {
backgroundColor: '#BF7636',
borderRadius: 3,
},
button_containerStyle: {
width: parseInt(width) / 2,
marginHorizontal: parseInt(width) / 4,
marginVertical: parseInt(width) / 4,
},
});
export default Stop;
import {AsyncStorage} from 'react-native';
/**
* AsyncStorage异步、持久化的key-value存储系统
*/
class StorageUtils {
/**
* 根据key获取json数据
*/
static get(key) {
return AsyncStorage.getItem(key)
.then(value => {
if (value && value !== '') {
const jsonValue = JSON.parse(value);
return jsonValue;
}
return null;
})
.catch(() => null);
}
/**
* 保存key对应的json数值
* @param key
* @param value
*/
static save(key, value) {
return AsyncStorage.setItem(key, JSON.stringify(value));
}
/**
* 更新key对应的json数值
* @param key
* @param value
* @returns {*}
*/
static update(key, value) {
return AsyncStorage.get(key).then(item => {
value =
typeof value === 'string' ? value : Object.assign({}, item, value);
return AsyncStorage.setItem(key, JSON.stringify(value));
});
}
/**
* 删除key对应的json数值
* @param key
* @returns {SVGLength | void | string | SVGTransform | SVGPathSeg | SVGNumber | DOMPoint}
*/
static deleteItem(key) {
return AsyncStorage.removeItem(key);
}
/**
* 清空所有数据
*/
static clear() {
return AsyncStorage.clear();
}
}
export default StorageUtils;
......@@ -3,9 +3,11 @@
*/
import axios from 'axios';
// 全局设置 axios 发送请求带上cookie
axios.defaults.withCredentials = true;
axios.defaults.timeout = 3000;
//测试,后期修改
axios.defaults.baseURL = 'http://124.221.180.13:8080/exercise/';
// axios.defaults.baseURL = 'http://124.221.180.13:8080/exercise/';
/**
* http request 拦截器
......
......@@ -5644,7 +5644,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.7.2:
prop-types@*, prop-types@^15.5.10, 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"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
......@@ -5653,15 +5653,6 @@ prop-types@*, prop-types@^15.5.10, prop-types@^15.7.2:
object-assign "^4.1.1"
react-is "^16.13.1"
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==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.13.1"
psl@^1.1.33:
version "1.8.0"
resolved "https://registry.npmmirror.com/psl/-/psl-1.8.0.tgz"
......@@ -5718,6 +5709,13 @@ react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0:
resolved "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
react-native-action-button@^2.8.5:
version "2.8.5"
resolved "https://registry.npmmirror.com/react-native-action-button/-/react-native-action-button-2.8.5.tgz#4152a50323a8a6b3468e6f161f9a9071f2f0739a"
integrity sha512-BvGZpzuGeuFR2Y6j93+vKiSqDhsF87VHvNXFs/qEYKfzT4b1ASAT/GQbgS6gNt4jRJCUnJWYrIwlBzRjesZQmQ==
dependencies:
prop-types "^15.5.10"
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"
......@@ -5809,7 +5807,7 @@ react-native-tab-navigator@^0.3.4:
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"
resolved "https://registry.npmmirror.com/react-native-vector-icons/-/react-native-vector-icons-9.1.0.tgz#52eaa205f5954d567b7048eb93d58ac854a2c59e"
integrity sha512-2AHZ/h9d/+rC0odz+OwbGNlc1Lik/pHhSixn4HfC8RtQ8CxfSBZ6gg7bTLcZhdSvZN+ZEGi30Fj+ZnOSQy+smg==
dependencies:
prop-types "^15.7.2"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册