审查视图

public/themes/simpleboot3/portal/contact/lianxi.html 6.7 KB
anyv authored
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>聯係我們</title>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hG4FuySg0nLRGkY8pQZsGQVA8jCb81F3"></script>
    <style>
        .BMapLabel{
            width: 173px;
            height: 20px;
            margin-top: -10px !important;
            margin-left: 10px !important;
            /*padding-left: 10px !important;*/
            line-height: 24px !important;
            text-align: center !important;
            /*border: 1px solid black !important;*/
        }
        #map{
            margin-top:35px;
        }
        .anchorBL{
            display: none !important;
        }
    </style>
</head>
<body>
<div class="box2">
    <!--header-->
    <header>
        <include file="public@nav"/>
    </header>
    <!-- 侧边导航-->
    <div class="banner_aside banner_aside2">
        <include file="public@header"/>
    </div>
    <!--main-->
    <div class="ab2_main">
        <div class="contact_box">
            <div class="ab2_title" style="border:0">
                <a href="">首頁</a>
                <span> > </span>
                <a href="">聯係我們</a>
            </div>
            <div class="ab2_con">
                <div class="contact_tit">
                    <h2>聯係我們</h2>
                    <p><span>/</span>CONTACT US</p>
                </div>
                <div style="width:1054px;height:449px;border:#ccc solid 1px;font-size:12px" id="map"></div>
            </div>
            <div class="contact_con">
                <div class="contact_con_left">
                    <h2>澳德綜合健康中心有限公司 </h2>
                    <div class="contact_con_left1">
                        <p>地址 : 香港九龍灣臨澤街8號傲騰廣場25樓</p>
                        <p>電話 : (852) 2582 0188</p>
                        <p>傳真 : (852) 2582 0199</p>
                        <p>電郵 : info@medisun.hk</p>
                    </div>
                </div>
                <div class="contact_con_right">
                        <ul>
                            <li>
                                <label>
                                    姓名
                                </label>
                                <input type="text" class="inpTxt" name="name">
                            </li>
                            <li>
                                <label>電話</label>
                                <input type="text" class="inpTxt" name="phone">
                            </li>
                            <li>
                                <label>郵箱</label>
                                <input type="text" class="inpTxt" name="email">
                            </li>
                        </ul>
                        <div class="contact_tarea">
                            <p>內容</p>
                            <textarea id="content"></textarea>
                        </div>
                        <button type="button" onclick="add()" class="contact_btn">提交</button>
                </div>
            </div>
        </div>
    </div>
    <!--footer-->
    <footer>
        <include file="public@footer"/>
    </footer>
</div>

<script>
    //点击提交客户资料
    function add(){
        name = $("input[name='name']").val();
        phone = $("input[name='phone']").val();
        email = $("input[name='email']").val();
        content = $('#content').val();
        if(phone==''){
            alert('请填写姓名电话');
        }else{
            if(name==''){
                alert('请填写姓名电话');
            }else{
                $.post("{:url('Contact/lx_add')}",{name:name,phone:phone,email:email,content:content},function(data){
                    alert('提交成功');
                });
            }
        }

    }
</script>

<script type="text/javascript" src="__TMPL__/public/assets/js/jquery.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/index.js"></script>
<script type="text/javascript">
    $('.inpTxt').each(function () {
        $(this).focus(function(){
            $(this).parents("li").css('border-bottom','1px solid #E29C6D')
        });
    });
    $('.inpTxt').each(function () {
        $(this).blur(function(){
            $(this).parents("li").css('border-bottom','1px solid rgba(230,230,230,1)')
        });
    });


    //创建和初始化地图函数:
    function initMap(){
        createMap();//创建地图
        setMapEvent();//设置地图事件
        addMapControl();//向地图添加控件
        addMapOverlay();//向地图添加覆盖物
    }
    function createMap(){
        map = new BMap.Map("map");
        map.centerAndZoom(new BMap.Point("{$data.jingdu}","{$data.weidu}"),16);
    }
    function setMapEvent(){
        map.enableScrollWheelZoom();
        map.enableKeyboard();
        map.enableDragging();
        map.enableDoubleClickZoom()
    }
    function addClickHandler(target,window){
        target.addEventListener("click",function(){
            target.openInfoWindow(window);
        });
    }
    function addMapOverlay(){
        var markers = [
            {content:"{$data.address}",title:"{$data.title}",imageOffset: {width:-46,height:-21},position:{lat:22.337395,lng:114.176184}},
        ];
        for(var index = 0; index < markers.length; index++ ){
            var point = new BMap.Point(markers[index].position.lng,markers[index].position.lat);
            var marker = new BMap.Marker(point,{icon:new BMap.Icon("http://api.map.baidu.com/lbsapi/createmap/images/icon.png",new BMap.Size(20,25),{
                imageOffset: new BMap.Size(markers[index].imageOffset.width,markers[index].imageOffset.height)
            })});
            var label = new BMap.Label(markers[index].title,{offset: new BMap.Size(25,5)});
            var opts = {
                width: 200,
                title: markers[index].title,
                enableMessage: false
            };
            var infoWindow = new BMap.InfoWindow(markers[index].content,opts);
            marker.setLabel(label);
            addClickHandler(marker,infoWindow);
            map.addOverlay(marker);
        };
        var labels = [
        ];
        for(var index = 0; index < labels.length; index++){
            var opt = { position: new BMap.Point(labels[index].position.lng,labels[index].position.lat )};
            var label = new BMap.Label(labels[index].content,opt);
            map.addOverlay(label);
        };
    }
    //向地图添加控件
    function addMapControl(){
        var navControl = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:2});
        map.addControl(navControl);
    }
    var map;
    initMap();
</script>
</body>
</html>