Commit 8fc984ff authored by GuanHua's avatar GuanHua
parents f0a660f3 f546797f
import React, { useState, useEffect, useCallback } from 'react';
// import { SchemaForm } from '@formily/antd';
import { Form, Input, Row, Col, Button, Select, message } from 'antd';
import { Form, Input, Row, Col, Button, Select, message, AutoComplete } from 'antd';
import styles from './index.less';
import { StepForwardOutlined, CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
import GetCaptchaCode from '../GetCaptchaCode';
import classNames from 'classnames'
import { PublicApi } from '@/services/api';
import phoneRegExp from './utils';
import options from '@/pages/editor/settingsPanel/propsSettings/Animate/config';
const Option = Select.Option;
const EditDataComponent = (props) => {
......@@ -15,7 +16,7 @@ const EditDataComponent = (props) => {
const [canSendCode, setCanSandCode] = useState(false);
const passwordValidator = async (rule, value) => {
let temp = {}
let length = value.length >= 8 && value.length <= 20;
let length = value && value.length >= 8 && value.length <= 20;
let trim = !(/\s\S+|^\s\S+|\s$/.test(value)) //
let compact = /^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*)/.test(value); // 必须含有大小写和数字
temp['length'] = length
......@@ -41,6 +42,7 @@ const EditDataComponent = (props) => {
const country = props.form.getFieldValue('country');
const pattern = phoneRegExp[country];
if(!pattern.test(value)) {
setCanSandCode(false)
throw new Error("请填写正确的手机号")
}
setCanSandCode(true);
......@@ -50,7 +52,8 @@ const EditDataComponent = (props) => {
const emailValidator = async (rule, value) => {
const pattern = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!pattern.test(value)) {
throw new Error("请填写正确的邮箱号")
setCanSandCode(false)
throw new Error("无效的邮箱")
}
setCanSandCode(true);
}
......@@ -186,7 +189,7 @@ const EditDataComponent = (props) => {
name="phoneCaptcha"
rules={[{ required: true, message: '请填写验证码' }]}
>
<Input />
<Input autoComplete={"off"} />
</Form.Item>
</Col>
<Col span={6}>
......@@ -230,7 +233,7 @@ const EditDataComponent = (props) => {
noStyle
rules={[{ required: true, message: '请填写邮箱验证码' }]}
>
<Input />
<Input autoComplete={"off"} />
</Form.Item>
</Col>
</Row>
......
......@@ -50,7 +50,6 @@ const EmailVerifyPanel = (props) => {
}
console.log(params);
service(params).then((data) => {
console.log("success")
if(data.code == 1000) {
console.log("success")
history.push('/memberCenter/systemSetting/accountSetting')
......@@ -85,7 +84,7 @@ const EmailVerifyPanel = (props) => {
message.success("验证成功")
setVisible(true);
} else {
message.error(data.error)
message.error(data.message)
}
})
}
......@@ -111,7 +110,7 @@ const EmailVerifyPanel = (props) => {
noStyle
rules={[{ required: true, message: '请输入验证码' }]}
>
<Input />
<Input autoComplete="off" />
</Form.Item>
</Col>
<Col span={6}>
......
......@@ -96,7 +96,7 @@ const PaycodeVerifyPanel: React.FC<IProps> = (props) => {
noStyle
rules={[{ required: true, message: '请填写支付密码' }]}
>
<Input />
<Input autoComplete="off" />
</Form.Item>
</Col>
</Row>
......
......@@ -106,7 +106,8 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
>
{
!visible
? <Form.Item label="验证码">
? <>
<Form.Item label="验证码">
<Row gutter={10}>
<Col span={14}>
<Form.Item
......@@ -114,7 +115,7 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
noStyle
rules={[{ required: true, message: '请填写验证码' }]}
>
<Input />
<Input autoComplete="off" />
</Form.Item>
</Col>
<Col span={6}>
......@@ -124,16 +125,14 @@ const PhoneVerifyPanel: React.FC<IProps> = (props) => {
</Col>
</Row>
</Form.Item>
: null
}
{
!visible
? <div style={{marginBottom: '130px'}}>
<div style={{marginBottom: '130px'}}>
<SafeVerification handleVerifySuccess={handleVerifySuccess} />
</div>
</>
: null
}
{
visible
? <>
......
......@@ -65,6 +65,14 @@ const ResetPayCode: React.FC<IProps> = (props) => {
}
}
// 6位简单数字
const numberValidator = async (rule, value) => {
const pattern = /^\d{6}$/
if(!pattern.test(value)) {
throw new Error("请设置6位数字的密码")
}
}
// 支付密码
const renderPwd = () => {
return (
......@@ -77,7 +85,10 @@ const ResetPayCode: React.FC<IProps> = (props) => {
<Form.Item
name="password"
noStyle
rules={[{ required: true, message: "请填写支付密码"}]}
rules={[
{ required: true, message: "请填写支付密码"},
{ validator: numberValidator }
]}
>
<Input.Password />
</Form.Item>
......@@ -129,7 +140,7 @@ const ResetPayCode: React.FC<IProps> = (props) => {
noStyle
rules={[{ required: true, message: '请填写验证码' }]}
>
<Input />
<Input autoComplete="off"/>
</Form.Item>
</Col>
<Col span={6}>
......
......@@ -368,16 +368,20 @@ export const repositDetailSchema: ISchema = padRequiredMessage({
properties: {
name: {
type: 'string',
required: true,
// 'x-component': 'Input',
title: '仓位名称',
"x-component-props": {
placeholder: '建议名称:商品名称+商城名称+渠道描述'
},
"x-rules": [
{
required: true,
message: '请填写仓位名称'
},
{
limitByte: true,
maxByte: 60
}
},
]
},
shopType: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment