money.jsx 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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/orgProcess",
  15. success: function (data) {
  16. if (data.data) {
  17. this.setState({
  18. banks:data.data.banks,
  19. bankBranch:data.data.bankBranch,
  20. bankCardNumber: data.data.bankCardNumber
  21. });
  22. };
  23. }.bind(this),
  24. }).done(function (data) {
  25. if (data.error.length) {
  26. message.warning(data.error[0].message);
  27. }
  28. }.bind(this)).always(function () {
  29. this.setState({
  30. loading: false
  31. });
  32. }.bind(this));
  33. },
  34. getInitialState() {
  35. return {
  36. loading: false
  37. };
  38. },
  39. handleSubmit(e) {
  40. e.preventDefault();
  41. this.props.form.validateFields((err, values) => {
  42. if (!err) {
  43. this.setState({
  44. loading: true
  45. });
  46. $.ajax({
  47. method: "POST",
  48. dataType: "json",
  49. crossDomain: false,
  50. url: globalConfig.context + "/api/user/orgNextPro",
  51. data: {
  52. validationAmount: values.validationAmount,
  53. process: 5
  54. },
  55. success: function (data) {
  56. if (!data.error.length) {
  57. message.success('审核成功!');
  58. this.props.changeStep(6);
  59. } else {
  60. if (isNaN(Number(data.error[0].message))) {
  61. message.warning(data.error[0].message);
  62. this.setState({
  63. loading: false
  64. });
  65. } else {
  66. switch (Number(data.error[0].message)) {
  67. case 1:
  68. message.warning("超过打款日期五日,无法确认提交!");
  69. this.props.changeStep(6);
  70. break;
  71. case 2:
  72. message.warning("输入错误金额次数过多!");
  73. this.props.changeStep(6);
  74. break;
  75. }
  76. };
  77. };
  78. }.bind(this),
  79. });
  80. }
  81. });
  82. },
  83. componentWillMount() {
  84. this.getData();
  85. },
  86. render() {
  87. const FormItem = Form.Item;
  88. const { getFieldDecorator } = this.props.form;
  89. const formItemLayout = {
  90. labelCol: { span: 4 },
  91. wrapperCol: { span: 12 },
  92. };
  93. const _me = this;
  94. return (
  95. <Spin spinning={this.state.loading} className="certify-spin">
  96. <Form horizontal onSubmit={this.handleSubmit} className="certify-form">
  97. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  98. <p className="certify-title">输入打款金额</p>
  99. </FormItem>
  100. <FormItem wrapperCol={{ span: 18}}>
  101. <span>
  102. 请在下方输入{this.state.banks}银行卡{this.state.bankCardNumber}收到的认证打款,
  103. 务必在收到打款5日内完成,否则将无法完成
  104. </span>
  105. </FormItem>
  106. <FormItem
  107. {...formItemLayout}
  108. label="开户银行"
  109. >
  110. <span>{this.state.banks}</span>
  111. </FormItem>
  112. <FormItem
  113. {...formItemLayout}
  114. label="开户银行支行"
  115. >
  116. <span>{this.state.bankBranch}</span>
  117. </FormItem>
  118. <FormItem
  119. {...formItemLayout}
  120. label="银行卡号"
  121. >
  122. <span>{this.state.bankCardNumber}</span>
  123. </FormItem>
  124. <FormItem
  125. {...formItemLayout}
  126. label="打款金额"
  127. extra={<span style={{ 'color': '#ea0862' }}><Icon type="exclamation-circle" /> 仅有3次输入机会,如3次输入有误,需重新认证</span>}
  128. >
  129. {getFieldDecorator('validationAmount', {
  130. rules: [{ required: true, message: '请输入金额!' }]
  131. })(
  132. <Input />
  133. )}
  134. <span className="fromItem-postfix">元</span>
  135. </FormItem>
  136. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  137. <Button className="set-submit" type="primary" htmlType="submit">确认</Button>
  138. </FormItem>
  139. </Form >
  140. </Spin >
  141. );
  142. },
  143. }));
  144. export default Content;