正在显示
4 个修改的文件
包含
335 行增加
和
90 行删除
@@ -22,17 +22,23 @@ var app = new Vue({ | @@ -22,17 +22,23 @@ var app = new Vue({ | ||
22 | code: '' | 22 | code: '' |
23 | }, | 23 | }, |
24 | created: function () { | 24 | created: function () { |
25 | - apiready = function () { | 25 | + // apiready = function () { |
26 | // app.broth_info=$("#date2").val(); | 26 | // app.broth_info=$("#date2").val(); |
27 | - console.log(app.broth_info) | ||
28 | - app.broth_info=localStorage.getItem("birth") | ||
29 | - app.rid = api.pageParam.rid; | ||
30 | - app.date_type = api.pageParam.date_type; | ||
31 | - app.type_name = api.pageParam.type_name; | ||
32 | - app.type_home = api.pageParam.type_home; | ||
33 | - app.type_id = api.pageParam.type_id; | ||
34 | - app.getOrg(); | ||
35 | - switch (app.type_id) { | 27 | + console.log(this.broth_info) |
28 | + this.broth_info=localStorage.getItem("birth") | ||
29 | + // this.rid = api.pageParam.rid; | ||
30 | + // this.date_type = api.pageParam.date_type; | ||
31 | + // this.type_name = api.pageParam.type_name; | ||
32 | + // this.type_home = api.pageParam.type_home; | ||
33 | + // this.type_id = api.pageParam.type_id; | ||
34 | + this.rid=localStorage.getItem("rid"); | ||
35 | + this.date_type=localStorage.getItem("date_type"); | ||
36 | + this.type_name=localStorage.getItem("type_name"); | ||
37 | + this.type_home=localStorage.getItem("type_home"); | ||
38 | + this.type_id=localStorage.getItem("type_id"); | ||
39 | + this.getOrg(); | ||
40 | + this.getIllness(); | ||
41 | + switch (this.type_id) { | ||
36 | case 1: | 42 | case 1: |
37 | app.getIllness(); | 43 | app.getIllness(); |
38 | break; | 44 | break; |
@@ -46,7 +52,7 @@ var app = new Vue({ | @@ -46,7 +52,7 @@ var app = new Vue({ | ||
46 | return false; | 52 | return false; |
47 | } | 53 | } |
48 | 54 | ||
49 | - } | 55 | + // } |
50 | }, | 56 | }, |
51 | methods: { | 57 | methods: { |
52 | // 选择日期 | 58 | // 选择日期 |
@@ -73,6 +79,7 @@ var app = new Vue({ | @@ -73,6 +79,7 @@ var app = new Vue({ | ||
73 | // // }, | 79 | // // }, |
74 | // 上传照片 | 80 | // 上传照片 |
75 | choose_pic: function (type) { | 81 | choose_pic: function (type) { |
82 | + var app=this; | ||
76 | app.popupVisible = false; | 83 | app.popupVisible = false; |
77 | api.getPicture({ | 84 | api.getPicture({ |
78 | sourceType: type, | 85 | sourceType: type, |
@@ -115,6 +122,8 @@ var app = new Vue({ | @@ -115,6 +122,8 @@ var app = new Vue({ | ||
115 | }, | 122 | }, |
116 | // 获取疾病类型 | 123 | // 获取疾病类型 |
117 | getIllness: function () { | 124 | getIllness: function () { |
125 | + | ||
126 | + var app=this; | ||
118 | var heder = { | 127 | var heder = { |
119 | "XX-Device-Type": getDevice(), | 128 | "XX-Device-Type": getDevice(), |
120 | 'XX-Token': getToken() | 129 | 'XX-Token': getToken() |
@@ -134,6 +143,7 @@ var app = new Vue({ | @@ -134,6 +143,7 @@ var app = new Vue({ | ||
134 | }, | 143 | }, |
135 | // 获取体检名称 | 144 | // 获取体检名称 |
136 | getPExam: function () { | 145 | getPExam: function () { |
146 | + var app=this; | ||
137 | var heder = { | 147 | var heder = { |
138 | "XX-Device-Type": getDevice(), | 148 | "XX-Device-Type": getDevice(), |
139 | 'XX-Token': getToken() | 149 | 'XX-Token': getToken() |
@@ -152,6 +162,7 @@ var app = new Vue({ | @@ -152,6 +162,7 @@ var app = new Vue({ | ||
152 | }, | 162 | }, |
153 | // 获取 | 163 | // 获取 |
154 | getCheckReport: function () { | 164 | getCheckReport: function () { |
165 | + var app=this; | ||
155 | var header = { | 166 | var header = { |
156 | "XX-Device-Type": getDevice(), | 167 | "XX-Device-Type": getDevice(), |
157 | 'XX-Token': getToken() | 168 | 'XX-Token': getToken() |
@@ -170,27 +181,41 @@ var app = new Vue({ | @@ -170,27 +181,41 @@ var app = new Vue({ | ||
170 | }, | 181 | }, |
171 | // 获取机构名称 | 182 | // 获取机构名称 |
172 | getOrg: function () { | 183 | getOrg: function () { |
184 | + | ||
185 | + var app=this; | ||
173 | var heder = { | 186 | var heder = { |
174 | "XX-Device-Type": getDevice(), | 187 | "XX-Device-Type": getDevice(), |
175 | 'XX-Token': getToken() | 188 | 'XX-Token': getToken() |
176 | }; | 189 | }; |
177 | getRequest('post', 'user/index/getOrg', null, heder).then(function (res) { | 190 | getRequest('post', 'user/index/getOrg', null, heder).then(function (res) { |
178 | - | 191 | + // console.log(res); |
192 | + if (res.data.code == 1) { | ||
193 | + for (var i in res.data.data) { | ||
194 | + app. org_list.push({ | ||
195 | + value: res.data.data[i].id, | ||
196 | + label: res.data.data[i].name | ||
197 | + }) | ||
198 | + } | ||
199 | + loadEnd() | ||
200 | + } | ||
179 | }) | 201 | }) |
180 | }, | 202 | }, |
181 | // 选择类别 | 203 | // 选择类别 |
182 | 204 | ||
183 | choose_item: function () { | 205 | choose_item: function () { |
206 | + var app=this; | ||
184 | weui.picker(app.Illness_list, { | 207 | weui.picker(app.Illness_list, { |
185 | onChange: function (result) { | 208 | onChange: function (result) { |
186 | }, | 209 | }, |
187 | onConfirm: function (result) { | 210 | onConfirm: function (result) { |
211 | + | ||
188 | app.choose_type_name = result[0].label | 212 | app.choose_type_name = result[0].label |
189 | } | 213 | } |
190 | }) | 214 | }) |
191 | }, | 215 | }, |
192 | // 选择机构名称 | 216 | // 选择机构名称 |
193 | choose_home: function () { | 217 | choose_home: function () { |
218 | + var app=this; | ||
194 | weui.picker(app.org_list, { | 219 | weui.picker(app.org_list, { |
195 | onChange: function (result) { | 220 | onChange: function (result) { |
196 | }, | 221 | }, |
@@ -201,6 +226,7 @@ var app = new Vue({ | @@ -201,6 +226,7 @@ var app = new Vue({ | ||
201 | }, | 226 | }, |
202 | // 打开二维码 | 227 | // 打开二维码 |
203 | openQrc: function () { | 228 | openQrc: function () { |
229 | + var app=this; | ||
204 | var FNScanner = api.require('FNScanner'); | 230 | var FNScanner = api.require('FNScanner'); |
205 | FNScanner.open({ | 231 | FNScanner.open({ |
206 | autorotation: true | 232 | autorotation: true |
@@ -224,6 +250,7 @@ var app = new Vue({ | @@ -224,6 +250,7 @@ var app = new Vue({ | ||
224 | }, | 250 | }, |
225 | // 保存报告 | 251 | // 保存报告 |
226 | save_info: function () { | 252 | save_info: function () { |
253 | + var app=this; | ||
227 | app.broth_info=$("#date2").val(); | 254 | app.broth_info=$("#date2").val(); |
228 | localStorage.setItem("birth",app.broth_info); | 255 | localStorage.setItem("birth",app.broth_info); |
229 | console.log(localStorage) | 256 | console.log(localStorage) |
@@ -17,81 +17,84 @@ var app = new Vue({ | @@ -17,81 +17,84 @@ var app = new Vue({ | ||
17 | rid: '' | 17 | rid: '' |
18 | }, | 18 | }, |
19 | created: function () { | 19 | created: function () { |
20 | - apiready = function () { | ||
21 | - app.rid = api.pageParam.rid; | ||
22 | - app.getPressure(); | 20 | + // apiready = function () { |
21 | + // app.rid = api.pageParam.rid; | ||
22 | + this.rid=localStorage.getItem("rid"); | ||
23 | + console.log(this.rid) | ||
24 | + this.getPressure(); | ||
23 | for (var i = 0; i < 300; i++) { | 25 | for (var i = 0; i < 300; i++) { |
24 | - app.high_list.push({ | 26 | + this.high_list.push({ |
25 | "label": i, | 27 | "label": i, |
26 | "value": i, | 28 | "value": i, |
27 | }) | 29 | }) |
28 | } | 30 | } |
29 | - } | 31 | + // } |
30 | }, | 32 | }, |
31 | methods: { | 33 | methods: { |
32 | // 日期选择 | 34 | // 日期选择 |
33 | 35 | ||
34 | - dateSelect: function () { | ||
35 | - // if (api.systemType == 'ios') { | ||
36 | - // api.openPicker({ | ||
37 | - // type: 'date_time', | ||
38 | - // date: new Date(), | ||
39 | - // maxDate: getTimeDetil(0), | ||
40 | - // title: '测量时间' | ||
41 | - // }, function (ret, err) { | ||
42 | - // if (ret) { | ||
43 | - // app.year = ret.year; | ||
44 | - // app.month = ret.month; | ||
45 | - // app.day = ret.day; | ||
46 | - // app.hour = ret.hour; | ||
47 | - // app.minute = ret.minute; | ||
48 | - // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
49 | - // if (checkDate(app.date_info, 2)) { | ||
50 | - // return app.date_info | ||
51 | - // } else { | ||
52 | - // toastMsg('请选择正确的测量时间'); | ||
53 | - // return app.date_info = '' | ||
54 | - // } | ||
55 | - // } else { | ||
56 | - // console.log(err) | ||
57 | - // } | ||
58 | - // }); | ||
59 | - // } | ||
60 | - // else { | ||
61 | - // api.openPicker({ | ||
62 | - // type: 'date', | ||
63 | - // title: '测量时间', | ||
64 | - // }, function (ret, err) { | ||
65 | - // if (ret) { | ||
66 | - // app.year = ret.year; | ||
67 | - // app.month = ret.month; | ||
68 | - // app.day = ret.day; | ||
69 | - // api.openPicker({ | ||
70 | - // type: 'time', | ||
71 | - // title: '测量时间' | ||
72 | - // }, function (rets, errs) { | ||
73 | - // if (rets) { | ||
74 | - // app.hour = rets.hour; | ||
75 | - // app.minute = rets.minute; | ||
76 | - // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
77 | - // if (checkDate(app.date_info, 2)) { | ||
78 | - // return app.date_info | ||
79 | - // } else { | ||
80 | - // toastMsg('请选择正确的测量时间'); | ||
81 | - // return app.date_info = '' | ||
82 | - // } | ||
83 | - // } else { | ||
84 | - // console.log(errs) | ||
85 | - // } | ||
86 | - // }); | ||
87 | - // } else { | ||
88 | - // console.log(err) | ||
89 | - // } | ||
90 | - // }); | ||
91 | - // } | ||
92 | - }, | 36 | + // dateSelect: function () { |
37 | + // // if (api.systemType == 'ios') { | ||
38 | + // // api.openPicker({ | ||
39 | + // // type: 'date_time', | ||
40 | + // // date: new Date(), | ||
41 | + // // maxDate: getTimeDetil(0), | ||
42 | + // // title: '测量时间' | ||
43 | + // // }, function (ret, err) { | ||
44 | + // // if (ret) { | ||
45 | + // // app.year = ret.year; | ||
46 | + // // app.month = ret.month; | ||
47 | + // // app.day = ret.day; | ||
48 | + // // app.hour = ret.hour; | ||
49 | + // // app.minute = ret.minute; | ||
50 | + // // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
51 | + // // if (checkDate(app.date_info, 2)) { | ||
52 | + // // return app.date_info | ||
53 | + // // } else { | ||
54 | + // // toastMsg('请选择正确的测量时间'); | ||
55 | + // // return app.date_info = '' | ||
56 | + // // } | ||
57 | + // // } else { | ||
58 | + // // console.log(err) | ||
59 | + // // } | ||
60 | + // // }); | ||
61 | + // // } | ||
62 | + // // else { | ||
63 | + // // api.openPicker({ | ||
64 | + // // type: 'date', | ||
65 | + // // title: '测量时间', | ||
66 | + // // }, function (ret, err) { | ||
67 | + // // if (ret) { | ||
68 | + // // app.year = ret.year; | ||
69 | + // // app.month = ret.month; | ||
70 | + // // app.day = ret.day; | ||
71 | + // // api.openPicker({ | ||
72 | + // // type: 'time', | ||
73 | + // // title: '测量时间' | ||
74 | + // // }, function (rets, errs) { | ||
75 | + // // if (rets) { | ||
76 | + // // app.hour = rets.hour; | ||
77 | + // // app.minute = rets.minute; | ||
78 | + // // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
79 | + // // if (checkDate(app.date_info, 2)) { | ||
80 | + // // return app.date_info | ||
81 | + // // } else { | ||
82 | + // // toastMsg('请选择正确的测量时间'); | ||
83 | + // // return app.date_info = '' | ||
84 | + // // } | ||
85 | + // // } else { | ||
86 | + // // console.log(errs) | ||
87 | + // // } | ||
88 | + // // }); | ||
89 | + // // } else { | ||
90 | + // // console.log(err) | ||
91 | + // // } | ||
92 | + // // }); | ||
93 | + // // } | ||
94 | + // }, | ||
93 | // 选择高压 | 95 | // 选择高压 |
94 | choose_high: function () { | 96 | choose_high: function () { |
97 | + var app=this; | ||
95 | weui.picker(app.high_list, { | 98 | weui.picker(app.high_list, { |
96 | onChange: function (result) { | 99 | onChange: function (result) { |
97 | 100 | ||
@@ -104,6 +107,7 @@ var app = new Vue({ | @@ -104,6 +107,7 @@ var app = new Vue({ | ||
104 | }, | 107 | }, |
105 | // 选择低压 | 108 | // 选择低压 |
106 | choose_low: function () { | 109 | choose_low: function () { |
110 | + var app=this; | ||
107 | weui.picker(app.high_list, { | 111 | weui.picker(app.high_list, { |
108 | onChange: function (result) { | 112 | onChange: function (result) { |
109 | 113 | ||
@@ -115,6 +119,7 @@ var app = new Vue({ | @@ -115,6 +119,7 @@ var app = new Vue({ | ||
115 | }, | 119 | }, |
116 | // 保存数据 | 120 | // 保存数据 |
117 | save_data: function () { | 121 | save_data: function () { |
122 | + var app=this; | ||
118 | app.default_date=$("#test04").val(); | 123 | app.default_date=$("#test04").val(); |
119 | 124 | ||
120 | if (app.default_date == '') { | 125 | if (app.default_date == '') { |
@@ -141,6 +146,7 @@ var app = new Vue({ | @@ -141,6 +146,7 @@ var app = new Vue({ | ||
141 | rate: app.heart_num | 146 | rate: app.heart_num |
142 | }; | 147 | }; |
143 | getRequest('post', 'user/index/setBoolData', post, header).then(function (res) { | 148 | getRequest('post', 'user/index/setBoolData', post, header).then(function (res) { |
149 | + | ||
144 | // alert(JSON.stringify(res)) | 150 | // alert(JSON.stringify(res)) |
145 | if (res.data.code == 1) { | 151 | if (res.data.code == 1) { |
146 | toastMsg('记录成功!'); | 152 | toastMsg('记录成功!'); |
@@ -157,17 +163,19 @@ var app = new Vue({ | @@ -157,17 +163,19 @@ var app = new Vue({ | ||
157 | } | 163 | } |
158 | }, | 164 | }, |
159 | getPressure: function () { | 165 | getPressure: function () { |
160 | - | 166 | + var app=this; |
167 | + var rid=localStorage.getItem("rid") | ||
161 | 168 | ||
162 | var header = { | 169 | var header = { |
163 | "XX-Device-Type": getDevice(), | 170 | "XX-Device-Type": getDevice(), |
164 | 'XX-Token': getToken() | 171 | 'XX-Token': getToken() |
165 | }; | 172 | }; |
166 | var post = { | 173 | var post = { |
167 | - rid: api.pageParam.rid, | 174 | + rid: rid, |
168 | type: 2 | 175 | type: 2 |
169 | }; | 176 | }; |
170 | getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) { | 177 | getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) { |
178 | + console.log(res.data.data.high) | ||
171 | // alert(JSON.stringify(res)) | 179 | // alert(JSON.stringify(res)) |
172 | if (res.data.code == 1) { | 180 | if (res.data.code == 1) { |
173 | app.date_info = res.data.data.time; | 181 | app.date_info = res.data.data.time; |
@@ -55,6 +55,9 @@ | @@ -55,6 +55,9 @@ | ||
55 | 55 | ||
56 | .data_box { | 56 | .data_box { |
57 | background-color: #fff; | 57 | background-color: #fff; |
58 | + /*display:flex;*/ | ||
59 | + /*justify-content:space-between;*/ | ||
60 | + /*align-items: center;*/ | ||
58 | } | 61 | } |
59 | 62 | ||
60 | .icon-xiangyou { | 63 | .icon-xiangyou { |
@@ -64,23 +67,27 @@ | @@ -64,23 +67,27 @@ | ||
64 | #jedate{ | 67 | #jedate{ |
65 | left:0.5rem | 68 | left:0.5rem |
66 | } | 69 | } |
67 | - | 70 | + #chosetime{ |
71 | + outline:none; | ||
72 | + /*!*height:0.68rem;*!*/ | ||
73 | + border:none; | ||
74 | + } | ||
68 | </style> | 75 | </style> |
69 | </head> | 76 | </head> |
70 | <body> | 77 | <body> |
71 | <div id="loadStart"></div> | 78 | <div id="loadStart"></div> |
72 | <div id="app"> | 79 | <div id="app"> |
73 | <div class="data_box"> | 80 | <div class="data_box"> |
74 | - <div class="data_item" @click="dateSelect"><span>测量时间</span> | 81 | + <div class="data_item"><span>测量时间</span> |
75 | <!--<div class="data_item_right"><span>{{date_info?date_info:default_date}}</span>--> | 82 | <!--<div class="data_item_right"><span>{{date_info?date_info:default_date}}</span>--> |
76 | <!--<!–<span class="iconfont icon-xiangyou"></span>–>--> | 83 | <!--<!–<span class="iconfont icon-xiangyou"></span>–>--> |
77 | <!--</div>--> | 84 | <!--</div>--> |
78 | <div class="data_item_right"> | 85 | <div class="data_item_right"> |
79 | - | ||
80 | - <div class="date_box"> | ||
81 | - <div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" v-model="default_date" placeholder="请选择测量时间" style="width:96%;outline:none;border:none" readonly></div> | ||
82 | - <!--<div class="iconfont icon-xiangyou" ></div>--> | 86 | + <div class="date_box" > |
87 | + <!--<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" v-model="default_date" placeholder="请选择测量时间" style="width:96%;outline:none;border:none" readonly></div>--> | ||
88 | + <input type="datetime-local" id="chosetime" placeholder="请选择测量时间"> | ||
83 | </div> | 89 | </div> |
90 | + <p class="iconfont icon-xiangyou"></p> | ||
84 | </div> | 91 | </div> |
85 | </div> | 92 | </div> |
86 | <div class="data_item" @click="choose_high"> | 93 | <div class="data_item" @click="choose_high"> |
@@ -125,12 +132,204 @@ | @@ -125,12 +132,204 @@ | ||
125 | <script type="text/javascript" src="../../assets/js/index.js"></script> | 132 | <script type="text/javascript" src="../../assets/js/index.js"></script> |
126 | <script type="text/javascript" src="../../assets/js/datePicker.js"></script> | 133 | <script type="text/javascript" src="../../assets/js/datePicker.js"></script> |
127 | <script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script> | 134 | <script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script> |
128 | -<script type="text/javascript" src="../../assets/js/mypressure.js"></script> | 135 | +<!--<script type="text/javascript" src="../../assets/js/mypressure.js"></script>--> |
129 | 136 | ||
130 | <script type="text/javascript" src="../../assets/js/jedate.js"></script> | 137 | <script type="text/javascript" src="../../assets/js/jedate.js"></script> |
131 | -<script type="text/javascript" src="../../assets/js/demo.js"></script> | 138 | +<!--<script type="text/javascript" src="../../assets/js/demo.js"></script>--> |
132 | 139 | ||
133 | 140 | ||
134 | <script> | 141 | <script> |
142 | + var app = new Vue({ | ||
143 | + el: '#app', | ||
144 | + data: { | ||
145 | + year: '', | ||
146 | + month: '', | ||
147 | + day: '', | ||
148 | + hour: '', | ||
149 | + minute: '', | ||
150 | + date_info: '', | ||
151 | + default_date: '', | ||
152 | + popupVisible: false, | ||
153 | + high_list: [], | ||
154 | + low_list: [], | ||
155 | + high: '请选择高压(mmHg)', | ||
156 | + low: '请选择低压(mmHg)', | ||
157 | + heart_num: '', | ||
158 | + rid: '' | ||
159 | + }, | ||
160 | + created: function () { | ||
161 | + // apiready = function () { | ||
162 | + // app.rid = api.pageParam.rid; | ||
163 | + this.rid=localStorage.getItem("rid"); | ||
164 | + console.log(this.rid) | ||
165 | + this.getPressure(); | ||
166 | + for (var i = 0; i < 300; i++) { | ||
167 | + this.high_list.push({ | ||
168 | + "label": i, | ||
169 | + "value": i, | ||
170 | + }) | ||
171 | + } | ||
172 | + // } | ||
173 | + }, | ||
174 | + methods: { | ||
175 | + // 日期选择 | ||
176 | + | ||
177 | + // dateSelect: function () { | ||
178 | + // // if (api.systemType == 'ios') { | ||
179 | + // // api.openPicker({ | ||
180 | + // // type: 'date_time', | ||
181 | + // // date: new Date(), | ||
182 | + // // maxDate: getTimeDetil(0), | ||
183 | + // // title: '测量时间' | ||
184 | + // // }, function (ret, err) { | ||
185 | + // // if (ret) { | ||
186 | + // // app.year = ret.year; | ||
187 | + // // app.month = ret.month; | ||
188 | + // // app.day = ret.day; | ||
189 | + // // app.hour = ret.hour; | ||
190 | + // // app.minute = ret.minute; | ||
191 | + // // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
192 | + // // if (checkDate(app.date_info, 2)) { | ||
193 | + // // return app.date_info | ||
194 | + // // } else { | ||
195 | + // // toastMsg('请选择正确的测量时间'); | ||
196 | + // // return app.date_info = '' | ||
197 | + // // } | ||
198 | + // // } else { | ||
199 | + // // console.log(err) | ||
200 | + // // } | ||
201 | + // // }); | ||
202 | + // // } | ||
203 | + // // else { | ||
204 | + // // api.openPicker({ | ||
205 | + // // type: 'date', | ||
206 | + // // title: '测量时间', | ||
207 | + // // }, function (ret, err) { | ||
208 | + // // if (ret) { | ||
209 | + // // app.year = ret.year; | ||
210 | + // // app.month = ret.month; | ||
211 | + // // app.day = ret.day; | ||
212 | + // // api.openPicker({ | ||
213 | + // // type: 'time', | ||
214 | + // // title: '测量时间' | ||
215 | + // // }, function (rets, errs) { | ||
216 | + // // if (rets) { | ||
217 | + // // app.hour = rets.hour; | ||
218 | + // // app.minute = rets.minute; | ||
219 | + // // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute); | ||
220 | + // // if (checkDate(app.date_info, 2)) { | ||
221 | + // // return app.date_info | ||
222 | + // // } else { | ||
223 | + // // toastMsg('请选择正确的测量时间'); | ||
224 | + // // return app.date_info = '' | ||
225 | + // // } | ||
226 | + // // } else { | ||
227 | + // // console.log(errs) | ||
228 | + // // } | ||
229 | + // // }); | ||
230 | + // // } else { | ||
231 | + // // console.log(err) | ||
232 | + // // } | ||
233 | + // // }); | ||
234 | + // // } | ||
235 | + // }, | ||
236 | + // 选择高压 | ||
237 | + choose_high: function () { | ||
238 | + var app=this; | ||
239 | + weui.picker(app.high_list, { | ||
240 | + onChange: function (result) { | ||
241 | + | ||
242 | + }, | ||
243 | + onConfirm: function (result) { | ||
244 | + app.high = result[0].label; | ||
245 | + } | ||
246 | + }); | ||
247 | + | ||
248 | + }, | ||
249 | + // 选择低压 | ||
250 | + choose_low: function () { | ||
251 | + var app=this; | ||
252 | + weui.picker(app.high_list, { | ||
253 | + onChange: function (result) { | ||
254 | + | ||
255 | + }, | ||
256 | + onConfirm: function (result) { | ||
257 | + app.low = result[0].label; | ||
258 | + } | ||
259 | + }); | ||
260 | + }, | ||
261 | + // 保存数据 | ||
262 | + save_data: function () { | ||
263 | + var app=this; | ||
264 | + app.default_date=$("#test04").val(); | ||
265 | + | ||
266 | + if (app.default_date == '') { | ||
267 | + toastMsg('请选择测量时间') | ||
268 | + } | ||
269 | + else if (app.high == '请选择高压(mmHg)') { | ||
270 | + toastMsg('请选择高压数据') | ||
271 | + } | ||
272 | + else if (app.low == '请选择低压(mmHg)') { | ||
273 | + toastMsg('请选择低压') | ||
274 | + } else if (app.heart_num == '') { | ||
275 | + toastMsg('请输入心率') | ||
276 | + } | ||
277 | + else { | ||
278 | + var header = { | ||
279 | + "XX-Device-Type": getDevice(), | ||
280 | + 'XX-Token': getToken() | ||
281 | + }; | ||
282 | + var post = { | ||
283 | + rid: app.rid, | ||
284 | + time: app.date_info, | ||
285 | + data: app.high + '/' + app.low, | ||
286 | + type: 2, | ||
287 | + rate: app.heart_num | ||
288 | + }; | ||
289 | + getRequest('post', 'user/index/setBoolData', post, header).then(function (res) { | ||
290 | + | ||
291 | + // alert(JSON.stringify(res)) | ||
292 | + if (res.data.code == 1) { | ||
293 | + toastMsg('记录成功!'); | ||
294 | + setTimeout(function () { | ||
295 | + api.sendEvent({ | ||
296 | + name: 'pressure', | ||
297 | + }); | ||
298 | + api.closeWin() | ||
299 | + }, 1000); | ||
300 | + } else { | ||
301 | + toastMsg(res.msg) | ||
302 | + } | ||
303 | + }) | ||
304 | + } | ||
305 | + }, | ||
306 | + getPressure: function () { | ||
307 | + var app=this; | ||
308 | + var rid=localStorage.getItem("rid") | ||
309 | + | ||
310 | + var header = { | ||
311 | + "XX-Device-Type": getDevice(), | ||
312 | + 'XX-Token': getToken() | ||
313 | + }; | ||
314 | + var post = { | ||
315 | + rid: rid, | ||
316 | + type: 2 | ||
317 | + }; | ||
318 | + getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) { | ||
319 | + console.log(res.data.data.high) | ||
320 | + // alert(JSON.stringify(res)) | ||
321 | + if (res.data.code == 1) { | ||
322 | + app.date_info = res.data.data.time; | ||
323 | + app.high = res.data.data.high; | ||
324 | + app.low = res.data.data.low; | ||
325 | + app.heart_num = res.data.data.rate; | ||
326 | + } else { | ||
327 | + toastMsg(res.data.msg) | ||
328 | + } | ||
329 | + loadEnd() | ||
330 | + }) | ||
331 | + } | ||
332 | + } | ||
333 | + }) | ||
135 | 334 | ||
136 | </script> | 335 | </script> |
@@ -54,6 +54,7 @@ | @@ -54,6 +54,7 @@ | ||
54 | .date_box { | 54 | .date_box { |
55 | position:relative; | 55 | position:relative; |
56 | width:7.5rem; | 56 | width:7.5rem; |
57 | + | ||
57 | display: flex; | 58 | display: flex; |
58 | align-items: center; | 59 | align-items: center; |
59 | justify-content: space-between; | 60 | justify-content: space-between; |
@@ -102,6 +103,11 @@ | @@ -102,6 +103,11 @@ | ||
102 | background: #fff url("../../assets/image/loading.gif") center center no-repeat; | 103 | background: #fff url("../../assets/image/loading.gif") center center no-repeat; |
103 | background-size: 12%; | 104 | background-size: 12%; |
104 | } | 105 | } |
106 | + #chosetime{ | ||
107 | + outline:none; | ||
108 | + height:0.68rem; | ||
109 | + border:none; | ||
110 | + } | ||
105 | </style> | 111 | </style> |
106 | </head> | 112 | </head> |
107 | 113 | ||
@@ -133,8 +139,9 @@ | @@ -133,8 +139,9 @@ | ||
133 | <div class="jeitem "> | 139 | <div class="jeitem "> |
134 | <div class="jelabel ">请选择测量时间</div> | 140 | <div class="jelabel ">请选择测量时间</div> |
135 | <div class="date_box"> | 141 | <div class="date_box"> |
136 | - <div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" placeholder="请选择测量时间" style="width:96%" readonly></div> | 142 | + <!--<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" placeholder="请选择测量时间" style="width:96%" readonly></div>--> |
137 | <!--<div class="iconfont icon-xiangyou" ></div>--> | 143 | <!--<div class="iconfont icon-xiangyou" ></div>--> |
144 | + <input type="datetime-local" id="chosetime" placeholder="请选择测量时间"> | ||
138 | </div> | 145 | </div> |
139 | </div> | 146 | </div> |
140 | 147 | ||
@@ -155,7 +162,7 @@ | @@ -155,7 +162,7 @@ | ||
155 | <script type="text/javascript" src="../../assets/js/axios.min.js"></script> | 162 | <script type="text/javascript" src="../../assets/js/axios.min.js"></script> |
156 | <script type="text/javascript" src="../../assets/icon/iconfont.js"></script> | 163 | <script type="text/javascript" src="../../assets/icon/iconfont.js"></script> |
157 | <script type="text/javascript" src="../../assets/js/jedate.js"></script> | 164 | <script type="text/javascript" src="../../assets/js/jedate.js"></script> |
158 | -<script type="text/javascript" src="../../assets/js/demo.js"></script> | 165 | +<!--<script type="text/javascript" src="../../assets/js/demo.js"></script>--> |
159 | <script type="text/javascript" src="../../assets/js/weui.min.js"></script> | 166 | <script type="text/javascript" src="../../assets/js/weui.min.js"></script> |
160 | <script type="text/javascript"> | 167 | <script type="text/javascript"> |
161 | $(function () { | 168 | $(function () { |
@@ -262,12 +269,16 @@ | @@ -262,12 +269,16 @@ | ||
262 | 269 | ||
263 | }); | 270 | }); |
264 | 271 | ||
265 | - | ||
266 | $('.save_btn').click(function () { | 272 | $('.save_btn').click(function () { |
267 | var rid=localStorage.getItem("rid") | 273 | var rid=localStorage.getItem("rid") |
268 | var value = $('.knob').val(); | 274 | var value = $('.knob').val(); |
269 | 275 | ||
270 | - var date = $('#test04').val(); | 276 | + var date = $('#chosetime').val(); |
277 | + | ||
278 | + date=date.split("T"); | ||
279 | + date=date[0]+" " +date[1]; | ||
280 | + | ||
281 | + | ||
271 | 282 | ||
272 | // type = $('.sugar_type').attr('data-type'); | 283 | // type = $('.sugar_type').attr('data-type'); |
273 | type = $('.spanactive').attr('data-id') | 284 | type = $('.spanactive').attr('data-id') |
-
请 注册 或 登录 后发表评论