123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <#assign title="${tittle!''}证"/>
- <#include "/home/frag.head.ftl" />
- <div class="weui-tab">
- <div class="weui-tab__bd">
- <div class="weui-tab__bd-item weui-tab__bd-item--active">
- <div class="page__bd">
- <header class="user-header">
- <br/>
- <br/>
- <br/>
- <br/>
- <p class="user-title-long-two">正在获取当前定位信息</p>
- <br/>
- <br/>
- <br/>
- </header>
- <br/>
- <#-- <div class="weui-form__opr-area">-->
- <#-- <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="map();" id="map">定位</a>-->
- <#-- </div>-->
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <#include "/home/frag.foot2.ftl" />
- <script>
- $(document).ready(function () {
- map();
- })
- function map() {
- $.ajax({
- url: '/wx/jsApiConfig',
- type: "get",
- data: {
- "url": location.href.split('#')[0]
- },
- success: function (data) {
- // alert(JSON.stringify(data.data))
- wx.config({
- debug: false,
- appId: data.data.appId,
- timestamp: data.data.timestamp,
- nonceStr: data.data.nonceStr,
- signature: data.data.signature,
- jsApiList: [
- // 所有要调用的 API 都要加到这个列表中
- 'getLocation'
- ]
- });
- wx.ready(function () {
- wx.checkJsApi({
- jsApiList: [
- 'getLocation'
- ],
- success: function (res) {
- if (res.checkResult.getLocation == false) {
- alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');
- return;
- }
- getLocation();
- }
- });
- wx.error(function(res){
- alert("接口调取失败")
- });
- });
- },
- });
- }
- function getLocation() {
- wx.getLocation({
- type: 'wgs84',
- success: function (res) {
- <#--var geocoder = new qq.maps.Geocoder({-->
- <#-- complete: function (result) {-->
- <#-- // alert(result.detail.addressComponents.district)-->
- <#-- // alert(JSON.stringify(result.detail.address))-->
- <#-- window.location.href = "${url}" + res.longitude + "%2C" + res.latitude + "%26address%3D" + result.detail.address + "${moreUrl}";-->
- <#-- }-->
- <#--})-->
- <#--var coord = new qq.maps.LatLng(res.latitude, res.longitude)-->
- <#--// alert(coord);-->
- <#--geocoder.getAddress(coord)-->
- window.location.href = "${url}" + res.longitude + "%2C" + res.latitude + "%26address%3D" + "${moreUrl}";
- // alert(JSON.stringify(coord));
- <#--window.location.href = "${url}" + res.longitude + "%2C" + res.latitude + "${moreUrl}";-->
- },
- cancel: function (res) {
- alert('用户拒绝授权获取地理位置');
- }
- });
- }
- </script>
|