chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<title>{yun:}$title{/yun}</title>
<meta name="keywords" content="{yun:}$keywords{/yun},wap" />
<meta name="description" content="{yun:}$description{/yun}" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width" initial-scale="1"/>
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no, width=device-width"/>
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/css.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/job.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/map.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/base.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
    <script src="{yun:}$wap_style{/yun}/js/flexible.js?v={yun:}$config.cachecode{/yun}"></script>
 
</head>
<body>
<header>
   <div class="headerpx" >
    <div class="headerpx_bg {yun:}if $tplmoblie.color{/yun}bg{yun:}$tplmoblie.color{/yun}{yun:}/if{/yun}"> <a class="hd-lbtn" href="javascript:goBack();"><i class="headerpx_top_l"></i></a>
       <div class="headerpx_h1">{yun:}$headertitle{/yun}</div>
     </div>
  </div>
 </header>
<div id="allmap"></div>
<div class="jobmap_box_footer">
    <div class="jobmap_box">
    <div class="jobmap_comname">{yun:}$com.name{/yun}</div>
    <div class="jobmap_comsdd">{yun:}$com.address{/yun}  </div>
    </div>
    <div class="jobmap_box_look">
    <a href="javascript:void(0);" onclick="way('{yun:}$com.name{/yun}','{yun:}$cityname{/yun}')">查看路线</a>
    </div>
</div>
<input type="hidden" id="map_x" value="{yun:}$mapx{/yun}"/>
<input type="hidden" id="map_y" value="{yun:}$mapy{/yun}"/>
<style type="text/css">
    * {margin: 0; padding: 0}
    html,body {width: 100%;height: 100%;}
    #allmap {width: 100%;height: 80%;overflow: hidden;margin:0;}
</style>
<script src="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/prefixfree.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$wap_style{/yun}/js/jquery.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script src="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<script type="text/javascript" src="{yun:}$config.mapurl{/yun}"></script>
<script type="text/javascript">
    var wapurl = '{yun:}url m=wap{/yun}';
    // 百度地图API功能
    var x = '{yun:}$com.x{/yun}';
    var y = '{yun:}$com.y{/yun}';
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(x, y);
    map.centerAndZoom(point, 15);
    var marker = new BMap.Marker(point);  // 创建标注
    map.addOverlay(marker);               // 将标注添加到地图中
 
    var map_x = $("#map_x").val();
    var map_y = $("#map_y").val();
    setTimeout(function(){
        if(map_x==0 && map_y==0){
            var geolocation = new BMap.Geolocation();
            geolocation.getCurrentPosition(function (r) {
                if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                    $.post(wapurl+'index.php?c=job&a=distance',{x:r.point.lng,y:r.point.lat},function(data){})
                    $("#map_x").val(r.point.lng);
                    $("#map_y").val(r.point.lat);
                }
                else {
                    if (this.getStatus() == "6") {
                        showToast("开启手机定位后才能使用此功能",2);return false;
                    }else if (this.getStatus() == "7") {
                        showToast("开启手机定位后才能使用此功能",2);return false;
                    }else {
                        showToast("地图定位出错",2);return false;
                    }
                }
            }, { enableHighAccuracy: true })
        }
    },1000);
 
    function way(name,cityname){
        var map_x=$("#map_x").val(),map_y=$("#map_y").val();
        if(map_x>0 && map_y>0){
            location.href = 'https://api.map.baidu.com/direction?origin=latlng:' + parseFloat(map_y).toFixed(5) + ',' + parseFloat(map_x).toFixed(5) + '|name:当前位置&destination=latlng:' + parseFloat(y).toFixed(5) + ',' + parseFloat(x).toFixed(5) + '|name:'+ name +'&mode=driving&region='+ cityname +'&output=html';
        }else{
            showToast('正在定位中,请稍候!');
        }
    }
</script>
</body>
</html>