Showing
2 changed files
with
92 additions
and
21 deletions
| @@ -53,29 +53,27 @@ const MainTabBar = TabNavigator( | @@ -53,29 +53,27 @@ const MainTabBar = TabNavigator( | ||
| 53 | ) | 53 | ) |
| 54 | } | 54 | } |
| 55 | }, | 55 | }, |
| 56 | - Customer: { | 56 | + InsuranceChurch: { |
| 57 | - screen: Customer, | 57 | + screen: InsuranceChurch, |
| 58 | navigationOptions: { | 58 | navigationOptions: { |
| 59 | - title: "客户管理", | 59 | + title: "保堂", |
| 60 | - // header: null, | ||
| 61 | - // tabBarVisible: false, | ||
| 62 | tabBarIcon: ({ focused }) => | 60 | tabBarIcon: ({ focused }) => |
| 63 | focused ? ( | 61 | focused ? ( |
| 64 | - <Image source={require("./src/assets/tabbar/ic_discover_s.png")} /> | 62 | + <Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} /> |
| 65 | ) : ( | 63 | ) : ( |
| 66 | - <Image source={require("./src/assets/tabbar/ic_discover_n.png")} /> | 64 | + <Image source={require("./src/assets/tabbar/ic_umbrella_n.png")} /> |
| 67 | ) | 65 | ) |
| 68 | } | 66 | } |
| 69 | }, | 67 | }, |
| 70 | - InsuranceChurch: { | 68 | + Customer: { |
| 71 | - screen: InsuranceChurch, | 69 | + screen: Customer, |
| 72 | navigationOptions: { | 70 | navigationOptions: { |
| 73 | - title: "保堂", | 71 | + title: "客户管理", |
| 74 | tabBarIcon: ({ focused }) => | 72 | tabBarIcon: ({ focused }) => |
| 75 | focused ? ( | 73 | focused ? ( |
| 76 | - <Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} /> | 74 | + <Image source={require("./src/assets/tabbar/ic_discover_s.png")} /> |
| 77 | ) : ( | 75 | ) : ( |
| 78 | - <Image source={require("./src/assets/tabbar/ic_umbrella_n.png")} /> | 76 | + <Image source={require("./src/assets/tabbar/ic_discover_n.png")} /> |
| 79 | ) | 77 | ) |
| 80 | } | 78 | } |
| 81 | }, | 79 | }, |
| @@ -8,7 +8,7 @@ import { | @@ -8,7 +8,7 @@ import { | ||
| 8 | TouchableOpacity, | 8 | TouchableOpacity, |
| 9 | ScrollView, | 9 | ScrollView, |
| 10 | ListView, | 10 | ListView, |
| 11 | - Dimensions, | 11 | + Dimensions |
| 12 | } from "react-native"; | 12 | } from "react-native"; |
| 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"; |
| @@ -28,7 +28,7 @@ export default class Home extends Component { | @@ -28,7 +28,7 @@ export default class Home extends Component { | ||
| 28 | 28 | ||
| 29 | getAllPhone() { | 29 | getAllPhone() { |
| 30 | Contacts.getAll((err, contacts) => { | 30 | Contacts.getAll((err, contacts) => { |
| 31 | - if(err && err.type === 'permissionDenied'){ | 31 | + if (err && err.type === "permissionDenied") { |
| 32 | } else { | 32 | } else { |
| 33 | let phones = []; | 33 | let phones = []; |
| 34 | contacts.forEach((item, index) => { | 34 | contacts.forEach((item, index) => { |
| @@ -36,11 +36,16 @@ export default class Home extends Component { | @@ -36,11 +36,16 @@ export default class Home extends Component { | ||
| 36 | phones.push(phone.number); | 36 | phones.push(phone.number); |
| 37 | }); | 37 | }); |
| 38 | }); | 38 | }); |
| 39 | - post('/spreader/rank/friends/contact', { contact: phones }, (res) => { | 39 | + post( |
| 40 | - this.getRankData(); | 40 | + "/spreader/rank/friends/contact", |
| 41 | - }, (resErr) => { | 41 | + { contact: phones }, |
| 42 | - Toast.show(resErr.cnmsg, Toast.error); | 42 | + res => { |
| 43 | - }); | 43 | + this.getRankData(); |
| 44 | + }, | ||
| 45 | + resErr => { | ||
| 46 | + Toast.show(resErr.cnmsg, Toast.error); | ||
| 47 | + } | ||
| 48 | + ); | ||
| 44 | } | 49 | } |
| 45 | }); | 50 | }); |
| 46 | } | 51 | } |
| @@ -49,7 +54,32 @@ export default class Home extends Component { | @@ -49,7 +54,32 @@ export default class Home extends Component { | ||
| 49 | const { navigate } = this.props.navigation; | 54 | const { navigate } = this.props.navigation; |
| 50 | return ( | 55 | return ( |
| 51 | <View style={styles.container}> | 56 | <View style={styles.container}> |
| 52 | - <Text>客户管理页面</Text> | 57 | + <Begin /> |
| 58 | + </View> | ||
| 59 | + ); | ||
| 60 | + } | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +class Begin extends Component { | ||
| 64 | + constructor(props) { | ||
| 65 | + super(props); | ||
| 66 | + this.state = {}; | ||
| 67 | + } | ||
| 68 | + render() { | ||
| 69 | + return ( | ||
| 70 | + <View style={styles.beginContaier}> | ||
| 71 | + <Image | ||
| 72 | + source={require("../../assets/customer/pic.png")} | ||
| 73 | + style={styles.beginPic} | ||
| 74 | + /> | ||
| 75 | + <View style={styles.beginBtnContaier}> | ||
| 76 | + <TouchableOpacity style={styles.beginBtnLeft}> | ||
| 77 | + <Text style={styles.beginBtnLeftText}>手动选择</Text> | ||
| 78 | + </TouchableOpacity> | ||
| 79 | + <TouchableOpacity style={styles.beginBtnRight}> | ||
| 80 | + <Text style={styles.beginBtnRightText}>通信录导入</Text> | ||
| 81 | + </TouchableOpacity> | ||
| 82 | + </View> | ||
| 53 | </View> | 83 | </View> |
| 54 | ); | 84 | ); |
| 55 | } | 85 | } |
| @@ -61,5 +91,48 @@ const styles = StyleSheet.create({ | @@ -61,5 +91,48 @@ const styles = StyleSheet.create({ | ||
| 61 | justifyContent: "flex-start", | 91 | justifyContent: "flex-start", |
| 62 | alignItems: "stretch", | 92 | alignItems: "stretch", |
| 63 | backgroundColor: "#EFEFEF" | 93 | backgroundColor: "#EFEFEF" |
| 64 | - } | 94 | + }, |
| 95 | + beginContaier: { | ||
| 96 | + flex: 1, | ||
| 97 | + justifyContent: "center", | ||
| 98 | + alignItems: "center", | ||
| 99 | + backgroundColor: "#fff", | ||
| 100 | + paddingBottom: 50, | ||
| 101 | + }, | ||
| 102 | + beginPic: { | ||
| 103 | + width: 189, | ||
| 104 | + height: 193, | ||
| 105 | + }, | ||
| 106 | + beginBtnContaier: { | ||
| 107 | + flexDirection: "row", | ||
| 108 | + marginHorizontal: 30, | ||
| 109 | + marginTop: 40, | ||
| 110 | + }, | ||
| 111 | + beginBtnLeft: { | ||
| 112 | + flex: 1, | ||
| 113 | + justifyContent: "center", | ||
| 114 | + alignItems: "center", | ||
| 115 | + paddingVertical: 12, | ||
| 116 | + borderStyle: "solid", | ||
| 117 | + borderColor: "#999", | ||
| 118 | + borderWidth: 1, | ||
| 119 | + borderRadius: 5, | ||
| 120 | + }, | ||
| 121 | + beginBtnLeftText: { | ||
| 122 | + fontSize: 16, | ||
| 123 | + color: "#242424", | ||
| 124 | + }, | ||
| 125 | + beginBtnRight: { | ||
| 126 | + flex: 1, | ||
| 127 | + justifyContent: "center", | ||
| 128 | + alignItems: "center", | ||
| 129 | + paddingVertical: 12, | ||
| 130 | + marginLeft: 20, | ||
| 131 | + borderRadius: 5, | ||
| 132 | + backgroundColor: "#1B9341", | ||
| 133 | + }, | ||
| 134 | + beginBtnRightText: { | ||
| 135 | + fontSize: 16, | ||
| 136 | + color: "white", | ||
| 137 | + }, | ||
| 65 | }); | 138 | }); |
-
Please register or login to post a comment