index.js 1.38 KB
import React, { Component } from "react";
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Image,
  TouchableOpacity,
  ScrollView,
  ListView,
  Dimensions,
} from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
import post from "../../utils/fetch";

export default class Home extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  componentWillMount() {}

  componentDidMount() {}

  getListData() {
    post("/test/insurance/article", {}, res => {}, err => {});
  }

  getAllPhone() {
    Contacts.getAll((err, contacts) => {
      if(err && err.type === 'permissionDenied'){
      } else {
        let phones = [];
        contacts.forEach((item, index) => {
          item.phoneNumbers.forEach((phone, i) => {
            phones.push(phone.number);
          });
        });
        post('/spreader/rank/friends/contact', { contact: phones }, (res) => {
          this.getRankData();
        }, (resErr) => {
          Toast.show(resErr.cnmsg, Toast.error);
        });
      }
    });
  }

  render() {
    const { navigate } = this.props.navigation;
    return (
      <View style={styles.container}>
        <Text>客户管理页面</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "flex-start",
    alignItems: "stretch",
    backgroundColor: "#EFEFEF"
  }
});