更改账号格式

This commit is contained in:
red-deng-deng 2021-11-27 17:05:51 +08:00
parent 26dc0640f1
commit 791f470d80
4 changed files with 56 additions and 47 deletions

View File

@ -59,11 +59,11 @@ export default class adduserinfo extends React.Component{
], ],
contacts_phone:[ contacts_phone:[
{ type: "required", message: "请输入联系人手机号"}, { type: "required", message: "请输入联系人手机号"},
{ type: "regExp", message: "手机号格式不对",reg:"^[1][3,5,7,8][0-9]\\d{8}$"} { type: "regExp", message: "手机号格式不对",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"}
], ],
contacts_email:[ contacts_email:[
{ type: "required", message: "请输入联系人邮箱"}, { type: "required", message: "请输入联系人邮箱"},
{ type: "regExp", message: "联系人邮箱格式不",reg:"^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"} { type: "regExp", message: "联系人邮箱格式不正确",reg:"^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"}
], ],
sale: [ sale: [
{ type: "required", message: "请选择销售人员"}, { type: "required", message: "请选择销售人员"},
@ -267,7 +267,7 @@ export default class adduserinfo extends React.Component{
}else{ }else{
let contacts_email=[ let contacts_email=[
{ type: "required", message: "请输入联系人手机号码"}, { type: "required", message: "请输入联系人手机号码"},
{ type: "regExp", message: "手机号格式不对",reg:"^[1][3,5,7,8][0-9]\\d{8}$"} { type: "regExp", message: "手机号格式不对",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"}
] ]
let obj = {} let obj = {}

View File

@ -121,7 +121,7 @@ export default class adduserinfo extends React.Component{
], ],
account:[ account:[
{ type: "required", message: "请输入充值账号"}, { type: "required", message: "请输入充值账号"},
{ type: "regExp", message: "格式不对",reg:"^[1][3,5,7,8][0-9]\\d{8}$"} { type: "regExp", message: "格式不对",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"}
], ],
goodsname:[ goodsname:[
{ type: "required", message: "请输入商品名称"}, { type: "required", message: "请输入商品名称"},

View File

@ -307,11 +307,15 @@ export default class acclist extends React.Component{
if(this.state.email=="") if(this.state.email=="")
{ {
Notify.clear();
Notify.error("接收邮箱不能为空") Notify.error("接收邮箱不能为空")
return return
} }else{
let reg=/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
if(!reg.test(this.state.email)){
Notify.clear();
Notify.error("接收邮箱格式不正确")
}else{
let plan_id = row.id let plan_id = row.id
let data ={ let data ={
type:"email", type:"email",
@ -327,10 +331,8 @@ export default class acclist extends React.Component{
Notify.error(err) Notify.error(err)
}) })
}) })
}
}
}}>发送</Button>, }}>发送</Button>,
onClose() { onClose() {
console.log('outer dialog closed'); console.log('outer dialog closed');
@ -350,13 +352,17 @@ export default class acclist extends React.Component{
children: <Input placeholder="请输入接收手机号" onChange={self.phoneChange}></Input>, children: <Input placeholder="请输入接收手机号" onChange={self.phoneChange}></Input>,
footer: <Button onClick={ footer: <Button onClick={
()=>{ ()=>{
console.log("接受电话")
console.log(phone)
if(this.state.phone=="") if(this.state.phone=="")
{ {
Notify.clear();
Notify.error("接收手机号不能为空") Notify.error("接收手机号不能为空")
return return
} }else{
let reg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if(!reg.test(self.state.phone)){
Notify.clear()
Notify.error("接收手机号格式不正确")
}else{
let plan_id = row.id let plan_id = row.id
let data ={ let data ={
type:"sms", type:"sms",
@ -376,6 +382,9 @@ export default class acclist extends React.Component{
} }
}
}
}>发送</Button>, }>发送</Button>,
onClose() { onClose() {
console.log('outer dialog closed'); console.log('outer dialog closed');

View File

@ -335,7 +335,7 @@ export default class adduserinfo extends React.Component{
], ],
phone: [ phone: [
{ type: "required", message: "请输入手机号"}, { type: "required", message: "请输入手机号"},
{ type: "regExp", message: "手机号格式不正确",reg:"^[1][3,5,7,8][0-9]\\d{8}$"}, { type: "regExp", message: "手机号格式不正确",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"},
], ],
pwd:[ pwd:[
{ type: "required", message: "请输入密码"}, { type: "required", message: "请输入密码"},