123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- /**
- * Created by zack on 2018/5/2.
- */
- import {
- View,
- Text,
- StyleSheet,
- Image,
- TouchableOpacity,
- FlatList
- } from 'react-native'
- import React, {Component} from 'react'
- import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../utils/DimensionsTools'
- import FollowingItem from './View/FollowingItem'
- import HttpTools from '../../../network/HttpTools'
- import {auth, question, comment} from '../../../network/API'
-
- export default class FollowPageView extends Component {
- constructor(props) {
- super(props)
- this.state = {
- dataSources: ['a'],
- }
- }
-
- componentDidMount() {
- // const param = {
- // page: 1,
- // limit: 10,
- // }
- // HttpTools.get('my/focus', param, (response) => {
- // console.log(response)
- // }, (error) => {
- // console.log(error)
- // })
- }
-
- renderItem(item) {
- return(
- <FollowingItem />
- )
- }
-
- render() {
- if (this.state.dataSources.length) {
- return(
- <View style={styles.View}>
- <View style={styles.ListView}>
- <FlatList
- data = {['a', 'b', 'c']}
- renderItem={({item}) => this.renderItem(item)}
- keyExtractor = {(item,index) =>{
- return 'key' + item.key + index
- }}
- ListFooterComponent = {() => {
- return(
- <View style={{width: ScreenDimensions.width, height: 44, backgroundColor: 'white'}} />
- )
- }}
- />
- </View>
- </View>
- )
- }else {
- return(
- <View style={styles.View}>
- <Image source={require('../../../resources/images/TabBar/Community/Follow/img.png')} style={styles.BlankImageView}/>
-
- <Text style={styles.TitleText}>{'关注的人更新动态会出现在这里'}</Text>
- <TouchableOpacity onPress={() => {
- this.props.didClickFollowButton()
- }} style={styles.FollowButton}>
- <Text style={styles.FollowButtonText}>{"关注感兴趣的人"}</Text>
- </TouchableOpacity>
- </View>
- )
- }
- }
- }
-
- const styles = StyleSheet.create({
- View: {
- width: ScreenDimensions.width,
- height: ScreenDimensions.height,
- backgroundColor: '#ffffff',
- alignItems: 'center',
- },
- ListView: {
- width: ScreenDimensions.width,
- height: ScreenDimensions.height - NavigationBarHeight.height - TabBarHeight.height,
- },
- BlankImageView: {
- marginTop: NavigationBarHeight.height + 80,
- width: 175,
- height: 143,
- },
- TitleText: {
- fontSize: 17,
- color: '#05120b',
- marginTop: 45,
-
- },
- FollowButton: {
- marginTop: 25,
- width: 230,
- height: 46,
- backgroundColor: '#ffffff',
- borderWidth: 1.0,
- borderColor: '#fc4747',
- borderRadius: 23,
- justifyContent: 'center',
- alignItems: 'center'
- },
- FollowButtonText: {
- fontSize: 17,
- color: '#fc4747',
- }
- })
|