Browse Source

入网提现费修改 提现添加加载

lvzhuo 3 years ago
parent
commit
72fc5b0894
2 changed files with 38 additions and 17 deletions
  1. 14 1
      src/component/Cash-initiated/Cash-initiated.jsx
  2. 24 16
      src/component/center-o/centerO.jsx

+ 14 - 1
src/component/Cash-initiated/Cash-initiated.jsx

@@ -2,6 +2,7 @@ import React from 'react';
 import { Input, Button ,message ,Spin   } from 'antd';
 import { LoadingOutlined } from '@ant-design/icons';
 import { $Axios } from '../../common/publish';
+import ReactDOM from 'react-dom';
 const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin />;
 export default class AccountOverview extends React.Component {
     constructor(props) {
@@ -48,6 +49,7 @@ export default class AccountOverview extends React.Component {
     }
     
     subClick(){
+		
         if( document.getElementById("je").value !== ''){
             if( document.getElementById("pwd").value !== ''){
                 if(Number(this.state.data.withdrawBalance) > 0 && Number(this.state.data.withdrawBalance) >= Number(document.getElementById("je").value)){
@@ -55,6 +57,10 @@ export default class AccountOverview extends React.Component {
                         if(Number(document.getElementById("je").value) > 0.5){
                             let nums = 0.5;
                             let that_ = this;
+							var dom = document.createElement('div')
+							      dom.setAttribute('id', 'loading')
+							      document.body.appendChild(dom)
+							      ReactDOM.render(<Spin tip="加载中..." size="large"/>, dom)
                             let url = '/payment/merchant.pickup.groovy'
                             let params = {
                                 action :"create",//提现
@@ -63,13 +69,20 @@ export default class AccountOverview extends React.Component {
                                 withdrawAmount : Number(document.getElementById("je").value),//提现金额以元为单位,默认都是人民币,以元为单位
                                 pwd : document.getElementById("pwd").value//String,交易密码
                             }
+							
                             $Axios('get',url,params,(res) => {
+								
                                 let status = res.data.head.status;
+								
                                 if(status == 200){
                                     message.info('提交成功,请注意账户变更!');
+									
                                 }else{
                                     message.info('提交失败,原因未知!');
+									
                                 }
+								this.btnCzClick()
+								document.body.removeChild(document.getElementById('loading'))
                             })
                         }else{
                             message.info('提现金额需大于手续费!');
@@ -130,7 +143,7 @@ export default class AccountOverview extends React.Component {
                        </div>
                        <div>
                             <div style={{width:'120px',display : 'inline-block',}}> 手续费 : </div>
-                            0.5元
+                            提现金额 × 4‰+0.5元
                        </div>
                        <div>
                             <div style={{width:'120px',display : 'inline-block',}}> 交易密码 : </div>

+ 24 - 16
src/component/center-o/centerO.jsx

@@ -49,6 +49,8 @@ export default class centerO extends React.Component {
     }
 
     initData() {
+		console.log(this.props.arr)
+		console.log(this.state)
         if (this.props.arr && this.state.merchantInfo == '') {  //初始化判断数据回填
             if (this.state.Params.businessAddressProvince !== undefined) {
                 let Province = this.state.Params.businessAddressProvince;
@@ -65,28 +67,34 @@ export default class centerO extends React.Component {
                 })
             }
             let signedType = this.state.Params.signedType;
-            let merchantInfo = this.state.merchantInfo;
+            // let merchantInfo = this.state.merchantInfo;
+			
             if(signedType == 'GENERAL_SUB_MERCHANT'){
                 this.setState({
                     offlist:select_data.GENERAL_SUB_MERCHANT
                 })
-            }else{
-                if(this.state.Params.registerRole == 'INDIVIDUAL_BUSINESS' || merchantInfo.baseInfo.registerRole == 'INDIVIDUAL_BUSINESS'){ //个体工商户
-                    this.setState({
-                        offlist:select_data.INDIVIDUAL_BUSINESS
-                    })
-                }else if(this.state.Params.registerRole == 'NATURAL_PERSON' || merchantInfo.baseInfo.registerRole == 'NATURAL_PERSON'){  //自然人
-                    this.setState({
-                        offlist:select_data.NATURAL_PERSON
-                    })
-                }else { //默认
-                    this.setState({
-                        offlist:select_data.offlist
-                    })
-                }
             }
             
-        }
+        }else{
+				let merchantInfo = this.state.merchantInfo;
+				// if(this.state.Params.registerRole !== undefined){
+					if(this.state.Params.registerRole == 'INDIVIDUAL_BUSINESS' || merchantInfo.baseInfo.registerRole == 'INDIVIDUAL_BUSINESS'){ //个体工商户
+					    console.log(111)
+						this.setState({
+					        offlist:select_data.INDIVIDUAL_BUSINESS
+					    })
+					}else if(this.state.Params.registerRole == 'NATURAL_PERSON' || merchantInfo.baseInfo.registerRole == 'NATURAL_PERSON'){  //自然人
+					    this.setState({
+					        offlist:select_data.NATURAL_PERSON
+					    })
+					}else { //默认
+					    this.setState({
+					        offlist:select_data.offlist
+					    })
+					}
+				// }
+                
+            }
     }
 
     toParent = (data) => {