import React from 'react'; import { List, InputItem, NavBar, Toast } from 'antd-mobile-v2'; import { createForm } from 'rc-form'; import 'antd-mobile-v2/dist/antd-mobile.css'; // import ExamineMobile from './ExamineMobile'; // import commonConfig from '../../utils/config'; // import * as commonUtils from '../../utils/utils'; import CommobileBase from '../../mobile/common/CommobileBase'; import CommobileListEvent from './CommobileListEvent'; import styles from '../mobile.less'; import config from '../../utils/config'; class RevisePasswordMobile extends React.Component { constructor(props) { super(props); this.state = { sId: props.app.userinfo.sId, dispatch: props.dispatch, hasError: false, sOldPwd: '', sUserPwd: '', sUserPwdAgain: '', }; this.obj = {}; } onErrorClick = () => { if (this.state.hasError) { Toast.fail('密码输入不一致', 1); } } onChange = (name, value) => { // const nameNew = name; this.obj[name] = value; if (this.obj.sUserPwd !== this.obj.sUserPwdAgain) { this.setState({ hasError: true, }); } else { this.setState({ hasError: false, }); } this.setState({ [`${name}`]: value }); } handleSubmitPwd = (e) => { /* 阻止表单提交动作 */ e.preventDefault(); const values = {}; const { sId, sOldPwd, sUserPwd, sUserPwdAgain, } = this.state; values.sId = sId; values.sOldPwd = sOldPwd; values.sUserPwd = sUserPwd; values.sUserPwdAgain = sUserPwdAgain; if (values.sUserPwd !== values.sUserPwdAgain) { Toast.fail('密码输入不一致', 1); return; } const url = `${config.server_host}sftlogininfo/updatePasswordUserName/update?sModelsId=${100}`; const { dispatch } = this.state; dispatch({ type: 'app/editPwd', payload: { url, value: values, editPwdType: 'mobile' } }); } render() { return (