blood.html 5.3 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" href="css/blood.css"/>
    <link rel="stylesheet" type="text/css" href="css/jquery-labelauty.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <script src="js/base.js" type="text/javascript" charset="utf-8"></script>
    <title>记血糖</title>
</head>

<body>
<div style="background-color:#fff;">
    <div class="perheader center">
        <div class="left perback"><a href="#" onClick="javascript:history.back(-1);"><img src="images/care_03.jpg"/></a>
        </div>
        <div class="bloodtext">记血糖</div>
    </div>
</div>
<div class="perpart1 center">
    <div style="position: relative;color: #fff;top: 2.5rem;">mmol/L</div>

    <div id="background"
         style="background-color:#d8b25f;color:#FFF;padding:10px; border-radius:50%; display:inline-block;margin-top:20px;">
        <input type="text" step="0.1" name="test" class="knob" data-width="270" data-fgColor="#fff" data-skin="tron"
               data-thickness=".1" value="2.5">
    </div>

    <form action="#">
        <div class="blli">
            <ul class="dowebok">
                <li><input type="radio" name="radio" data-id="1" class="time_type" data-labelauty="空腹"></li>
                <li><input type="radio" name="radio" data-id="2" class="time_type" data-labelauty="早餐后"></li>
                <li><input type="radio" name="radio" data-id="3" class="time_type" data-labelauty="午餐前"></li>
                <li><input type="radio" name="radio" data-id="4" class="time_type" data-labelauty="午餐后"></li>
                <li><input type="radio" name="radio" data-id="5" class="time_type" data-labelauty="晚餐前"></li>
                <li><input type="radio" name="radio" data-id="6" class="time_type" data-labelauty="晚餐后"></li>
                <li><input type="radio" name="radio" data-id="7" class="time_type" data-labelauty="睡前"></li>
                <li><input type="radio" name="radio" data-id="8" class="time_type" data-labelauty="凌晨"></li>
            </ul>
        </div>
</div>

<div class="bltime">
    <input id="endTime" class="kbtn" style="font-size:0.22rem;" value="2018-01-20 18:03"/><span class="right">></span>
</div>
<div>
    <button type="button" class="blbut"/>
    保存
</div>
</form>
<div id="datePlugin"></div>
<script type="text/javascript" src="js/axios.min.js"></script>
<script type="text/javascript" src="js/common.js"/>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquery-labelauty.js"></script>
<script src="js/jquery.knob.js"></script>

<script type="text/javascript" src="js/date.js"></script>
<script type="text/javascript" src="js/iscroll.js"></script>
<script type="text/javascript">
    $(function () {
        $('#endTime').date({theme: "datetime"});
    });

    $(function () {
        $(".knob").knob();
    });

    $(function () {
        $(':input').labelauty();
    });
    var time_type;
    var type_sugar;
    var endTime;
    $(document).ready(function () {
        $('.time_type').click(function () {
            time_type = $(this).attr('data-id')
        })
        $('.blbut').click(function () {
            type_sugar = $('.knob').val()
            endTime = $('#endTime').val();
            var time3 = Date.parse(endTime);
            time3 = time3 / 1000;
            var post = {
                rid: 0,
                time_type: time_type,
                time: time3,
                type: 1,
                data: type_sugar,
            };
            var header = {
                "XX-Device-Type": '1',
                "XX-Token": '1',
            }
            if (type_sugar != '' && endTime != '' && time3 != '') {
                getRequest('post', "user/index/setBoolData", post, header).then(function (res) {
                    alert(res)
                })
            } else {
                return false;
            }
            // $.ajax({
            //     type:"POST",
            //     url: "http://kindapp.w.bronet.cn/api/user/index/setBoolData",
            //     dataType:"json",
            //     headers:{
            //         ""XX-Device-Type"":'1',
            //         "Token":'1',
            //         "Accept":'application/json;text/plain',
            //         // "Content-Type":"text/plain;charset=UTF-8"
            //         "Content-Type": 'application/x-www-form-urlencoded'
            //     },
            //     data:{
            //         rid:0,
            //         time_type:time_type,
            //         time:time3,
            //         type:1,
            //         data:type_sugar,
            //     },
            //     success:function (res) {
            //         console.log(res.data)
            //     }
            // })

        })
    })
</script>