index.html 7.4 KB
<!doctype html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/health.css">
    <script src="js/fontsize.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-1.2.6.min.js"></script>
    <script type="text/javascript"
            src="http://api.map.baidu.com/api?v=2.0&ak=lkZq5ygd4fVbdFXgPggklV2GwTjW5PGh"></script>
    <!--<script src="js/t.js"></script>-->

    <script language="javascript">
        setInterval("onclick()", 10000);

        function onclick() {
            $("ul.jcarouseLiteNav li.next").click();
        }
    </script>
    <style>
        .c-dropdown__list1 {
            padding: 6px 0;
            list-style: none;
            position: absolute;
            top: 0.88rem;
            right: 0.25rem;
            display: none;
            border-radius: 3px;
            background: #fff;
            -webkit-transition: opacity .25s linear, top .25s linear;
            transition: opacity .25s linear, top .25s linear;
        }

        .inshare {
            font-size: 0;
        }

        .smalltop {
            font-size: 0;
            position: absolute;
            top: -0.1rem;
            right: 0.5rem;
            z-index: 99;
        }

        .smalltop img {
            width: 0.11rem;

        }

        .c-button {
            display: flex;
            align-items: center;
            justify-content: center;
        }
    </style>
    <title>首页</title>
</head>
<body>
<div id="container"></div>
<div class="head">
    <div class=" address"><a href="#"><img src="images/address_03.png"/></a><span id="city"></span></div>
    <div class="htitle" style="left:0.25rem;">慈界医养</div>
    <div class=" inshare margin0">
        <div class="c-dropdown js-dropdown" id="gg">
            <span class="c-button  padding0"><a href="#" onclick="show()"><img src="images/share.png"
                                                                                id="target"/></a></span>
        </div>
    </div>
    <ul id="show_menu" class="c-dropdown__list1">
        <div class="smalltop"><img src="images/oi.png"/></div>
        <li class="c-dropdown__item"><a href="#"><img src="images/dingdan.png"/>我的订单</a></li>
        <li class="c-dropdown__item"><a href="#"><img src="images/sc.png"/>健康档案</a></li>
        <li class="c-dropdown__item"><a href="#"><img src="images/zxkf.png"/>客服服务</a></li>
        <li class="c-dropdown__item"><a href="#"><img src="images/fb.png"/>认购权益</a></li>
        <li class="c-dropdown__item"><a href="#"><img src="images/ss.png"/>扫一扫</a></li>
    </ul>
</div>
<div class="part1">
    <div class="nav center" style="display:inline-block;">
        <ul>
        </ul>
    </div>
</div>

<div class="part2">
    <a href="#"><img src="images/index_02.jpg"/></a>
</div>

<div class="part3">
    <div style="display:inline-block;">
        <ul>
        </ul>
    </div>
</div>

<!--part4 start-->
<div class="part4">
    <div class="kuang">
        <div class="title4 box" id="sales-product">
            <span style="position:relative; left:0.45rem;">
            	<img src="images/part4_03.jpg"/>严选推介<img src="images/part4_05.jpg"/>
            </span>
        </div>

        <div class="js j_index_carouseProduct" id="sales-product-main">
            <ul>

            </ul>
            <div class="clear"></div>
        </div>
    </div>
</div>
<!--part4 end-->


<!--footer-->
<div class="footer center">
    <ul style="font-size:0;">
        <li><a href="index.html"><img src="images/yanxuan.png"/></a></li>
        <li><a href="#"><img src="images/footer_05.jpg"/></a></li>
        <li><a href="#"><img src="images/footer_07.jpg"/></a></li>
    </ul>
</div>
<!--footer end-->
</body>
</html>
<script src="js/common.js"></script>
<script>
    var map = new BMap.Map("container");
    var geolocation = new BMap.Geolocation();
    var geoc = new BMap.Geocoder();
    geolocation.getCurrentPosition(function (r) {
        if (this.getStatus() == BMAP_STATUS_SUCCESS) {
            var mk = new BMap.Marker(r.point);
            map.addOverlay(mk);
            map.panTo(r.point);
            // alert('您的位置:' + r.point.lng + ',' + r.point.lat);
            geoc.getLocation(new BMap.Point(r.point.lng, r.point.lat), function (rs) {
                var addComp = rs.addressComponents;
                // alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
                $('#city').text(addComp.province)
            });
        }
        else {
            alert('failed' + this.getStatus());
        }
    }, {enableHighAccuracy: true})
</script>
<script>
    $(document).ready(function () {
        sendAjax('post', 'portal/index/cat', null, null, function (res) {
            let cat_data = res;
            let html = '';
            if (cat_data.code == 1) {
                for (let i in cat_data.data) {
                    html += `<li data-id="${cat_data.data[i].id}">  <a href="#"> <img src="${cat_data.data[i].img}"/> <p>${cat_data.data[i].name}</p></a></li>`
                }
                $('.nav ul').append(html);
                $('.nav ul li').click(function () {
                    var li_id = $(this).attr('data-id');
                    if (li_id == 1) {
                        window.location.href = './protect.html?id=' + li_id
                    }
                })
            } else {
                console.log(res.msg)
            }
        });
        sendAjax('post', 'portal/index/index', null, null, function (res) {
            let index_data = res;
            let html = '';
            if (index_data.code == 1) {
                for (let j in index_data.data) {
                    html += `<li> <a href="#"> <div class="text3"><p class="title3">${index_data.data[j].title}</p><p class="context3">${index_data.data[j].describe}</p> </div> <img src="${index_data.data[j].img}" class=""/></a></li>`
                }
                $('.part3 ul').append(html)
            }
        });
        sendAjax('post', 'portal/index/show', null, null, function (res) {
            // console.log(res);
            let show_data = res;
            let html = '';
            if (show_data.code == 1) {
                for (let i in show_data.data) {
                    for (let j in show_data.data[i]) {
                        // console.log()
                        html += `<li id="d${parseInt(j) + 1}"> <div class="con4"> <div class="con4li"> <a href="#"><img class="left" src="${show_data.data[i][j].img}"/></a> <div class="corigt left"> <a href="#"><span>${show_data.data[i][j].title}</span> <p>${show_data.data[i][j].describe}</p></a> <p class="minute"><span><img src="images/min.jpg"/>60分钟</span><span><img src="images/support.jpg"/>562人选择</span> </p><p class="price">${show_data.data[i][j].price}</p></div></div></div></li>`
                    }
                }
                $('.j_index_carouseProduct ul').append(html);
            }
        })
    })
</script>