result.jsx 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. getInitialState() {
  8. return {
  9. loading: false,
  10. };
  11. },
  12. handleSubmit() {
  13. this.setState({
  14. loading: true
  15. });
  16. $.ajax({
  17. method: "get",
  18. dataType: "json",
  19. crossDomain: false,
  20. url: globalConfig.context + "/api/user/identFailed",
  21. data: {
  22. }
  23. }).done(function (data) {
  24. if (!data.error.length) {
  25. message.success('已提交重新审核!');
  26. this.props.changeStep(1);
  27. } else {
  28. message.warning(data.error[0].message);
  29. };
  30. this.setState({
  31. loading: false
  32. });
  33. }.bind(this));
  34. },
  35. componentWillMount() {
  36. $.ajax({
  37. method: "get",
  38. dataType: "json",
  39. url: globalConfig.context + "/api/user/userPro",
  40. success: function (data) {
  41. if (data.data) {
  42. this.setState({
  43. auditStatus: data.data.auditStatus
  44. });
  45. };
  46. }.bind(this),
  47. }).done(function (data) {
  48. if (data.error && data.error.length) {
  49. message.warning(data.error[0].message);
  50. };
  51. this.setState({
  52. loading: false
  53. });
  54. }.bind(this));
  55. },
  56. render() {
  57. const _me = this;
  58. return (
  59. <Spin spinning={this.state.loading} className="certify-spin">
  60. {(() => {
  61. switch (this.state.auditStatus) {
  62. case '5':
  63. return <div className="certify-result-box">
  64. <p className="certify-title"
  65. style={{ 'textAlign': 'center' }}
  66. >审核通过,认证申请成功</p>
  67. <div className="certify-result-state">
  68. <Icon type="check-circle-o" />
  69. <p>您已通过了实名认证</p>
  70. </div>
  71. </div>;
  72. case '4':
  73. return <div className="certify-result-box">
  74. <p className="certify-title"
  75. style={{ 'textAlign': 'center' }}
  76. >实名认证未通过。您可以可重新申请实名认证。</p>
  77. <div className="certify-result-state">
  78. <Icon type="close-circle-o" />
  79. <p>您未能通过实名认证审核</p>
  80. <p>可能的原因是:</p>
  81. <p>您提交的认证资料不符合要求,未能通过实名认证;</p>
  82. <p>您输入的银行账户信息有误,未能通过实名认证;</p>
  83. <Button className="set-submit" type="primary" onClick={this.handleSubmit}>重新申请实名认证</Button>
  84. </div>
  85. </div>;
  86. };
  87. })()}
  88. </Spin >
  89. );
  90. },
  91. }));
  92. export default Content;