|
@@ -25,6 +25,7 @@ import ShopBox from './components/ShopBox';
|
|
import TopicTitle from './components/TopicTitle';
|
|
import TopicTitle from './components/TopicTitle';
|
|
import ScrollRow from './components/ScrollRow';
|
|
import ScrollRow from './components/ScrollRow';
|
|
import http_user from './services/user';
|
|
import http_user from './services/user';
|
|
|
|
+import commonutil from './utils/commonutil';
|
|
|
|
|
|
export default class PhoneBind extends BasePage {
|
|
export default class PhoneBind extends BasePage {
|
|
state = {
|
|
state = {
|
|
@@ -105,7 +106,7 @@ export default class PhoneBind extends BasePage {
|
|
|
|
|
|
getVerification() {
|
|
getVerification() {
|
|
if (this.state.verification_text === '获取验证码') {
|
|
if (this.state.verification_text === '获取验证码') {
|
|
- if (this.isPoneAvailable(this.state.phone_num)) {
|
|
|
|
|
|
+ if (commonutil.isPoneAvailable(this.state.phone_num)) {
|
|
http_user.getVerificationCode(this.state.phone_num).then((result) => {
|
|
http_user.getVerificationCode(this.state.phone_num).then((result) => {
|
|
if (result.code != 200) {
|
|
if (result.code != 200) {
|
|
ToastAndroid.show(result.message, ToastAndroid.SHORT);
|
|
ToastAndroid.show(result.message, ToastAndroid.SHORT);
|
|
@@ -144,18 +145,6 @@ export default class PhoneBind extends BasePage {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //验证手机号
|
|
|
|
- isPoneAvailable(str) {
|
|
|
|
- let myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
|
|
|
|
- if (str.length == 0 || str == null) {
|
|
|
|
- return false;
|
|
|
|
- } else if (!myreg.test(str)) {
|
|
|
|
- return false;
|
|
|
|
- } else {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//绑定手机号
|
|
//绑定手机号
|
|
clickOK() {
|
|
clickOK() {
|
|
if (this.state.http_verification_code == this.state.verification_code) {
|
|
if (this.state.http_verification_code == this.state.verification_code) {
|