123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <!doctype html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <meta charset="utf-8">
- <title>运动</title>
- <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
- <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="../css/ss-style.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css">
- </head>
- <body>
- <div class="c-main">
- <!--<div class="h45">
- <div class="demo-comtop">
- <a class="mui-action-back"></a>
- <h1>运动</h1>
- </div>
- </div>-->
- <div class="wis-fix c-border-b mt15">
- <ul class="c-list patient-list c-border-t mt fosx-li" data-list="patientInfo">
- <li>
- <div class="c-list-value pr30" style="width: 80px;">
- <h4><em class="star"></em>记录时间</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" placeholder="请输入记录时间" style="background: #FFFFFF;" data-time="date" value="" id="yd_date">
- <span class="form-select-arrow"></span>
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 80px;">
- <h4><em class="star"></em>时长(分钟)</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" placeholder="请选择时长" style="background: #FFFFFF;" data-val="date2" value="" id="yd_time">
- <span class="form-select-arrow"></span>
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 80px;">
- <h4><em class="star"></em>运动</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" placeholder="请选择运动强度" style="background: #FFFFFF;" data-val="sport" attr_spType="" value="" id="yd_strong">
- <span class="form-select-arrow"></span>
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 80px;">
- <h4><em class="star"></em>具体运动</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" placeholder="请选择运动" style="background: #FFFFFF;" data-val="sport2" attr_sp="" value="" id="yd_val">
- <span class="form-select-arrow"></span>
- </div>
- </div>
- </li>
- </ul>
- </div>
- <p class="c-f16 c5b plr15 pt10">轻度运动:购物、散步、做操、太极拳、气功等</p>
- <p class="c-f16 c5b plr15">中度运动:快走、慢跑、骑车、爬楼梯、健身操等</p>
- <p class="c-f16 c5b plr15">稍强度运动:跳绳、爬山、游泳、球类、跳舞等</p>
- <div class="bottom-box clearfix mt20 plr15">
- <a href="javascript:;" id="goback" class="c-btn-full c-btn-4dcd70 c-btn-radius fl c-f18">保存</a>
- </div>
- </div>
- </body>
- <script src="../../../js/jquery/2.1.3/jquery.js"></script>
- <script src="../../../widget/mobiscroll/2.15.1/js/mobiscroll.js"></script>
- <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
- <link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.15.1/css/mobiscroll.css">
- <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
- <script type="text/javascript" src="../../../js/mui.min.js"></script>
- <script type="text/javascript" src="../../../js/common_http.js" ></script>
- <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
- <script src="../js/health-record.js"></script>
- <script>
- $(function() {
- document.getElementById("goback").addEventListener("tap", function() {
- var date = document.getElementById("yd_date").value;
- var time = document.getElementById("yd_time").value;
- var strong_bz = $("#yd_strong").attr("attr_spType");//document.getElementById("yd_strong").value;
- var val_bz =$("#yd_val").attr("attr_sp"); //document.getElementById("yd_val").value;
- var strong=document.getElementById("yd_strong").value;
- var val=document.getElementById("yd_val").value;
- if (val && date && time && strong) {
- setTimeout(function(){
-
- },1000);
- } else {
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'请填写完整信息'}).show();
- return;
- }
- var params = {};
- params.record_date = date;
- params.sportsTime = time;
- params.sportsType = strong_bz;
- params.sports = val_bz;
- //发送ajax请求
- sendPost("patient/health_record/add_sports", params, "json", "post", addHealthRecordFailed, addSportSuccess);
- });
-
- $('input')
- var opt1 = {
- preset: 'date',
- theme: 'ios',
- lang: 'zh',
- minDate: new Date(1900, 01, 01)
- };
- $('input[data-time=date]').mobiscroll(opt1);
-
- sendPost("patient/health_record/sports_type","", "json", "post", queryListFailed,sports_type_Successs1);
- function sports_type_Successs1(res){
- var arr_key=[];
- var arr_value=[];
- var data=res.list;
- for(var i=0;i<data.length;i++){
- arr_key.push(data[i].code);
- arr_value.push(data[i].name);
- }
- $('input[data-val="sport"]').mobiscroll({
- theme: 'ios',
- lang: 'zh',
- formatValue: function(d) {
- return d.join('-');
- },
- customWheels: true,
- wheels: [ //如果值非常多请事先按需求生成好
- [{
- keys:arr_key, //['1', '2', '3'],
- values: arr_value //['轻度运动', '中度运动', '稍强的运动']
- }]
- ],
- onSelect: function(valueText, inst) {
- var dd = eval("[" + valueText + "]");
-
- $('input[data-val="sport"]').val(dd[0].values);//
- $('input[data-val="sport"]').attr("attr_spType",dd[0].keys);
- //
- }
- });
- }
- sendPost("patient/health_record/sports"," ", "json", "post", queryListFailed,sports_Successs2);
- function sports_Successs2(res){
- var arr_key2=[];
- var arr_value2=[];
- var data=res.list;
- for(var i=0;i<data.length;i++){
- arr_key2.push(data[i].code);
- arr_value2.push(data[i].name);
-
- }
-
- $('input[data-val="sport2"]').mobiscroll({
- theme: 'ios',
- lang: 'zh',
- formatValue: function(d) {
- return d.join('-');
- },
- customWheels: true,
- wheels: [ //如果值非常多请事先按需求生成好
- [{
- keys: arr_key2,//['1', '2', '3', '4', '5'],
- values: arr_value2 //['购物', '散步', '做操', '太极拳', '气功']
- }]
- ],
- onSelect: function(valueText, inst) {
- var dd = eval("[" + valueText + "]");
- $('input[data-val="sport2"]').val(dd[0].values);
- $('input[data-val="sport2"]').attr("attr_sp",dd[0].keys);
- }
- });
- }
-
- $('input[data-val="date2"]').mobiscroll({
- theme: 'ios',
- lang: 'zh',
- formatValue: function(d) {
- return d.join('-');
- },
- customWheels: true,
- wheels: [ //如果值非常多请事先按需求生成好
- [{
- keys: ['1', '2', '3', '4'],
- values: ['5', '15', '30', '60']
- }]
- ],
- onSelect: function(valueText, inst) {
- var dd = eval("[" + valueText + "]");
- $('input[data-val="date2"]').val(dd[0].values);
- }
- });
-
- })
- </script>
- </html>
|