From 9dac5101f4fd63eb85d7be1d4028fda765a090d0 Mon Sep 17 00:00:00 2001 From: devil Date: Mon, 14 Sep 2020 21:58:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BEdebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/QuickNavService.php | 10 ---------- sourcecode/weixin/app.js | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/application/service/QuickNavService.php b/application/service/QuickNavService.php index 24be84066..533771098 100755 --- a/application/service/QuickNavService.php +++ b/application/service/QuickNavService.php @@ -299,16 +299,6 @@ class QuickNavService if($v['event_type'] == 3) { $v['event_value_data'] = explode('|', $v['event_value']); - // 坐标转换 百度转火星(高德,谷歌,腾讯坐标) - if(isset($v['event_value_data'][2]) && isset($v['event_value_data'][3]) && in_array(APPLICATION_CLIENT_TYPE, config('shopxo.coordinate_transformation'))) - { - $map = \base\GeoTransUtil::BdToGcj($v['event_value_data'][2], $v['event_value_data'][3]); - if(isset($map['lng']) && isset($map['lat'])) - { - $v['event_value_data'][2] = $map['lng']; - $v['event_value_data'][] = $map['lat']; - } - } } $v['event_value'] = $v['event_value']; } else { diff --git a/sourcecode/weixin/app.js b/sourcecode/weixin/app.js index b3bcaa0c9..585a8ee1c 100755 --- a/sourcecode/weixin/app.js +++ b/sourcecode/weixin/app.js @@ -68,7 +68,7 @@ App({ // 请求地址 request_url: "{{request_url}}", request_url: 'http://shopxo.com/', - request_url: 'https://dev.shopxo.net/', + // request_url: 'https://dev.shopxo.net/', // 基础信息 application_title: "{{application_title}}", @@ -532,11 +532,12 @@ App({ return false; } + var map = this.BMapTransqqMap(parseFloat(values[2]), parseFloat(values[3])); wx.openLocation({ name: values[0], address: values[1], - longitude: parseFloat(values[2]), - latitude: parseFloat(values[3]) + longitude: map.lng, + latitude: map.lat }); break; @@ -801,4 +802,18 @@ App({ }, 100); }, + BMapTransqqMap(lng, lat) { +   let x_pi = 3.14159265358979324 * 3000.0 / 180.0; +   let x = lng - 0.0065; +   let y = lat - 0.006; +   let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); +   let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); +   let lngs = z * Math.cos(theta); +   let lats = z * Math.sin(theta); +   return { +     lng: lngs, +     lat: lats +   }; + }, + }); \ No newline at end of file