Browse Source

Merge branch 'xqc_telarea'

jwyu 2 years ago
parent
commit
10d2a55c1a
2 changed files with 18 additions and 27 deletions
  1. 5 0
      api/common.js
  2. 13 27
      pages/login.vue

+ 5 - 0
api/common.js

@@ -78,4 +78,9 @@ export const apiUserBindPermission=()=>{
  */
 export const apiViewLogUpdate=params=>{
     return httpPost('/public/view_log/update',params)
+}
+
+// 获取手机号区号列表
+export const apiTelAraeNumList=()=>{
+    return httpGet('/public/tel_area_list',{})
 }

+ 13 - 27
pages/login.vue

@@ -77,39 +77,14 @@
 </template>
 
 <script>
-import { apiGetSMSCode, apiGetEmailCode,apiGetWechatPhone } from '@/api/common'
+import { apiGetSMSCode, apiGetEmailCode,apiGetWechatPhone,apiTelAraeNumList } from '@/api/common'
 import { apiUserLogin } from '@/api/user'
 import { telVerify, emailVerify } from '@/utils/common'
 export default {
     data() {
         return {
             active: "手机号",
-            telAreaList: [
-                {
-                    name: "大陆+86",
-                    value: "86",
-                },
-                {
-                    name: "香港+852",
-                    value: "852",
-                },
-                {
-                    name: "台湾+886",
-                    value: "886",
-                },
-                {
-                    name: "美国+1",
-                    value: "1",
-                },
-                {
-                    name: "新加坡+65",
-                    value: "65",
-                },
-                {
-                    name: "雅加达+62",
-                    value: "62",
-                },
-            ], //手机号区号
+            telAreaList: [], //手机号区号
             telAreaIndex: 0, //选择手机号区号第几个
             tel: "",//手机号
             email: "",//邮箱
@@ -118,6 +93,9 @@ export default {
             countDownTime: 60 * 1000,//倒计时60秒
         };
     },
+    onLoad(){
+        this.getPhoneAreaNumList()
+    },
     onShow(){
         uni.hideHomeButton({
 			fail(res){
@@ -242,6 +220,14 @@ export default {
                 this.$store.dispatch('getTabBar')
             }
 
+        },
+
+        // 获取区号
+        async getPhoneAreaNumList(){
+            const res=await apiTelAraeNumList()
+            if(res.code===200){
+                this.telAreaList=res.data||[]
+            }
         }
     },
 };