Skip to content

Commit

Permalink
班级页面和所有班级页面框架完成
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoling1997 committed Oct 30, 2017
1 parent 98c144a commit dc1f157
Show file tree
Hide file tree
Showing 13 changed files with 524 additions and 19 deletions.
3 changes: 1 addition & 2 deletions CnBlogAndroid/App.js
Expand Up @@ -202,12 +202,11 @@ const SimpleNavigation = StackNavigator({
HomeworkLists: {
screen: HomeworkLists,
navigationOptions: {
header: null,/*
headerTitle: '作业列表',
headerStyle: {
height: 40,
backgroundColor: 'rgb(51,204,255)',
}*/
}
},
},
HomeworkDetail: {
Expand Down
Binary file added CnBlogAndroid/Source/images/calender.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/edit.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/heart.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/message.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/people.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/ring.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CnBlogAndroid/Source/images/setting.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
250 changes: 241 additions & 9 deletions CnBlogAndroid/Source/screens/ClassHome.js
Expand Up @@ -2,6 +2,8 @@ import Config from '../config';
import api from '../api/api.js';
import {authData} from '../config'
import * as Service from '../request/request.js'
import MyAdapter from './MyAdapter.js';
import HeaderNoBackComponent from './HeaderNoBackComponent.js';
import React, { Component} from 'react';
import {
Platform,
Expand All @@ -20,19 +22,249 @@ import {
import {
StackNavigator,
} from 'react-navigation';
const screenWidth= MyAdapter.screenWidth;
const screenHeight= MyAdapter.screenHeight;
const titleFontSize= MyAdapter.titleFontSize;
const abstractFontSize= MyAdapter.abstractFontSize;
const informationFontSize= MyAdapter.informationFontSize;
const btnFontSize= MyAdapter.btnFontSize;
// 此页面应该传入classId作为属性
// 现在暂时Id为238(BUAA软工的ID)
export default class ClassHome extends Component{
render(){
let classId = 238;//this.props.classId
return(
<View style = {styles.container}>
<Text>假装是班级博客</Text>
{/*将classId传入作业界面*/}
<Button title = '进入班级作业列表' onPress = {()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}/>
_onPress(){

}
render() {
let classId = 238;//this.props.classId
return (
<View
style= {{
flexDirection: 'column',
flex: 1,
backgroundColor: 'white'
}}
>
<View style= {{
flexDirection: 'row',
justifyContent:'center',
alignItems: 'center',
marginTop:0.05*screenHeight,
}}
>
<Image
style= {{
width: 0.3*screenHeight,
height: 0.3*screenHeight
}}
source={{uri: 'https://i.loli.net/2017/10/30/59f7235c222ae.png'}}
/>
</View>
<View style= {{
flexDirection: 'row',
justifyContent:'center',
alignItems: 'center',
marginTop:0.04*screenHeight,
}}
>
<Text style= {{
alignSelf:'center',
fontSize: btnFontSize,
color: '#00bfff',
textAlign: 'center',
}}
>
School
</Text>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
marginLeft: 0.07*screenWidth,
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={this._onPress}//关联函数
>
<Image
style= {{
width: 0.0625*screenHeight,
height: 0.0625*screenHeight
}}
source={require('../images/heart.png')}
/>
</TouchableHighlight>
</View>
<View style= {{
flexDirection: 'row',
justifyContent:'space-between',
alignItems: 'center',
marginTop:0.083*screenHeight,
marginHorizontal:0.084*screenWidth,
}}
>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/home.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/people.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/edit.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/save.png')}
/>
</TouchableHighlight>

</View>
)
}
<View style= {{
flexDirection: 'row',
justifyContent:'space-between',
alignItems: 'center',
marginTop:0.03*screenHeight,
marginHorizontal:0.084*screenWidth,
}}
>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/message.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/calender.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/ring.png')}
/>
</TouchableHighlight>
<TouchableHighlight
underlayColor="transparent"
activeOpacity={0.5}
style= {{
alignSelf:'flex-start',
backgroundColor:"transparent",
}}
onPress={()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}//关联函数
>
<Image
style= {{
width: 0.1*screenHeight,
height: 0.1*screenHeight
}}
source={require('../images/setting.png')}
/>
</TouchableHighlight>

</View>

</View>
);
}

// render(){
// let classId = 238;//this.props.classId
// return(
// <View style = {styles.container}>
// <Text>假装是班级博客</Text>
// {/*将classId传入作业界面*/}
// <Button title = '进入班级作业列表' onPress = {()=>this.props.navigation.navigate('HomeworkLists',{classId:classId})}/>
// </View>
// )
// }
}

const styles = StyleSheet.create({
Expand Down

0 comments on commit dc1f157

Please sign in to comment.