浏览代码

未获取地理位置授权不影响使用逻辑

xiaohaizhao 1 年之前
父节点
当前提交
15e4ce4dcc
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 3 3
      pages/index/index/index.vue
  2. 1 1
      utils/tool.js

+ 3 - 3
pages/index/index/index.vue

@@ -120,15 +120,15 @@ export default {
                 this.getLocationLoading = true;
                 this.getLocation().then(s => {
                     console.log("获取地理位置信息", s)
-                    resolve()
                     this.$Http.basic({
                         "id": 20240416153202,
                         "content": {
-                            "longitude": s.longitude,
-                            "latitude": s.latitude,
+                            "longitude": s ? s.longitude : '',
+                            "latitude": s ? s.latitude : '',
                             date: Date.now()
                         }
                     }).then(res => {
+                        resolve()
                         this.getLocationLoading = false;
                         this.showShopOtions = false;
                         console.log("获取最近门店信息", res)

+ 1 - 1
utils/tool.js

@@ -64,7 +64,7 @@ function mount() {
                                             title: "未获取到地理位置授权",
                                             icon: "none",
                                         })
-                                        resolve(true);
+                                        resolve();
                                     }
                                 }
                             })