罗广聪

customer Edit

@@ -13,6 +13,7 @@ import InsuranceCircle from "./src/pages/InsuranceCircle/index"; @@ -13,6 +13,7 @@ import InsuranceCircle from "./src/pages/InsuranceCircle/index";
13 import InsuranceChurch from "./src/pages/InsuranceChurch/index"; 13 import InsuranceChurch from "./src/pages/InsuranceChurch/index";
14 import Mine from "./src/pages/Mine/index"; 14 import Mine from "./src/pages/Mine/index";
15 import Customer from "./src/pages/Customer/index"; 15 import Customer from "./src/pages/Customer/index";
  16 +import CustomerEdit from "./src/pages/Customer/edit";
16 import Login from "./src/pages/Login"; 17 import Login from "./src/pages/Login";
17 import AllProduct from "./src/pages/Home/allProduct"; 18 import AllProduct from "./src/pages/Home/allProduct";
18 import ProductTemplate from "./src/Components/ProductTemplate"; 19 import ProductTemplate from "./src/Components/ProductTemplate";
@@ -107,6 +108,7 @@ const ProtectGod = StackNavigator( @@ -107,6 +108,7 @@ const ProtectGod = StackNavigator(
107 Mine: { screen: Mine }, 108 Mine: { screen: Mine },
108 Login: { screen: Login }, 109 Login: { screen: Login },
109 Customer: { screen: Customer }, 110 Customer: { screen: Customer },
  111 + CustomerEdit: {screen: CustomerEdit },
110 AllProduct: { 112 AllProduct: {
111 screen: AllProduct, 113 screen: AllProduct,
112 navigationOptions: { headerTitle: "全部产品" } 114 navigationOptions: { headerTitle: "全部产品" }
  1 +import React, { Component } from "react";
  2 +import {
  3 + AppRegistry,
  4 + StyleSheet,
  5 + Text,
  6 + View,
  7 + Image,
  8 + TouchableOpacity,
  9 + ScrollView,
  10 + ListView,
  11 + Dimensions,
  12 +} from "react-native";
  13 +import { StackNavigator, TabNavigator } from "react-navigation";
  14 +import post from "../../utils/fetch";
  15 +
  16 +export default class Edit extends Component {
  17 + constructor(props) {
  18 + super(props);
  19 + this.state = {};
  20 + }
  21 + componentWillMount() {}
  22 +
  23 + componentDidMount() {}
  24 +
  25 + getListData() {
  26 + post("/test/insurance/article", {}, res => {}, err => {});
  27 + }
  28 +
  29 + render() {
  30 + const { navigate } = this.props.navigation;
  31 + return (
  32 + <View style={styles.container}>
  33 + <Text>编辑客户信息</Text>
  34 + </View>
  35 + );
  36 + }
  37 +}
  38 +
  39 +const styles = StyleSheet.create({
  40 + container: {
  41 + flex: 1,
  42 + justifyContent: "flex-start",
  43 + alignItems: "stretch",
  44 + backgroundColor: "#EFEFEF"
  45 + }
  46 +});
@@ -13,7 +13,7 @@ import { @@ -13,7 +13,7 @@ import {
13 import { StackNavigator, TabNavigator } from "react-navigation"; 13 import { StackNavigator, TabNavigator } from "react-navigation";
14 import post from "../../utils/fetch"; 14 import post from "../../utils/fetch";
15 15
16 -export default class Home extends Component { 16 +export default class Customer extends Component {
17 constructor(props) { 17 constructor(props) {
18 super(props); 18 super(props);
19 this.state = { 19 this.state = {
@@ -59,7 +59,7 @@ export default class Home extends Component { @@ -59,7 +59,7 @@ export default class Home extends Component {
59 return ( 59 return (
60 <View style={styles.container}> 60 <View style={styles.container}>
61 {hasCustomer ? ( 61 {hasCustomer ? (
62 - <Main customersList={this.state.customersList} /> 62 + <Main customersList={this.state.customersList} navigation={this.props.navigation} />
63 ) : ( 63 ) : (
64 <Begin /> 64 <Begin />
65 )} 65 )}
@@ -101,6 +101,7 @@ class Main extends Component { @@ -101,6 +101,7 @@ class Main extends Component {
101 101
102 render() { 102 render() {
103 const { customersList } = this.props; 103 const { customersList } = this.props;
  104 + const { navigate } = this.props.navigation;
104 return ( 105 return (
105 <View style={styles.mainContaier}> 106 <View style={styles.mainContaier}>
106 <View style={styles.mainBtnContaier}> 107 <View style={styles.mainBtnContaier}>
@@ -122,7 +123,7 @@ class Main extends Component { @@ -122,7 +123,7 @@ class Main extends Component {
122 <ScrollView style={styles.mainSvcContainer}> 123 <ScrollView style={styles.mainSvcContainer}>
123 {customersList.map((item, index) => { 124 {customersList.map((item, index) => {
124 return ( 125 return (
125 - <TouchableOpacity key={index} style={styles.mainCustomerItem}> 126 + <TouchableOpacity key={index} style={styles.mainCustomerItem} onPress={() => navigate("CustomerEdit")}>
126 <Text style={styles.mainCustomerItemText}>{item}</Text> 127 <Text style={styles.mainCustomerItemText}>{item}</Text>
127 <Image style={styles.mainCustomerItemImg} source={require("../../assets/customer/rightArrow_gray.png")} /> 128 <Image style={styles.mainCustomerItemImg} source={require("../../assets/customer/rightArrow_gray.png")} />
128 </TouchableOpacity> 129 </TouchableOpacity>
@@ -226,6 +227,7 @@ const styles = StyleSheet.create({ @@ -226,6 +227,7 @@ const styles = StyleSheet.create({
226 color: "#242424" 227 color: "#242424"
227 }, 228 },
228 mainSvcContainer: { 229 mainSvcContainer: {
  230 + flex: 1,
229 backgroundColor: "white", 231 backgroundColor: "white",
230 }, 232 },
231 mainCustomerItem: { 233 mainCustomerItem: {
@@ -238,7 +240,7 @@ const styles = StyleSheet.create({ @@ -238,7 +240,7 @@ const styles = StyleSheet.create({
238 marginRight: 10, 240 marginRight: 10,
239 borderStyle: "solid", 241 borderStyle: "solid",
240 borderColor: "#F2F2F2", 242 borderColor: "#F2F2F2",
241 - borderTopWidth: 1, 243 + borderBottomWidth: 1,
242 }, 244 },
243 mainCustomerItemText: { 245 mainCustomerItemText: {
244 fontSize: 16, 246 fontSize: 16,