Showing
1 changed file
with
60 additions
and
43 deletions
| @@ -22,10 +22,15 @@ export default class Edit extends Component { | @@ -22,10 +22,15 @@ 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 | - customer_status: [], | 25 | + customer_id: "", |
| 26 | + name: "", | ||
| 27 | + age: "", | ||
| 28 | + phone: "", | ||
| 29 | + sex: "", | ||
| 30 | + is_sign: "", | ||
| 31 | + recommend: "", | ||
| 26 | is_married: "", | 32 | is_married: "", |
| 27 | - modalVisible: false, | 33 | + has_children: "", |
| 28 | - recommend: "" | ||
| 29 | }; | 34 | }; |
| 30 | } | 35 | } |
| 31 | componentWillMount() {} | 36 | componentWillMount() {} |
| @@ -35,37 +40,6 @@ export default class Edit extends Component { | @@ -35,37 +40,6 @@ export default class Edit extends Component { | ||
| 35 | getListData() { | 40 | getListData() { |
| 36 | post("/test/insurance/article", {}, res => {}, err => {}); | 41 | post("/test/insurance/article", {}, res => {}, err => {}); |
| 37 | } | 42 | } |
| 38 | - | ||
| 39 | - setModalVisible(visible) { | ||
| 40 | - this.setState({ modalVisible: visible }); | ||
| 41 | - } | ||
| 42 | - _renderPicker() { | ||
| 43 | - return ( | ||
| 44 | - <Modal | ||
| 45 | - animationType={"slide"} | ||
| 46 | - transparent={false} | ||
| 47 | - visible={this.state.modalVisible} | ||
| 48 | - onRequestClose={() => { | ||
| 49 | - alert("Modal has been closed."); | ||
| 50 | - }} | ||
| 51 | - > | ||
| 52 | - <Picker | ||
| 53 | - selectedValue={this.state.is_married} | ||
| 54 | - onValueChange={status => this.setState({ is_married: status })} | ||
| 55 | - > | ||
| 56 | - <Picker.Item label="是" value="yes" /> | ||
| 57 | - <Picker.Item label="否" value="no" /> | ||
| 58 | - </Picker> | ||
| 59 | - <TouchableHighlight | ||
| 60 | - onPress={() => { | ||
| 61 | - this.setModalVisible(!this.state.modalVisible); | ||
| 62 | - }} | ||
| 63 | - > | ||
| 64 | - <Text>Hide Modal</Text> | ||
| 65 | - </TouchableHighlight> | ||
| 66 | - </Modal> | ||
| 67 | - ); | ||
| 68 | - } | ||
| 69 | Alert_select(title, tips, statusName, select1, select2) { | 43 | Alert_select(title, tips, statusName, select1, select2) { |
| 70 | Alert.alert( | 44 | Alert.alert( |
| 71 | title, | 45 | title, |
| @@ -81,17 +55,17 @@ export default class Edit extends Component { | @@ -81,17 +55,17 @@ export default class Edit extends Component { | ||
| 81 | text: select2, | 55 | text: select2, |
| 82 | onPress: () => { | 56 | onPress: () => { |
| 83 | this.setState({ [statusName]: select2 }); | 57 | this.setState({ [statusName]: select2 }); |
| 84 | - }, | 58 | + } |
| 85 | - }, | 59 | + } |
| 86 | ], | 60 | ], |
| 87 | { cancelable: false } | 61 | { cancelable: false } |
| 88 | ); | 62 | ); |
| 89 | } | 63 | } |
| 90 | - | ||
| 91 | AlertIOS_input() { | 64 | AlertIOS_input() { |
| 92 | AlertIOS.prompt("婚姻状态", null, () => {}); | 65 | AlertIOS.prompt("婚姻状态", null, () => {}); |
| 93 | } | 66 | } |
| 94 | - | 67 | + submit() {} |
| 68 | + delete() {} | ||
| 95 | render() { | 69 | render() { |
| 96 | const { navigate } = this.props.navigation; | 70 | const { navigate } = this.props.navigation; |
| 97 | return ( | 71 | return ( |
| @@ -179,14 +153,16 @@ export default class Edit extends Component { | @@ -179,14 +153,16 @@ export default class Edit extends Component { | ||
| 179 | <TouchableOpacity | 153 | <TouchableOpacity |
| 180 | style={styles.itemContainer} | 154 | style={styles.itemContainer} |
| 181 | onPress={() => { | 155 | onPress={() => { |
| 182 | - this.Alert_select("婚姻状态", "选一下嘛", 'is_married', "已婚", "未婚"); | 156 | + this.Alert_select("婚姻状态", "选一下嘛", "is_married", "已婚", "未婚"); |
| 183 | }} | 157 | }} |
| 184 | > | 158 | > |
| 185 | <View style={styles.itemLeft}> | 159 | <View style={styles.itemLeft}> |
| 186 | <Text style={styles.leftTitle}>婚姻状态</Text> | 160 | <Text style={styles.leftTitle}>婚姻状态</Text> |
| 187 | </View> | 161 | </View> |
| 188 | <View style={styles.itemRight}> | 162 | <View style={styles.itemRight}> |
| 189 | - <Text style={styles.itemRightContent}>{this.state.is_married}</Text> | 163 | + <Text style={styles.itemRightContent}> |
| 164 | + {this.state.is_married} | ||
| 165 | + </Text> | ||
| 190 | <Image | 166 | <Image |
| 191 | style={styles.itemRightImg} | 167 | style={styles.itemRightImg} |
| 192 | source={require("../../assets/Mine/rightArrow_gray.png")} | 168 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| @@ -198,9 +174,7 @@ export default class Edit extends Component { | @@ -198,9 +174,7 @@ export default class Edit extends Component { | ||
| 198 | <Text style={styles.leftTitle}>是否生育</Text> | 174 | <Text style={styles.leftTitle}>是否生育</Text> |
| 199 | </View> | 175 | </View> |
| 200 | <View style={styles.itemRight}> | 176 | <View style={styles.itemRight}> |
| 201 | - <Text style={styles.itemRightContent}> | 177 | + <Text style={styles.itemRightContent}>否</Text> |
| 202 | - 否 | ||
| 203 | - </Text> | ||
| 204 | <Image | 178 | <Image |
| 205 | style={styles.itemRightImg} | 179 | style={styles.itemRightImg} |
| 206 | source={require("../../assets/Mine/rightArrow_gray.png")} | 180 | source={require("../../assets/Mine/rightArrow_gray.png")} |
| @@ -208,6 +182,26 @@ export default class Edit extends Component { | @@ -208,6 +182,26 @@ export default class Edit extends Component { | ||
| 208 | </View> | 182 | </View> |
| 209 | </TouchableOpacity> | 183 | </TouchableOpacity> |
| 210 | </View> | 184 | </View> |
| 185 | + | ||
| 186 | + {/* 按钮 */} | ||
| 187 | + <View style={styles.btnContainer}> | ||
| 188 | + <TouchableOpacity | ||
| 189 | + onPress={() => { | ||
| 190 | + this.submit(); | ||
| 191 | + }} | ||
| 192 | + style={styles.confirmBtn} | ||
| 193 | + > | ||
| 194 | + <Text style={styles.confirmBtnText}>确定</Text> | ||
| 195 | + </TouchableOpacity> | ||
| 196 | + <TouchableOpacity | ||
| 197 | + onPress={() => { | ||
| 198 | + this.delete(); | ||
| 199 | + }} | ||
| 200 | + style={styles.deleteBtn} | ||
| 201 | + > | ||
| 202 | + <Text style={styles.deleteText}>删除</Text> | ||
| 203 | + </TouchableOpacity> | ||
| 204 | + </View> | ||
| 211 | </View> | 205 | </View> |
| 212 | ); | 206 | ); |
| 213 | } | 207 | } |
| @@ -256,5 +250,28 @@ const styles = StyleSheet.create({ | @@ -256,5 +250,28 @@ const styles = StyleSheet.create({ | ||
| 256 | itemRightImg: { | 250 | itemRightImg: { |
| 257 | width: 14, | 251 | width: 14, |
| 258 | height: 14 | 252 | height: 14 |
| 253 | + }, | ||
| 254 | + confirmBtn: { | ||
| 255 | + marginTop: 20, | ||
| 256 | + marginHorizontal: 40, | ||
| 257 | + justifyContent: "center", | ||
| 258 | + alignItems: "center", | ||
| 259 | + backgroundColor: "#1B9341", | ||
| 260 | + height: 45, | ||
| 261 | + borderRadius: 5 | ||
| 262 | + }, | ||
| 263 | + confirmBtnText: { | ||
| 264 | + fontSize: 16, | ||
| 265 | + color: "white" | ||
| 266 | + }, | ||
| 267 | + deleteBtn: { | ||
| 268 | + marginHorizontal: 40, | ||
| 269 | + justifyContent: "center", | ||
| 270 | + alignItems: "center", | ||
| 271 | + }, | ||
| 272 | + deleteText: { | ||
| 273 | + fontSize: 16, | ||
| 274 | + marginTop: 24, | ||
| 275 | + color: "#1B9341" | ||
| 259 | } | 276 | } |
| 260 | }); | 277 | }); |
-
Please register or login to post a comment