my_income.html 4.7 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">
    <link rel="stylesheet" href="../assets/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_724456_0m7h09j73i3.css">
    <script type="text/javascript" src="../assets/js/fontsize.js"></script>
    <link rel="stylesheet" href="../assets/css/weui.min.css">
    <link rel="stylesheet" href="../assets/css/style.css">
    <title>收入记录</title>
    <style>
        body {
            background-color: #f7f7f7;
        }
    </style>
</head>
<body>
<div class="mypay_top" style="background-image: url('../assets/imgs/bg.png')">
    <div class="mypay_title">收入总计</div>
    <div class="all_income">全部记录</div>
    <div class="mymoney">
        <span class="money_span">0.00</span><span></span>
    </div>
</div>
<div class="income_next">
    <div class="income_left">
        <div style="position: relative">
            <div class="income_icon">
                <img src="../assets/imgs/income_icon.png" alt="">
            </div>
            <input type="text" placeholder="开始时间" id="txt_dateStart">
        </div>
        <div style="position: relative">
            <input type="text" placeholder="结束时间" id="txt_dateEnd">
            <div class="income_icon">
                <img src="../assets/imgs/income_icon.png" alt="">
            </div>
        </div>
    </div>
    <div class="choose">检索</div>
</div>
<div class="income_item">
    <div class="income_itemleft">
        <div>收入</div>
        <div class="income_time">2018-3-27</div>
    </div>
    <div class="income_itemright">
        + 15
    </div>
</div>
<div class="income_item">
    <div class="income_itemleft">
        <div>收入</div>
        <div class="income_time">2018-3-27</div>
    </div>
    <div class="income_itemright">
        + 15
    </div>
</div>
<div class="income_item">
    <div class="income_itemleft">
        <div>收入</div>
        <div class="income_time">2018-3-27</div>
    </div>
    <div class="income_itemright">
        + 15
    </div>
</div>
<script type="text/javascript" src="../assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../assets/js/weui.min.js"></script>
<script type="text/javascript" src="../assets/js/Augly_Verification.js"></script>
<script type="text/javascript" src="../assets/js/common.js"></script>
<script>
    $('#txt_dateStart').on('focus', function () {
        var dt = new Date();
        var df= [dt.getFullYear(), (dt.getMonth() + 1), dt.getDate()];
        var id=dt.getFullYear()+""+dt.getMonth() +""+dt.getDate()+""+dt.getHours()+""+ dt.getMinutes()+""+dt.getSeconds();

        var value=$.trim($("#txt_dateStart").val());
        if(value!="")
        {
            var arrays = value.split("-");
            df= [parseInt(arrays[0]), parseInt(arrays[1]), parseInt(arrays[2])];
        }

        weui.datePicker({
            id: "start"+id,
            start: 2000,
            end: dt.getFullYear()+20,
            defaultValue:df,
            onConfirm: function (result) {
                $("#txt_dateStart").val(result[0].label.replace("年","-") + result[1].label.replace("月","-") + result[2].label.replace("日",""));
                $("#txt_dateEnd").val("");
            }
        });
    });

    //结束日期
    $('#txt_dateEnd').on('focus', function () {
        var dt = new Date();
        var df = [dt.getFullYear(), (dt.getMonth() + 1), dt.getDate()];
        var id = dt.getFullYear() + "" + dt.getMonth() + "" + dt.getDate() + "" + dt.getHours() + "" + dt.getMinutes() + "" + dt.getSeconds();

        var value = $.trim($("#txt_dateEnd").val());
        if (value != "") {
            var arrays = value.split("-");
            df = [parseInt(arrays[0]), parseInt(arrays[1]), parseInt(arrays[2])];
        }
        var dfStart = "2000";
        var startVal = $.trim($("#txt_dateStart").val());
        if (startVal != "") {
            dfStart = startVal;
        }
        var dts = dfStart.split('-');
        var std;
        if(dts.length==1)
        {
            std=new Date(dts[0],1,1);
        }else{
            std=new Date(dts[0],dts[1],dts[2]);
        }

        weui.datePicker({
            id: "end" + id,
            start: std,
            end: dt.getFullYear() + 2,
            defaultValue: df,
            onConfirm: function (result) {
                $("#txt_dateEnd").val(result[0].label.replace("年", "-") + result[1].label.replace("月", "-") + result[2].label.replace("日", ""));
            }
        });
    });
</script>
</body>
</html>