|
@ -16,7 +16,7 @@ var chooseType; //记录选择的咨询类型
|
|
var loaded = [true, false]; //标记两个tab是否已经加载过
|
|
var loaded = [true, false]; //标记两个tab是否已经加载过
|
|
var chooseTab = 1; //默认选中的是家庭健康咨询
|
|
var chooseTab = 1; //默认选中的是家庭健康咨询
|
|
var expensesStatus ="";//'扣费状态 【""没有签约信息 "0"未扣费 "1"已扣费 "2"已退费】'
|
|
var expensesStatus ="";//'扣费状态 【""没有签约信息 "0"未扣费 "1"已扣费 "2"已退费】'
|
|
var is_sign;
|
|
|
|
|
|
var is_sign = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -55,8 +55,8 @@ function initScroller(){
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
if(index == 0){
|
|
if(index == 0){
|
|
getHealthConsulationList();
|
|
getHealthConsulationList();
|
|
}else{
|
|
|
|
getPreConsultList();
|
|
|
|
|
|
// }else{
|
|
|
|
// getPreConsultList();
|
|
}
|
|
}
|
|
self.endPullupToRefresh();
|
|
self.endPullupToRefresh();
|
|
}, 1000);
|
|
}, 1000);
|
|
@ -114,23 +114,23 @@ function getPatientInfo(){
|
|
}
|
|
}
|
|
}).showModal();
|
|
}).showModal();
|
|
}
|
|
}
|
|
if(data.prescription == 1){ //慢病人员,可以续方
|
|
|
|
//如果患者在白名单中,则显示续方咨询tab的信息
|
|
|
|
if(canPrescription){
|
|
|
|
$("#preTab").show();
|
|
|
|
$(".xufangsq-icon").show();
|
|
|
|
mui('#slider').slider().setStopped(false);
|
|
|
|
}else{
|
|
|
|
$("#preTab").hide();
|
|
|
|
$(".xufangsq-icon").hide();
|
|
|
|
mui('#slider').slider().setStopped(true);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
|
|
// if(data.prescription == 1){ //慢病人员,可以续方
|
|
|
|
// //如果患者在白名单中,则显示续方咨询tab的信息
|
|
|
|
// if(canPrescription){
|
|
|
|
// $("#preTab").show();
|
|
|
|
// $(".xufangsq-icon").show();
|
|
|
|
// mui('#slider').slider().setStopped(false);
|
|
|
|
// }else{
|
|
|
|
// $("#preTab").hide();
|
|
|
|
// $(".xufangsq-icon").hide();
|
|
|
|
// mui('#slider').slider().setStopped(true);
|
|
|
|
// }
|
|
|
|
// }else{
|
|
mui('#slider').slider().gotoItem(0);
|
|
mui('#slider').slider().gotoItem(0);
|
|
$("#preTab").hide();
|
|
$("#preTab").hide();
|
|
$(".xufangsq-icon").hide();
|
|
|
|
|
|
// $(".xufangsq-icon").hide();
|
|
mui('#slider').slider().setStopped(true);
|
|
mui('#slider').slider().setStopped(true);
|
|
}
|
|
|
|
|
|
// }
|
|
//判断签约状态
|
|
//判断签约状态
|
|
checkIsSign();
|
|
checkIsSign();
|
|
} else {
|
|
} else {
|
|
@ -147,13 +147,13 @@ function checkIsSign(){
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
is_sign = res.data;//0未签约,1已签约
|
|
is_sign = res.data;//0未签约,1已签约
|
|
// if(is_sign==1 || is_sign == -1){//1已经签约的
|
|
// if(is_sign==1 || is_sign == -1){//1已经签约的
|
|
if(chooseTab == 1){
|
|
|
|
|
|
// if(chooseTab == 1){
|
|
mui('#healthConsulationPanel').pullRefresh().scrollTo(0, 0, 1000);
|
|
mui('#healthConsulationPanel').pullRefresh().scrollTo(0, 0, 1000);
|
|
getHealthConsulationList(); //获取健康咨询列表
|
|
getHealthConsulationList(); //获取健康咨询列表
|
|
}else{
|
|
|
|
mui('#re-prescriptionConsulationPanel').pullRefresh().scrollTo(0, 0, 1000);
|
|
|
|
getPreConsultList(); //获取健康咨询列表
|
|
|
|
}
|
|
|
|
|
|
// }else{
|
|
|
|
// mui('#re-prescriptionConsulationPanel').pullRefresh().scrollTo(0, 0, 1000);
|
|
|
|
// getPreConsultList(); //获取健康咨询列表
|
|
|
|
// }
|
|
// }else
|
|
// }else
|
|
// if(is_sign==0){
|
|
// if(is_sign==0){
|
|
// d.close();
|
|
// d.close();
|
|
@ -251,79 +251,79 @@ function getHealthConsulationList(){
|
|
}
|
|
}
|
|
|
|
|
|
//获取续方咨询列表
|
|
//获取续方咨询列表
|
|
function getPreConsultList(){
|
|
|
|
d.show();
|
|
|
|
var url = 'patient/consult/getPreConsultList',
|
|
|
|
params = {
|
|
|
|
id: xfId,
|
|
|
|
pagesize: xfPageSize,
|
|
|
|
title: $("#item2 .inp-search").val().trim()
|
|
|
|
};
|
|
|
|
sendPost(url, params, 'json', 'get', queryFailed, function(res){
|
|
|
|
if(res.status == 200){
|
|
|
|
d.close();
|
|
|
|
$("#re-prescriptionConsulationPanel").show();
|
|
|
|
if(res.list.length > 0){
|
|
|
|
$('#ul_xufang_consultation').show();
|
|
|
|
$('#item2 .vertical-line').show();
|
|
|
|
$("#item2 .div-no-info").hide();
|
|
|
|
$("#item2 .div-no-search-info").hide();
|
|
|
|
var searchText = $("#item2 .inp-search").val().trim();
|
|
|
|
var list = _.map(res.list, function(o){
|
|
|
|
o.jsonStr = JSON.stringify(o);
|
|
|
|
//针对搜索字体
|
|
|
|
if(searchText.length > 0){
|
|
|
|
var reg = new RegExp(searchText,"g");
|
|
|
|
o.symptoms = o.symptoms.replace(reg, '<em>'+searchText+"</em>");
|
|
|
|
}
|
|
|
|
var divStatus = "";
|
|
|
|
if(o.status==0){
|
|
|
|
//咨询中
|
|
|
|
divStatus = "div-beginning";
|
|
|
|
}else if(o.evaluate ==1){
|
|
|
|
divStatus = "div-hasvalue";//是否有评价 0无 1有
|
|
|
|
}else{
|
|
|
|
divStatus = "div-novalue";
|
|
|
|
}
|
|
|
|
o.statusClass = divStatus;
|
|
|
|
return o;
|
|
|
|
});
|
|
|
|
var html = template('re-prescriptionConsulation_tmp', {list: list});
|
|
|
|
if(xfId == 0){
|
|
|
|
$("#ul_xufang_consultation").empty().append(html);
|
|
|
|
}else{
|
|
|
|
$("#ul_xufang_consultation").append(html);
|
|
|
|
}
|
|
|
|
if(res.list.length < xfPageSize){
|
|
|
|
mui("#item2 .mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
|
|
|
|
}
|
|
|
|
xfId ++;
|
|
|
|
}else{
|
|
|
|
if(isPreSearch){//查询无结果
|
|
|
|
$('#ul_xufang_consultation').hide();
|
|
|
|
$('#item2 .vertical-line').hide();
|
|
|
|
$("#item2 .div-no-search-info").show();
|
|
|
|
isPreSearch = false;
|
|
|
|
}else if(xfId==0){//id为0的时候证明是第一次加载,第一次加载无数据,显示无数据界面
|
|
|
|
$('#ul_xufang_consultation').hide();
|
|
|
|
$('#item2 .vertical-line').hide();
|
|
|
|
$("#item2 .div-no-info").show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
queryFailed(res);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//查询签约类型
|
|
|
|
function querySignType(type){
|
|
|
|
chooseType = type;
|
|
|
|
d.show();
|
|
|
|
sendPost('patient/sign_doctors', {}, 'json', 'post', function(res){
|
|
|
|
queryFailed(res, '获取咨询类型失败');
|
|
|
|
}, querySignTypeSuccess);
|
|
|
|
}
|
|
|
|
|
|
//function getPreConsultList(){
|
|
|
|
// d.show();
|
|
|
|
// var url = 'patient/consult/getPreConsultList',
|
|
|
|
// params = {
|
|
|
|
// id: xfId,
|
|
|
|
// pagesize: xfPageSize,
|
|
|
|
// title: $("#item2 .inp-search").val().trim()
|
|
|
|
// };
|
|
|
|
// sendPost(url, params, 'json', 'get', queryFailed, function(res){
|
|
|
|
// if(res.status == 200){
|
|
|
|
// d.close();
|
|
|
|
// $("#re-prescriptionConsulationPanel").show();
|
|
|
|
// if(res.list.length > 0){
|
|
|
|
// $('#ul_xufang_consultation').show();
|
|
|
|
// $('#item2 .vertical-line').show();
|
|
|
|
// $("#item2 .div-no-info").hide();
|
|
|
|
// $("#item2 .div-no-search-info").hide();
|
|
|
|
// var searchText = $("#item2 .inp-search").val().trim();
|
|
|
|
// var list = _.map(res.list, function(o){
|
|
|
|
// o.jsonStr = JSON.stringify(o);
|
|
|
|
// //针对搜索字体
|
|
|
|
// if(searchText.length > 0){
|
|
|
|
// var reg = new RegExp(searchText,"g");
|
|
|
|
// o.symptoms = o.symptoms.replace(reg, '<em>'+searchText+"</em>");
|
|
|
|
// }
|
|
|
|
// var divStatus = "";
|
|
|
|
// if(o.status==0){
|
|
|
|
// //咨询中
|
|
|
|
// divStatus = "div-beginning";
|
|
|
|
// }else if(o.evaluate ==1){
|
|
|
|
// divStatus = "div-hasvalue";//是否有评价 0无 1有
|
|
|
|
// }else{
|
|
|
|
// divStatus = "div-novalue";
|
|
|
|
// }
|
|
|
|
// o.statusClass = divStatus;
|
|
|
|
// return o;
|
|
|
|
// });
|
|
|
|
// var html = template('re-prescriptionConsulation_tmp', {list: list});
|
|
|
|
// if(xfId == 0){
|
|
|
|
// $("#ul_xufang_consultation").empty().append(html);
|
|
|
|
// }else{
|
|
|
|
// $("#ul_xufang_consultation").append(html);
|
|
|
|
// }
|
|
|
|
// if(res.list.length < xfPageSize){
|
|
|
|
// mui("#item2 .mui-scroll-wrapper").pullRefresh().endPullupToRefresh(true);
|
|
|
|
// }
|
|
|
|
// xfId ++;
|
|
|
|
// }else{
|
|
|
|
// if(isPreSearch){//查询无结果
|
|
|
|
// $('#ul_xufang_consultation').hide();
|
|
|
|
// $('#item2 .vertical-line').hide();
|
|
|
|
// $("#item2 .div-no-search-info").show();
|
|
|
|
// isPreSearch = false;
|
|
|
|
// }else if(xfId==0){//id为0的时候证明是第一次加载,第一次加载无数据,显示无数据界面
|
|
|
|
// $('#ul_xufang_consultation').hide();
|
|
|
|
// $('#item2 .vertical-line').hide();
|
|
|
|
// $("#item2 .div-no-info").show();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }else{
|
|
|
|
// queryFailed(res);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
////查询签约类型
|
|
|
|
//function querySignType(type){
|
|
|
|
// chooseType = type;
|
|
|
|
// d.show();
|
|
|
|
// sendPost('patient/sign_doctors', {}, 'json', 'post', function(res){
|
|
|
|
// queryFailed(res, '获取咨询类型失败');
|
|
|
|
// }, querySignTypeSuccess);
|
|
|
|
//}
|
|
|
|
|
|
//查询签约类型成功回调处理事件
|
|
//查询签约类型成功回调处理事件
|
|
function querySignTypeSuccess(res){
|
|
function querySignTypeSuccess(res){
|
|
@ -621,8 +621,8 @@ function bindEvents(){
|
|
// //未缴费居民限制咨询次数
|
|
// //未缴费居民限制咨询次数
|
|
// limitZxTimes();
|
|
// limitZxTimes();
|
|
// }
|
|
// }
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
//点击名医咨询事件
|
|
//点击名医咨询事件
|
|
$(".mingyi-icon").on("click",function(){
|
|
$(".mingyi-icon").on("click",function(){
|
|
$(this).addClass("active");
|
|
$(this).addClass("active");
|
|
@ -664,7 +664,8 @@ function bindEvents(){
|
|
|
|
|
|
//点击发起咨询事件
|
|
//点击发起咨询事件
|
|
$("#launch-btn").on("tap",function(){
|
|
$("#launch-btn").on("tap",function(){
|
|
$(".div-add-btn").trigger("click");
|
|
|
|
|
|
// $(".div-add-btn").trigger("click");
|
|
|
|
window.location.href = "select-consult-doctor.html";
|
|
});
|
|
});
|
|
|
|
|
|
//点击续方tab内发起咨询的事件
|
|
//点击续方tab内发起咨询的事件
|