From ffd81783b3975f8bb57f1c2b1141fa586d0a9228 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Tue, 16 Apr 2019 15:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/view/default/public/header.html | 1 + application/plugins/petscms/Pets.php | 11 ++++++++++- application/plugins/view/petscms/pets/helpmap.html | 4 ++-- public/static/plugins/css/petscms/pets.css | 5 +++-- public/static/plugins/js/petscms/pets.js | 3 ++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/application/index/view/default/public/header.html b/application/index/view/default/public/header.html index c115c54c8..ca9e895cf 100755 --- a/application/index/view/default/public/header.html +++ b/application/index/view/default/public/header.html @@ -50,6 +50,7 @@ var __default_theme__ = '{{$default_theme}}'; var __modal_login_url__ = '{{:Url("index/user/modallogininfo")}}'; var __attachment_host__ = '{{$attachment_host}}'; + var __seo_url_suffix__ = '{{:MyC("home_seo_url_html_suffix", "html", true)}}'; var __user_id__ = {{if empty($user['id'])}}0{{else /}}{{$user.id}}{{/if}}; diff --git a/application/plugins/petscms/Pets.php b/application/plugins/petscms/Pets.php index 3ab06068c..339bc51bb 100644 --- a/application/plugins/petscms/Pets.php +++ b/application/plugins/petscms/Pets.php @@ -265,7 +265,16 @@ class Pets extends Controller $this->assign('is_footer', 0); // 参数 - $this->assign('params', input()); + $params = input(); + if(!empty($params['lng'])) + { + $params['lng'] = base64_decode($params['lng']); + } + if(!empty($params['lat'])) + { + $params['lat'] = base64_decode($params['lat']); + } + $this->assign('params', $params); return $this->fetch('../../../plugins/view/petscms/pets/helpmap'); } } diff --git a/application/plugins/view/petscms/pets/helpmap.html b/application/plugins/view/petscms/pets/helpmap.html index 2e7d66337..e9e03d976 100644 --- a/application/plugins/view/petscms/pets/helpmap.html +++ b/application/plugins/view/petscms/pets/helpmap.html @@ -1,7 +1,7 @@ {{include file="public/header" /}} {{if !empty($params['lng']) and !empty($params['lat']) and $params['lng'] gt 0 and $params['lat'] gt 0}} -
+
{{else /}}
参数有误
{{/if}} @@ -17,7 +17,7 @@ { // 丢失地址-地图展示 var map = new BMap.Map("help-map", {enableMapClick:false}); - var level = $('#help-map').data('level') || 16; + var level = 17; var point = new BMap.Point({{$params['lng']}}, {{$params['lat']}}); map.centerAndZoom(point, level); diff --git a/public/static/plugins/css/petscms/pets.css b/public/static/plugins/css/petscms/pets.css index ea8474586..3df5ea7bb 100644 --- a/public/static/plugins/css/petscms/pets.css +++ b/public/static/plugins/css/petscms/pets.css @@ -73,6 +73,7 @@ form.form-validation #map { /** * 帮助页面 */ -.pets-help #help-map { - height: 80vh; +#help-map { + width: 100%; + height: 100vh; } \ No newline at end of file diff --git a/public/static/plugins/js/petscms/pets.js b/public/static/plugins/js/petscms/pets.js index 5097645b5..dede4f049 100644 --- a/public/static/plugins/js/petscms/pets.js +++ b/public/static/plugins/js/petscms/pets.js @@ -7,7 +7,8 @@ $(function() var lat = parseFloat($(this).data('lat')); if(lng > 0 && lat > 0) { - var url = UrlFieldReplace('lat', lat, UrlFieldReplace('lng', lng, $('.pets-help').data('url'))); + // 数据base64避免特殊字符 + var url = UrlFieldReplace('lat', window.btoa(lat), UrlFieldReplace('lng', window.btoa(lng), $('.pets-help').data('url'))); ModalLoad(url, '地图', 'plugins-petscms-popup-modal-help'); } });