我无法输入电话号码,原因是js代码中存在电子邮件验证错误。我应该如何更改代码以输入电话号码
https://github.com/moltin/react-demo-store
/production.min.js
function validate(a, b) {
var c = "";
return a.find(":input[required], textarea[required], select[required]").each(function() {
var a = $(this),
b = a.attr("type"),
d = $.trim(a.val()),
e = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im,
f = /^(?=.*[0-9]).{6,}$/,
g = /^[0-9]+$/;
0 !== d.length ? "email" !== b || e.test(d) ? "number" !== b && "tel" !== b || "card-number" === a.attr("name") || g.test(d) ? "password" !== b || f.test(d) || "ignore" === a.attr("data-validate") ? (a.is("select") && 0 !== a.next(".select2").length && (a = a.next(".select2").find(".select2-selection")), validEntry(a, !0)) : (c = "Passwords must contain 6 characters including at least one number", validEntry(a, !1)) : (c = "Only numbers use numbers in the invalid field", validEntry(a, !1)) : (c = "Invalid number", validEntry(a, !1)) : (c = "Please enter content into the field", a.is("select") && (c = "Please select a value from the drop down list", 0 !== a.next(".select2").length && (a = a.next(".select2").find(".select2-selection"))), validEntry(a, !1))
}), errorHandling(a, c, b)
}
/checkoutForm.js行141->
<label className="input-wrap email required">
<span className="hide-content">phone number</span>
<Field
component="input"
className="email"
required="required"
placeholder="phone number"
name="email"
type="text"
aria-label="email"
/>