Showing
1 changed file
with
58 additions
and
18 deletions
| @@ -22,6 +22,7 @@ export default class Edit extends Component { | @@ -22,6 +22,7 @@ export default class Edit extends Component { | ||
| 22 | constructor(props) { | 22 | constructor(props) { |
| 23 | super(props); | 23 | super(props); |
| 24 | this.state = { | 24 | this.state = { |
| 25 | + USER_ID: "", | ||
| 25 | customer_id: "", | 26 | customer_id: "", |
| 26 | name: "", | 27 | name: "", |
| 27 | age: "", | 28 | age: "", |
| @@ -30,7 +31,7 @@ export default class Edit extends Component { | @@ -30,7 +31,7 @@ export default class Edit extends Component { | ||
| 30 | is_sign: "", | 31 | is_sign: "", |
| 31 | recommend: "", | 32 | recommend: "", |
| 32 | is_married: "", | 33 | is_married: "", |
| 33 | - has_children: "", | 34 | + has_children: "" |
| 34 | }; | 35 | }; |
| 35 | } | 36 | } |
| 36 | componentWillMount() {} | 37 | componentWillMount() {} |
| @@ -40,6 +41,7 @@ export default class Edit extends Component { | @@ -40,6 +41,7 @@ export default class Edit extends Component { | ||
| 40 | getListData() { | 41 | getListData() { |
| 41 | post("/test/insurance/article", {}, res => {}, err => {}); | 42 | post("/test/insurance/article", {}, res => {}, err => {}); |
| 42 | } | 43 | } |
| 44 | + | ||
| 43 | Alert_select(title, tips, statusName, select1, select2) { | 45 | Alert_select(title, tips, statusName, select1, select2) { |
| 44 | Alert.alert( | 46 | Alert.alert( |
| 45 | title, | 47 | title, |
| @@ -61,8 +63,12 @@ export default class Edit extends Component { | @@ -61,8 +63,12 @@ export default class Edit extends Component { | ||
| 61 | { cancelable: false } | 63 | { cancelable: false } |
| 62 | ); | 64 | ); |
| 63 | } | 65 | } |
| 64 | - AlertIOS_input() { | 66 | + AlertIOS_input(title, statusName) { |
| 65 | - AlertIOS.prompt("婚姻状态", null, () => {}); | 67 | + AlertIOS.prompt(title, null, d => { |
| 68 | + this.setState({ | ||
| 69 | + [statusName]: d | ||
| 70 | + }); | ||
| 71 | + }); | ||
| 66 | } | 72 | } |
| 67 | submit() {} | 73 | submit() {} |
| 68 | delete() {} | 74 | delete() {} |
| @@ -71,60 +77,87 @@ export default class Edit extends Component { | @@ -71,60 +77,87 @@ export default class Edit extends Component { | ||
| 71 | return ( | 77 | return ( |
| 72 | <View style={styles.container}> | 78 | <View style={styles.container}> |
| 73 | <View style={styles.infoContaier}> | 79 | <View style={styles.infoContaier}> |
| 74 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 80 | + {/* 填写型 */} |
| 81 | + <TouchableOpacity | ||
| 82 | + style={styles.itemContainer} | ||
| 83 | + onPress={() => { | ||
| 84 | + this.AlertIOS_input("姓名", "name"); | ||
| 85 | + }} | ||
| 86 | + > | ||
| 75 | <View style={styles.itemLeft}> | 87 | <View style={styles.itemLeft}> |
| 76 | <Text style={styles.leftTitle}>姓名</Text> | 88 | <Text style={styles.leftTitle}>姓名</Text> |
| 77 | </View> | 89 | </View> |
| 78 | <View style={styles.itemRight}> | 90 | <View style={styles.itemRight}> |
| 79 | - <Text style={styles.itemRightContent}>周周周</Text> | 91 | + <Text style={styles.itemRightContent}>{this.state.name}</Text> |
| 80 | <Image | 92 | <Image |
| 81 | style={styles.itemRightImg} | 93 | style={styles.itemRightImg} |
| 82 | source={require("../../assets/Mine/rightArrow_gray.png")} | 94 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| 83 | /> | 95 | /> |
| 84 | </View> | 96 | </View> |
| 85 | </TouchableOpacity> | 97 | </TouchableOpacity> |
| 86 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 98 | + <TouchableOpacity |
| 99 | + style={styles.itemContainer} | ||
| 100 | + onPress={() => { | ||
| 101 | + this.AlertIOS_input("年龄", "age"); | ||
| 102 | + }} | ||
| 103 | + > | ||
| 87 | <View style={styles.itemLeft}> | 104 | <View style={styles.itemLeft}> |
| 88 | <Text style={styles.leftTitle}>年龄</Text> | 105 | <Text style={styles.leftTitle}>年龄</Text> |
| 89 | </View> | 106 | </View> |
| 90 | <View style={styles.itemRight}> | 107 | <View style={styles.itemRight}> |
| 91 | - <Text style={styles.itemRightContent}>18</Text> | 108 | + <Text style={styles.itemRightContent}>{this.state.age}</Text> |
| 92 | <Image | 109 | <Image |
| 93 | style={styles.itemRightImg} | 110 | style={styles.itemRightImg} |
| 94 | source={require("../../assets/Mine/rightArrow_gray.png")} | 111 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| 95 | /> | 112 | /> |
| 96 | </View> | 113 | </View> |
| 97 | </TouchableOpacity> | 114 | </TouchableOpacity> |
| 98 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 115 | + <TouchableOpacity |
| 116 | + style={styles.itemContainer} | ||
| 117 | + onPress={() => { | ||
| 118 | + this.AlertIOS_input("手机号码", "phone"); | ||
| 119 | + }} | ||
| 120 | + > | ||
| 99 | <View style={styles.itemLeft}> | 121 | <View style={styles.itemLeft}> |
| 100 | <Text style={styles.leftTitle}>手机号码</Text> | 122 | <Text style={styles.leftTitle}>手机号码</Text> |
| 101 | </View> | 123 | </View> |
| 102 | <View style={styles.itemRight}> | 124 | <View style={styles.itemRight}> |
| 103 | - <Text style={styles.itemRightContent}>13570000000</Text> | 125 | + <Text style={styles.itemRightContent}>{this.state.phone}</Text> |
| 104 | <Image | 126 | <Image |
| 105 | style={styles.itemRightImg} | 127 | style={styles.itemRightImg} |
| 106 | source={require("../../assets/Mine/rightArrow_gray.png")} | 128 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| 107 | /> | 129 | /> |
| 108 | </View> | 130 | </View> |
| 109 | </TouchableOpacity> | 131 | </TouchableOpacity> |
| 110 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 132 | + {/* 选择型 */} |
| 133 | + <TouchableOpacity | ||
| 134 | + style={styles.itemContainer} | ||
| 135 | + onPress={() => { | ||
| 136 | + this.Alert_select("性别", "", "sex", "男", "女"); | ||
| 137 | + }} | ||
| 138 | + > | ||
| 111 | <View style={styles.itemLeft}> | 139 | <View style={styles.itemLeft}> |
| 112 | <Text style={styles.leftTitle}>性别</Text> | 140 | <Text style={styles.leftTitle}>性别</Text> |
| 113 | </View> | 141 | </View> |
| 114 | <View style={styles.itemRight}> | 142 | <View style={styles.itemRight}> |
| 115 | - <Text style={styles.itemRightContent}>男</Text> | 143 | + <Text style={styles.itemRightContent}>{this.state.sex}</Text> |
| 116 | <Image | 144 | <Image |
| 117 | style={styles.itemRightImg} | 145 | style={styles.itemRightImg} |
| 118 | source={require("../../assets/Mine/rightArrow_gray.png")} | 146 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| 119 | /> | 147 | /> |
| 120 | </View> | 148 | </View> |
| 121 | </TouchableOpacity> | 149 | </TouchableOpacity> |
| 122 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 150 | + <TouchableOpacity |
| 151 | + style={styles.itemContainer} | ||
| 152 | + onPress={() => { | ||
| 153 | + this.Alert_select("客户状态", "", "is_sign", "已签单", "未签单"); | ||
| 154 | + }} | ||
| 155 | + > | ||
| 123 | <View style={styles.itemLeft}> | 156 | <View style={styles.itemLeft}> |
| 124 | <Text style={styles.leftTitle}>客户状态</Text> | 157 | <Text style={styles.leftTitle}>客户状态</Text> |
| 125 | </View> | 158 | </View> |
| 126 | <View style={styles.itemRight}> | 159 | <View style={styles.itemRight}> |
| 127 | - <Text style={styles.itemRightContent}>已签单</Text> | 160 | + <Text style={styles.itemRightContent}>{this.state.is_sign}</Text> |
| 128 | <Image | 161 | <Image |
| 129 | style={styles.itemRightImg} | 162 | style={styles.itemRightImg} |
| 130 | source={require("../../assets/Mine/rightArrow_gray.png")} | 163 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| @@ -134,7 +167,7 @@ export default class Edit extends Component { | @@ -134,7 +167,7 @@ export default class Edit extends Component { | ||
| 134 | <TouchableOpacity | 167 | <TouchableOpacity |
| 135 | style={styles.itemContainer} | 168 | style={styles.itemContainer} |
| 136 | onPress={() => { | 169 | onPress={() => { |
| 137 | - this.AlertIOS_input(); | 170 | + this.Alert_select("客户来源", "", "recommend", "保护神", "其他"); |
| 138 | }} | 171 | }} |
| 139 | > | 172 | > |
| 140 | <View style={styles.itemLeft}> | 173 | <View style={styles.itemLeft}> |
| @@ -153,7 +186,7 @@ export default class Edit extends Component { | @@ -153,7 +186,7 @@ export default class Edit extends Component { | ||
| 153 | <TouchableOpacity | 186 | <TouchableOpacity |
| 154 | style={styles.itemContainer} | 187 | style={styles.itemContainer} |
| 155 | onPress={() => { | 188 | onPress={() => { |
| 156 | - this.Alert_select("婚姻状态", "选一下嘛", "is_married", "已婚", "未婚"); | 189 | + this.Alert_select("婚姻状态", "", "is_married", "已婚", "未婚"); |
| 157 | }} | 190 | }} |
| 158 | > | 191 | > |
| 159 | <View style={styles.itemLeft}> | 192 | <View style={styles.itemLeft}> |
| @@ -169,12 +202,19 @@ export default class Edit extends Component { | @@ -169,12 +202,19 @@ export default class Edit extends Component { | ||
| 169 | /> | 202 | /> |
| 170 | </View> | 203 | </View> |
| 171 | </TouchableOpacity> | 204 | </TouchableOpacity> |
| 172 | - <TouchableOpacity style={styles.itemContainer} onPress={() => {}}> | 205 | + <TouchableOpacity |
| 206 | + style={styles.itemContainer} | ||
| 207 | + onPress={() => { | ||
| 208 | + this.Alert_select("是否生育", "", "has_children", "是", "否"); | ||
| 209 | + }} | ||
| 210 | + > | ||
| 173 | <View style={styles.itemLeft}> | 211 | <View style={styles.itemLeft}> |
| 174 | <Text style={styles.leftTitle}>是否生育</Text> | 212 | <Text style={styles.leftTitle}>是否生育</Text> |
| 175 | </View> | 213 | </View> |
| 176 | <View style={styles.itemRight}> | 214 | <View style={styles.itemRight}> |
| 177 | - <Text style={styles.itemRightContent}>否</Text> | 215 | + <Text style={styles.itemRightContent}> |
| 216 | + {this.state.has_children} | ||
| 217 | + </Text> | ||
| 178 | <Image | 218 | <Image |
| 179 | style={styles.itemRightImg} | 219 | style={styles.itemRightImg} |
| 180 | source={require("../../assets/Mine/rightArrow_gray.png")} | 220 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| @@ -267,7 +307,7 @@ const styles = StyleSheet.create({ | @@ -267,7 +307,7 @@ const styles = StyleSheet.create({ | ||
| 267 | deleteBtn: { | 307 | deleteBtn: { |
| 268 | marginHorizontal: 40, | 308 | marginHorizontal: 40, |
| 269 | justifyContent: "center", | 309 | justifyContent: "center", |
| 270 | - alignItems: "center", | 310 | + alignItems: "center" |
| 271 | }, | 311 | }, |
| 272 | deleteText: { | 312 | deleteText: { |
| 273 | fontSize: 16, | 313 | fontSize: 16, |
-
Please register or login to post a comment