作者 朱振飞

合并分支 'lihongjuan' 到 'master'

Lihongjuan



查看合并请求 !10
... ... @@ -22,17 +22,23 @@ var app = new Vue({
code: ''
},
created: function () {
apiready = function () {
// apiready = function () {
// app.broth_info=$("#date2").val();
console.log(app.broth_info)
app.broth_info=localStorage.getItem("birth")
app.rid = api.pageParam.rid;
app.date_type = api.pageParam.date_type;
app.type_name = api.pageParam.type_name;
app.type_home = api.pageParam.type_home;
app.type_id = api.pageParam.type_id;
app.getOrg();
switch (app.type_id) {
console.log(this.broth_info)
this.broth_info=localStorage.getItem("birth")
// this.rid = api.pageParam.rid;
// this.date_type = api.pageParam.date_type;
// this.type_name = api.pageParam.type_name;
// this.type_home = api.pageParam.type_home;
// this.type_id = api.pageParam.type_id;
this.rid=localStorage.getItem("rid");
this.date_type=localStorage.getItem("date_type");
this.type_name=localStorage.getItem("type_name");
this.type_home=localStorage.getItem("type_home");
this.type_id=localStorage.getItem("type_id");
this.getOrg();
this.getIllness();
switch (this.type_id) {
case 1:
app.getIllness();
break;
... ... @@ -46,7 +52,7 @@ var app = new Vue({
return false;
}
}
// }
},
methods: {
// 选择日期
... ... @@ -73,6 +79,7 @@ var app = new Vue({
// // },
// 上传照片
choose_pic: function (type) {
var app=this;
app.popupVisible = false;
api.getPicture({
sourceType: type,
... ... @@ -115,12 +122,14 @@ var app = new Vue({
},
// 获取疾病类型
getIllness: function () {
var app=this;
var heder = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getIllness', null, heder).then(function (res) {
console.log(res)
console.log(res)
if (res.data.code == 1) {
for (var i in res.data.data) {
app.Illness_list.push({
... ... @@ -134,6 +143,7 @@ var app = new Vue({
},
// 获取体检名称
getPExam: function () {
var app=this;
var heder = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -152,6 +162,7 @@ var app = new Vue({
},
// 获取
getCheckReport: function () {
var app=this;
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
... ... @@ -170,27 +181,41 @@ var app = new Vue({
},
// 获取机构名称
getOrg: function () {
var app=this;
var heder = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/getOrg', null, heder).then(function (res) {
// console.log(res);
if (res.data.code == 1) {
for (var i in res.data.data) {
app. org_list.push({
value: res.data.data[i].id,
label: res.data.data[i].name
})
}
loadEnd()
}
})
},
// 选择类别
choose_item: function () {
var app=this;
weui.picker(app.Illness_list, {
onChange: function (result) {
},
onConfirm: function (result) {
app.choose_type_name = result[0].label
}
})
},
// 选择机构名称
choose_home: function () {
var app=this;
weui.picker(app.org_list, {
onChange: function (result) {
},
... ... @@ -201,6 +226,7 @@ var app = new Vue({
},
// 打开二维码
openQrc: function () {
var app=this;
var FNScanner = api.require('FNScanner');
FNScanner.open({
autorotation: true
... ... @@ -224,6 +250,7 @@ var app = new Vue({
},
// 保存报告
save_info: function () {
var app=this;
app.broth_info=$("#date2").val();
localStorage.setItem("birth",app.broth_info);
console.log(localStorage)
... ...
... ... @@ -17,81 +17,84 @@ var app = new Vue({
rid: ''
},
created: function () {
apiready = function () {
app.rid = api.pageParam.rid;
app.getPressure();
// apiready = function () {
// app.rid = api.pageParam.rid;
this.rid=localStorage.getItem("rid");
console.log(this.rid)
this.getPressure();
for (var i = 0; i < 300; i++) {
app.high_list.push({
this.high_list.push({
"label": i,
"value": i,
})
}
}
// }
},
methods: {
// 日期选择
dateSelect: function () {
// if (api.systemType == 'ios') {
// api.openPicker({
// type: 'date_time',
// date: new Date(),
// maxDate: getTimeDetil(0),
// title: '测量时间'
// }, function (ret, err) {
// if (ret) {
// app.year = ret.year;
// app.month = ret.month;
// app.day = ret.day;
// app.hour = ret.hour;
// app.minute = ret.minute;
// app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// if (checkDate(app.date_info, 2)) {
// return app.date_info
// } else {
// toastMsg('请选择正确的测量时间');
// return app.date_info = ''
// }
// } else {
// console.log(err)
// }
// });
// }
// else {
// api.openPicker({
// type: 'date',
// title: '测量时间',
// }, function (ret, err) {
// if (ret) {
// app.year = ret.year;
// app.month = ret.month;
// app.day = ret.day;
// api.openPicker({
// type: 'time',
// title: '测量时间'
// }, function (rets, errs) {
// if (rets) {
// app.hour = rets.hour;
// app.minute = rets.minute;
// app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// if (checkDate(app.date_info, 2)) {
// return app.date_info
// } else {
// toastMsg('请选择正确的测量时间');
// return app.date_info = ''
// }
// } else {
// console.log(errs)
// }
// });
// } else {
// console.log(err)
// }
// });
// }
},
// dateSelect: function () {
// // if (api.systemType == 'ios') {
// // api.openPicker({
// // type: 'date_time',
// // date: new Date(),
// // maxDate: getTimeDetil(0),
// // title: '测量时间'
// // }, function (ret, err) {
// // if (ret) {
// // app.year = ret.year;
// // app.month = ret.month;
// // app.day = ret.day;
// // app.hour = ret.hour;
// // app.minute = ret.minute;
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// // if (checkDate(app.date_info, 2)) {
// // return app.date_info
// // } else {
// // toastMsg('请选择正确的测量时间');
// // return app.date_info = ''
// // }
// // } else {
// // console.log(err)
// // }
// // });
// // }
// // else {
// // api.openPicker({
// // type: 'date',
// // title: '测量时间',
// // }, function (ret, err) {
// // if (ret) {
// // app.year = ret.year;
// // app.month = ret.month;
// // app.day = ret.day;
// // api.openPicker({
// // type: 'time',
// // title: '测量时间'
// // }, function (rets, errs) {
// // if (rets) {
// // app.hour = rets.hour;
// // app.minute = rets.minute;
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// // if (checkDate(app.date_info, 2)) {
// // return app.date_info
// // } else {
// // toastMsg('请选择正确的测量时间');
// // return app.date_info = ''
// // }
// // } else {
// // console.log(errs)
// // }
// // });
// // } else {
// // console.log(err)
// // }
// // });
// // }
// },
// 选择高压
choose_high: function () {
var app=this;
weui.picker(app.high_list, {
onChange: function (result) {
... ... @@ -104,6 +107,7 @@ var app = new Vue({
},
// 选择低压
choose_low: function () {
var app=this;
weui.picker(app.high_list, {
onChange: function (result) {
... ... @@ -115,6 +119,7 @@ var app = new Vue({
},
// 保存数据
save_data: function () {
var app=this;
app.default_date=$("#test04").val();
if (app.default_date == '') {
... ... @@ -141,6 +146,7 @@ var app = new Vue({
rate: app.heart_num
};
getRequest('post', 'user/index/setBoolData', post, header).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 1) {
toastMsg('记录成功!');
... ... @@ -157,17 +163,19 @@ var app = new Vue({
}
},
getPressure: function () {
var app=this;
var rid=localStorage.getItem("rid")
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
var post = {
rid: api.pageParam.rid,
rid: rid,
type: 2
};
getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) {
console.log(res.data.data.high)
// alert(JSON.stringify(res))
if (res.data.code == 1) {
app.date_info = res.data.data.time;
... ...
... ... @@ -16,8 +16,17 @@ function openWin(data) {
}
function openView(fmName, fmUrl, winTitle, winName, winUrl, fmParams, winParams) {
if(fmParams){
for (var item in fmParams) {
console.log(item)
console.log(fmParams[item])
localStorage.setItem(item,fmParams[item])
}
}
if(winParams){
for (var item in winParams) {
console.log(item)
console.log(winParams[item])
localStorage.setItem(item,winParams[item])
}
}
... ... @@ -360,7 +369,7 @@ function getRequest(type, url, params, header) {
}, 2000);
// openView('login_index', 'login/login_index', '登录', 'login_index', false, false, false)
} else {
resolve(res)
resolve(res)
}
loadEnd();
// resolve(res)
... ...
... ... @@ -123,15 +123,19 @@
status3: ''
},
created: function () {
apiready = function () {
app.type_id = api.pageParam.id;
app.rid = api.pageParam.rid;
app.typeInfo();
}
// var app=this;
// apiready = function () {
// app.type_id = api.pageParam.id;
// app.rid = api.pageParam.rid;
this.type_id=localStorage.getItem("id");
this.rid=localStorage.getItem("rid")
this.typeInfo();
// }
},
methods: {
// 获取选择数据
typeInfo: function () {
var app=this;
var post = {
type_id: app.type_id
};
... ... @@ -171,6 +175,7 @@
},
// 多选
choose_more: function (select, index) {
var app=this;
Array.prototype.indexOf = function (val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
... ... @@ -195,7 +200,8 @@
,
// 第一道单选
chooseAnswer: function (index) {
for (let m in app.answer_one) {
var app=this;
for (var m in app.answer_one) {
app.answer_one[m].select = 0
}
var ind = app.answer_one[index].select;
... ... @@ -210,6 +216,7 @@
,
// 第二道单选
chooseAnswer2: function (index) {
var app=this;
for (var n in app.answer_thr) {
app.answer_thr[n].select = 0
}
... ... @@ -224,6 +231,7 @@
,
// 保存选择结果
save_info: function () {
var app=this;
toastMsg('正在保存')
// api.showProgress({
... ...
... ... @@ -113,7 +113,7 @@
<img :src="head_img?head_img:'../../assets/image/default_img.png'" alt="">
</span>
<span class="iconfont icon-xiangyou"></span>
<input type="file" @change="takePhotos" accept="image/jpeg,image/x-png,image/gif" id="" value="" class="img_input">
<input type="file" @change="takePhotos($event)" accept="image/jpeg,image/x-png,image/gif" id="" value="" class="img_input">
</div>
<mt-popup v-model="popupVisible_head_img" position="bottom">
<ul class="moreoul">
... ... @@ -238,6 +238,7 @@
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
... ... @@ -353,9 +354,9 @@
})
},
// 选择头像
takePhotos: function () {
takePhotos: function (e) {
var app = this;
var file = e.target.files[0];e
var file = e.target.files[0];
var imgSize=file.size/1024;
if(imgSize>200){
alert('请上传大小不要超过200KB的图片')
... ... @@ -779,4 +780,4 @@
},
}
})
</script>
\ No newline at end of file
</script>
... ...
... ... @@ -488,19 +488,19 @@
openData: function () {
var app = this;
app.img_active = false;
api.sendEvent({
name: 'hidelist',
extra: {
img_active:app.img_active
}
});
openView('my_healthData', 'my/my_healthData', '健康数据', 'my_healthData', false, {rid: app.rid})
// api.sendEvent({
// name: 'hidelist',
// extra: {
// img_active:app.img_active
// }
// });
openView('my_healthData', '../my/my_healthData', '健康数据', 'my_healthData', false, {rid: app.rid})
},
// 健康史
openHistory: function () {
var app = this;
app.img_active = false;
openView('my_history', 'my/my_history', '健康史', 'my_history', false, {rid: app.rid});
openView('my_history', '../my/my_history', '健康史', 'my_history', false, {rid: app.rid});
},
// 亲友档案
openFriend: function () {
... ...
... ... @@ -95,34 +95,41 @@
rid: ''
},
created: function () {
apiready = function () {
app.rid = api.pageParam.rid;
// apiready = function () {
// var app = this;
// app.rid = api.pageParam.rid;
this.rid = localStorage.getItem('rid');
// alert(app.rid);
app.healthData();
api.addEventListener({
name: 'sugar'
}, function (ret, err) {
app.healthData();
});
api.addEventListener({
name: 'pressure'
}, function (ret, err) {
app.healthData();
});
}
this.healthData();
// api.addEventListener({
// name: 'sugar'
// }, function (ret, err) {
// app.healthData();
// });
// api.addEventListener({
// name: 'pressure'
// }, function (ret, err) {
// app.healthData();
// });
// }
},
methods: {
// 记录血压
openPress: function () {
openView('my_pressure', 'my/my_pressure', '手动血压记录', 'my_pressure', false, {rid: app.rid})
var app = this;
openView('my_pressure', '../my/my_pressure', '手动血压记录', 'my_pressure', false, {rid: app.rid})
},
// 记录血糖
openSugar: function () {
openView('my_sugar', 'my/my_sugar', '记血糖', 'my_sugar', false, {rid: app.rid})
var app = this;
openView('my_sugar', '../my/my_sugar', '记血糖', 'my_sugar', false, {rid: app.rid})
},
// 增加报告
open_des: function (name, date_type, type_name, type_home, type_id) {
openView('my_report', 'my/my_report', name, 'my_report', false, {
var app = this;
openView('my_report', '../my/my_report', name, 'my_report', false, {
date_type: date_type,
type_name: type_name,
type_home: type_home,
... ... @@ -132,6 +139,7 @@
},
// 获取血糖,血压
healthData: function () {
var app = this;
var post = {
rid: app.rid
};
... ... @@ -141,6 +149,7 @@
};
getRequest('post', 'user/index/healthData', post, header).then(function (res) {
loadEnd();
console.log(res)
if (res.data.code == 1) {
app.sugar_data = res.data.data.suger.data ? res.data.data.suger.data : 0;
app.puser_data = res.data.data.puser.data ? res.data.data.puser.data : 0/0;
... ...
... ... @@ -134,8 +134,9 @@
methods: {
// 打开详情
openHome: function (name, index) {
var app = this;
openView('history_detail', 'my/history_detail', name, 'history_detail', false, {
openView('history_detail', '../my/history_detail', name, 'history_detail', false, {
rid: app.rid,
id: index
})
... ... @@ -163,4 +164,4 @@
}
}
})
</script>
\ No newline at end of file
</script>
... ...
... ... @@ -55,6 +55,9 @@
.data_box {
background-color: #fff;
/*display:flex;*/
/*justify-content:space-between;*/
/*align-items: center;*/
}
.icon-xiangyou {
... ... @@ -64,23 +67,27 @@
#jedate{
left:0.5rem
}
#chosetime{
outline:none;
/*!*height:0.68rem;*!*/
border:none;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app">
<div class="data_box">
<div class="data_item" @click="dateSelect"><span>测量时间</span>
<div class="data_item"><span>测量时间</span>
<!--<div class="data_item_right"><span>{{date_info?date_info:default_date}}</span>-->
<!--&lt;!&ndash;<span class="iconfont icon-xiangyou"></span>&ndash;&gt;-->
<!--</div>-->
<div class="data_item_right">
<div class="date_box">
<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>
<!--<div class="iconfont icon-xiangyou" ></div>-->
<div class="date_box" >
<!--<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>-->
<input type="datetime-local" id="chosetime" placeholder="请选择测量时间">
</div>
<p class="iconfont icon-xiangyou"></p>
</div>
</div>
<div class="data_item" @click="choose_high">
... ... @@ -125,12 +132,204 @@
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
<script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="../../assets/js/mypressure.js"></script>
<!--<script type="text/javascript" src="../../assets/js/mypressure.js"></script>-->
<script type="text/javascript" src="../../assets/js/jedate.js"></script>
<script type="text/javascript" src="../../assets/js/demo.js"></script>
<!--<script type="text/javascript" src="../../assets/js/demo.js"></script>-->
<script>
var app = new Vue({
el: '#app',
data: {
year: '',
month: '',
day: '',
hour: '',
minute: '',
date_info: '',
default_date: '',
popupVisible: false,
high_list: [],
low_list: [],
high: '请选择高压(mmHg)',
low: '请选择低压(mmHg)',
heart_num: '',
rid: ''
},
created: function () {
// apiready = function () {
// app.rid = api.pageParam.rid;
this.rid=localStorage.getItem("rid");
console.log(this.rid)
this.getPressure();
for (var i = 0; i < 300; i++) {
this.high_list.push({
"label": i,
"value": i,
})
}
// }
},
methods: {
// 日期选择
// dateSelect: function () {
// // if (api.systemType == 'ios') {
// // api.openPicker({
// // type: 'date_time',
// // date: new Date(),
// // maxDate: getTimeDetil(0),
// // title: '测量时间'
// // }, function (ret, err) {
// // if (ret) {
// // app.year = ret.year;
// // app.month = ret.month;
// // app.day = ret.day;
// // app.hour = ret.hour;
// // app.minute = ret.minute;
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// // if (checkDate(app.date_info, 2)) {
// // return app.date_info
// // } else {
// // toastMsg('请选择正确的测量时间');
// // return app.date_info = ''
// // }
// // } else {
// // console.log(err)
// // }
// // });
// // }
// // else {
// // api.openPicker({
// // type: 'date',
// // title: '测量时间',
// // }, function (ret, err) {
// // if (ret) {
// // app.year = ret.year;
// // app.month = ret.month;
// // app.day = ret.day;
// // api.openPicker({
// // type: 'time',
// // title: '测量时间'
// // }, function (rets, errs) {
// // if (rets) {
// // app.hour = rets.hour;
// // app.minute = rets.minute;
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
// // if (checkDate(app.date_info, 2)) {
// // return app.date_info
// // } else {
// // toastMsg('请选择正确的测量时间');
// // return app.date_info = ''
// // }
// // } else {
// // console.log(errs)
// // }
// // });
// // } else {
// // console.log(err)
// // }
// // });
// // }
// },
// 选择高压
choose_high: function () {
var app=this;
weui.picker(app.high_list, {
onChange: function (result) {
},
onConfirm: function (result) {
app.high = result[0].label;
}
});
},
// 选择低压
choose_low: function () {
var app=this;
weui.picker(app.high_list, {
onChange: function (result) {
},
onConfirm: function (result) {
app.low = result[0].label;
}
});
},
// 保存数据
save_data: function () {
var app=this;
app.default_date=$("#test04").val();
if (app.default_date == '') {
toastMsg('请选择测量时间')
}
else if (app.high == '请选择高压(mmHg)') {
toastMsg('请选择高压数据')
}
else if (app.low == '请选择低压(mmHg)') {
toastMsg('请选择低压')
} else if (app.heart_num == '') {
toastMsg('请输入心率')
}
else {
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
var post = {
rid: app.rid,
time: app.date_info,
data: app.high + '/' + app.low,
type: 2,
rate: app.heart_num
};
getRequest('post', 'user/index/setBoolData', post, header).then(function (res) {
// alert(JSON.stringify(res))
if (res.data.code == 1) {
toastMsg('记录成功!');
setTimeout(function () {
api.sendEvent({
name: 'pressure',
});
api.closeWin()
}, 1000);
} else {
toastMsg(res.msg)
}
})
}
},
getPressure: function () {
var app=this;
var rid=localStorage.getItem("rid")
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
var post = {
rid: rid,
type: 2
};
getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) {
console.log(res.data.data.high)
// alert(JSON.stringify(res))
if (res.data.code == 1) {
app.date_info = res.data.data.time;
app.high = res.data.data.high;
app.low = res.data.data.low;
app.heart_num = res.data.data.rate;
} else {
toastMsg(res.data.msg)
}
loadEnd()
})
}
}
})
</script>
... ...
... ... @@ -54,6 +54,7 @@
.date_box {
position:relative;
width:7.5rem;
display: flex;
align-items: center;
justify-content: space-between;
... ... @@ -102,6 +103,11 @@
background: #fff url("../../assets/image/loading.gif") center center no-repeat;
background-size: 12%;
}
#chosetime{
outline:none;
height:0.68rem;
border:none;
}
</style>
</head>
... ... @@ -133,8 +139,9 @@
<div class="jeitem ">
<div class="jelabel ">请选择测量时间</div>
<div class="date_box">
<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" placeholder="请选择测量时间" style="width:96%" readonly></div>
<!--<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" placeholder="请选择测量时间" style="width:96%" readonly></div>-->
<!--<div class="iconfont icon-xiangyou" ></div>-->
<input type="datetime-local" id="chosetime" placeholder="请选择测量时间">
</div>
</div>
... ... @@ -155,16 +162,17 @@
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script type="text/javascript" src="../../assets/js/jedate.js"></script>
<script type="text/javascript" src="../../assets/js/demo.js"></script>
<!--<script type="text/javascript" src="../../assets/js/demo.js"></script>-->
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
<script type="text/javascript">
$(function () {
apiready = function () {
// apiready = function () {
$(document).ready(function () {
var type=1
$(".knob").knob();
loadEnd();
var rid=localStorage.getItem("rid")
function getSugar() {
var header = {
... ... @@ -172,7 +180,7 @@
'XX-Token': getToken()
};
var post = {
rid: api.pageParam.rid,
rid: rid,
type: 1
};
getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) {
... ... @@ -261,17 +269,22 @@
});
$('.save_btn').click(function () {
var rid=localStorage.getItem("rid")
var value = $('.knob').val();
var date = $('#test04').val();
var date = $('#chosetime').val();
date=date.split("T");
date=date[0]+" " +date[1];
// type = $('.sugar_type').attr('data-type');
type = $('.spanactive').attr('data-id')
// console.log(type)
var post = {
rid: api.pageParam.rid,
rid: rid,
time_type: type,
time: date,
data: value,
... ... @@ -308,6 +321,6 @@
})
}
// }
});
</script>
... ...