confirm.jsx 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import React from 'react';
  2. import { Input, Button, Form, Icon, Spin, message, } from 'antd';
  3. import './certify.less';
  4. import ajax from 'jquery/src/ajax/xhr.js'
  5. import $ from 'jquery/src/ajax';
  6. const Content = Form.create()(React.createClass({
  7. getData() {
  8. this.setState({
  9. loading: true
  10. });
  11. $.ajax({
  12. method: "get",
  13. dataType: "json",
  14. url: globalConfig.context + "/api/user/userPro",
  15. success: function (data) {
  16. if (data.data) {
  17. this.setState({
  18. username: data.data.username,
  19. idNumber: data.data.idNumber,
  20. contactMobile: data.data.contactMobile,
  21. bankName: data.data.bankName,
  22. bankAccount: data.data.bankAccount,
  23. bankCardNumber: data.data.bankCardNumber,
  24. positiveIdUrl: data.data.positiveIdUrl,
  25. oppositeIdUrl: data.data.oppositeIdUrl
  26. });
  27. } else {
  28. message.warning(data.error[0].message);
  29. this.setState({
  30. loading: false
  31. });
  32. }
  33. }.bind(this),
  34. }).always(function () {
  35. this.setState({
  36. loading: false
  37. });
  38. }.bind(this));
  39. },
  40. getInitialState() {
  41. return {
  42. loading: false
  43. };
  44. },
  45. handleSubmit() {
  46. this.setState({
  47. loading: true
  48. });
  49. $.ajax({
  50. method: "POST",
  51. dataType: "json",
  52. crossDomain: false,
  53. url: globalConfig.context + "/api/user/userNextPro",
  54. data: {
  55. process: 3
  56. }
  57. }).done(function (data) {
  58. if (!data.error.length) {
  59. message.success('保存成功!');
  60. this.props.changeStep(4);
  61. } else {
  62. message.warning(data.error[0].message);
  63. }
  64. }.bind(this));
  65. },
  66. componentWillMount() {
  67. this.getData();
  68. },
  69. changeStep() {
  70. this.props.changeStep(1);
  71. },
  72. render() {
  73. const FormItem = Form.Item;
  74. const { getFieldDecorator } = this.props.form;
  75. const formItemLayout = {
  76. labelCol: { span: 4 },
  77. wrapperCol: { span: 12 },
  78. };
  79. const _me = this;
  80. return (
  81. <Spin spinning={this.state.loading} className="certify-spin">
  82. <Form horizontal onSubmit={this.handleSubmit} className="certify-form">
  83. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  84. <p className="certify-title">请确认个人信息</p>
  85. </FormItem>
  86. <FormItem
  87. {...formItemLayout}
  88. label="真实姓名"
  89. >
  90. <span>{this.state.username}</span>
  91. </FormItem>
  92. <FormItem
  93. {...formItemLayout}
  94. label="身份证号码"
  95. >
  96. <span>{this.state.idNumber}</span>
  97. </FormItem>
  98. <FormItem
  99. labelCol={{ span: 4 }}
  100. wrapperCol={{ span: 18 }}
  101. label="身份证图片"
  102. >
  103. <div className="idcard-img clearfix">
  104. <div>
  105. <div className="idcard-imgbox">
  106. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.positiveIdUrl} alt="点击查看大图"
  107. onClick={(e) => { window.open(e.target.src) }} />
  108. </div>
  109. </div>
  110. <div>
  111. <div className="idcard-imgbox">
  112. <img src={globalConfig.context + '/open/writeImage?path=' + this.state.oppositeIdUrl} alt="点击查看大图"
  113. onClick={(e) => { window.open(e.target.src) }} />
  114. </div>
  115. </div>
  116. </div>
  117. </FormItem>
  118. <FormItem
  119. {...formItemLayout}
  120. label="联系方式"
  121. >
  122. <span>{this.state.contactMobile}</span>
  123. </FormItem>
  124. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  125. <p className="certify-title">请确认银行卡信息</p>
  126. </FormItem>
  127. <FormItem
  128. {...formItemLayout}
  129. label="银行开户名"
  130. >
  131. <span>{this.state.bankName}</span>
  132. </FormItem>
  133. <FormItem
  134. {...formItemLayout}
  135. label="开户银行"
  136. >
  137. <span>{this.state.bankAccount}</span>
  138. </FormItem>
  139. <FormItem
  140. {...formItemLayout}
  141. label="银行卡号"
  142. >
  143. <span>{this.state.bankCardNumber}</span>
  144. </FormItem>
  145. <FormItem wrapperCol={{ span: 18, offset: 4 }}>
  146. <span style={{ 'color': '#ea0862' }}>
  147. <Icon type="exclamation-circle" />
  148. 提醒:银行卡号、身份证号码,认证成功之前,最多只能申请认证3次,
  149. 认证成功后,不能再申请认证。
  150. </span>
  151. </FormItem>
  152. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  153. <Button className="set-submit" type="primary" htmlType="submit">下一步</Button>
  154. <Button className="exit" type="ghost" onClick={_me.changeStep}>返回修改</Button>
  155. </FormItem>
  156. </Form >
  157. </Spin >
  158. );
  159. },
  160. }));
  161. export default Content;