xiaohaizhao 2 лет назад
Родитель
Сommit
63a89160ad
2 измененных файлов с 11 добавлено и 4 удалено
  1. 10 3
      packageA/clockIn/signIn.js
  2. 1 1
      packageA/clockIn/signIn.wxml

+ 10 - 3
packageA/clockIn/signIn.js

@@ -243,7 +243,7 @@ Page({
                 latitude,
                 longitude
             }) {
-                wx.hideLoading();
+                console.log('精确', latitude, longitude)
                 that.setData({
                     'markers[0]': {
                         id: 1,
@@ -251,6 +251,15 @@ Page({
                         longitude,
                     }
                 });
+            }
+        })
+        wx.getLocation({
+            success({
+                latitude,
+                longitude
+            }) {
+                console.log('bu精确', latitude, longitude)
+                wx.hideLoading();
                 _Http.basic({
                     "id": "10027201",
                     "content": {
@@ -274,8 +283,6 @@ Page({
                             city: result.addressComponent.city,
                             county: result.addressComponent.district,
                             address: result.formatted_address,
-                            longitude,
-                            latitude,
                             remarks: "",
                             sa_projectid: 0,
                             sys_enterpriseid: 0

+ 1 - 1
packageA/clockIn/signIn.wxml

@@ -1,4 +1,4 @@
-<map class="map" latitude="{{markers[0].latitude}}" longitude="{{markers[0].longitude}}" markers="{{markers}}" scale="17" enable-poi />
+<map class="map" show-location latitude="{{markers[0].latitude}}" longitude="{{markers[0].longitude}}"  scale="17" enable-poi /><!-- markers="{{markers}}" -->
 <view class="head">
     <view class="main">
         <view class="time">{{time}}</view>