xiabx 5 роки тому
батько
коміт
e531da9e32
3 змінених файлів з 10 додано та 8 видалено
  1. 1 6
      src/api/utils.js
  2. 8 1
      src/helper/interface.js
  3. 1 1
      src/views/Phone/index.ux

+ 1 - 6
src/api/utils.js

@@ -175,12 +175,7 @@ export const downImg = photoPath => {
     fail: () => { }
   });
 };
-//校验手机号
-export const validatePhone = phone => {
-  const VALIDATE_REG = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[0-9]|18[0-9]|14[57]|19[89])[0-9]{8}$/;
-  const isMobile = VALIDATE_REG.test(phone);
-  return isMobile;
-};
+
 //存储期限storge
 export const setStore = (key, value) => {
   if (!key) return;

+ 8 - 1
src/helper/interface.js

@@ -27,6 +27,12 @@ const getAppDev = fn => {
     }
   });
 };
+//校验手机号
+const validatePhone = phone => {
+  const VALIDATE_REG = /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[0-9]|18[0-9]|14[57]|19[89])[0-9]{8}$/;
+  const isMobile = VALIDATE_REG.test(phone);
+  return isMobile;
+};
 //获取是否创建图标
 const getShortCut = fn => {
   shortcut.hasInstalled({
@@ -95,5 +101,6 @@ export default {
   showMenu,
   getShortCut,
   getAppInfo,
-  getAppDev
+  getAppDev,
+  validatePhone
 };

+ 1 - 1
src/views/Phone/index.ux

@@ -14,7 +14,7 @@
   </div>
 </template>
 <script>
-import { validatePhone ,getSendOrderId } from '../../api/utils';
+import { validatePhone  } from '../../helper/interface';
 import { sendCode, userBind } from '../../api/index';
 import router from '@system.router';
 import prompt from '@system.prompt';