验证客服电话

public regPhone = /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;
public reg400 = /^400-[0-9]{7}/;
public reg800 = /^800-[0-9]{7}/;
public regTel = /^0[0-9]{2,3}-[0-9]{8}/;
if (!(this.regPhone.test(this.templatePhone) || this.regTel.test(this.templatePhone) || this.reg400.test(this.templatePhone) || this.reg800.test(this.templatePhone))) {
  this.nzModalService.error({
  title: '请填写正确的客服电话'
});
  return false;
}
posted @ 2018-12-18 15:19  前端小厨-美食博主  阅读(337)  评论(0编辑  收藏  举报