confirm.jsx 6.4 KB

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