|
@ -0,0 +1,257 @@
|
|
|
<!doctype html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title>选择您的服务类型</title>
|
|
|
<meta name="author" content="yihu.com" />
|
|
|
<meta name="format-detection" content="telephone=no" />
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
|
<link rel="stylesheet" href="../../../css/cross.css">
|
|
|
<link rel="stylesheet" href="../../../css/cross.ui.css">
|
|
|
<link rel="stylesheet" href="../../../css/mui.min.css">
|
|
|
<link rel="stylesheet" href="../css/updateService.css" type="text/css" />
|
|
|
|
|
|
</head>
|
|
|
|
|
|
<body style="background: #f3f3f3;">
|
|
|
<div class="mt5">
|
|
|
<ul class="w3-row w3-row-padding mb10 clearfix" id="_service">
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="plr15 submitbtn">
|
|
|
<a onclick="submit()" class="c-btn c-btn-full c-btn-4dcd70 border-radius-pill c-f17 pt10" style="height: 45px;">保 存</a>
|
|
|
</div>
|
|
|
<script type="text/html" id="service_tmp">
|
|
|
{{each list as it}}
|
|
|
<li class="w3-col s4" data-code="{{it.labelCode}}" data-name="{{it.labelName0}}" >
|
|
|
<div class="outdiv">
|
|
|
<div class="labelIcon {{it.labelIcon}}">
|
|
|
<div class="labelIcon1 {{it.labelIcon}}">
|
|
|
<div class="pt10 pl10 c-f16 c-333">{{it.labelName0}}</div>
|
|
|
<div class="pt5 pl10 c-f14 c-909090">{{it.labelName1}}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</li>
|
|
|
{{/each}}
|
|
|
</script>
|
|
|
<script src="../../../js/jquery/2.1.3/jquery.js"></script>
|
|
|
<script type="text/javascript" src="../../../js/mui.min.js"></script>
|
|
|
<script type="text/javascript" src="../../../js/app.js"></script>
|
|
|
<script type="text/javascript" src="../../../js/weixin_common.js"></script>
|
|
|
<script type="text/javascript" src="../../../js/underscore.js"></script>
|
|
|
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
|
|
<script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../js/security.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
|
|
|
<script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
|
|
|
<script>
|
|
|
var dd = dialog({
|
|
|
contentType: 'load',
|
|
|
skin: 'bk-popup',
|
|
|
content: '保存中...'
|
|
|
});
|
|
|
var d = dialog({
|
|
|
contentType: 'load',
|
|
|
skin: 'bk-popup'
|
|
|
});
|
|
|
var Request = new Object();
|
|
|
Request = GetRequest();
|
|
|
var openid = Request["openid"];
|
|
|
var type = Number(Request["type"]);
|
|
|
var service = Request["service"];
|
|
|
var doctor = Request["doctor"];
|
|
|
var userAgent = window.localStorage.getItem(agentName);
|
|
|
$(function() {
|
|
|
var paramAgent = $.parseJSON(window.localStorage.getItem("paramAgent", paramAgent))
|
|
|
if(!service){service=1}
|
|
|
checkUserAgent();
|
|
|
getServices();
|
|
|
})
|
|
|
|
|
|
function getServices() {
|
|
|
d.show();
|
|
|
var url = "/patient/serviceType",
|
|
|
params = {
|
|
|
|
|
|
};
|
|
|
sendPost(url, params, 'JSON', 'GET', queryFailed, function(res) {
|
|
|
d.close();
|
|
|
if(res.status == 200) {
|
|
|
var list = _.map(res.list, function(item, index) {
|
|
|
item.labelIcon = "labelIcon_" + item.labelCode;
|
|
|
if(item.labelName.indexOf("老年人") > -1) {
|
|
|
item.labelName0 = "老年人";
|
|
|
item.labelName1 = "60岁以上";
|
|
|
} else if(item.labelName.indexOf("儿童") > -1) {
|
|
|
item.labelName0 = "儿童";
|
|
|
item.labelName1 = "0-6岁";
|
|
|
}else if(item.labelName.indexOf("精神疾病") > -1) {
|
|
|
item.labelName0 = "精神疾病";
|
|
|
item.labelName1 = "重度";
|
|
|
} else {
|
|
|
item.labelName0 = item.labelName;
|
|
|
item.labelName1 = "";
|
|
|
}
|
|
|
return item;
|
|
|
});
|
|
|
var html = template("service_tmp", {
|
|
|
list: list
|
|
|
});
|
|
|
$("#_service").empty().append(html);
|
|
|
bindEvents();
|
|
|
autodivheight();
|
|
|
} else {
|
|
|
queryFailed(res);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
//请求失败处理事件
|
|
|
function queryFailed(res, message) {
|
|
|
d.close();
|
|
|
if(message) {
|
|
|
dialog({
|
|
|
contentType: 'tipsbox',
|
|
|
bottom: true,
|
|
|
skin: 'bk-popup',
|
|
|
content: message
|
|
|
}).show();
|
|
|
} else {
|
|
|
if(res && res.msg) {
|
|
|
dialog({
|
|
|
contentType: 'tipsbox',
|
|
|
bottom: true,
|
|
|
skin: 'bk-popup',
|
|
|
content: res.msg
|
|
|
}).show();
|
|
|
} else {
|
|
|
dialog({
|
|
|
contentType: 'tipsbox',
|
|
|
bottom: true,
|
|
|
skin: 'bk-popup',
|
|
|
content: '加载失败'
|
|
|
}).show();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function bindEvents() {
|
|
|
//单个服务点击
|
|
|
$("#_service").on("tap", "li", function() {
|
|
|
$("#_service li[data-code='" + service + "']").removeClass("active");
|
|
|
service = $(this).attr("data-code")
|
|
|
$(this).addClass("active");
|
|
|
})
|
|
|
if(service) {
|
|
|
$("#_service li[data-code='" + service + "']").addClass("active");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function submit() {
|
|
|
dd.showModal();
|
|
|
var _active = $("#_service li.active");
|
|
|
var params = {
|
|
|
patient: window.localStorage.getItem("firstUid"),
|
|
|
name: window.localStorage.getItem("firstName"),
|
|
|
label: _active.attr("data-code"),
|
|
|
labelName: _active.attr("data-name"),
|
|
|
};
|
|
|
sendPost('patient/saveServiceType', params, 'json', 'post', operateFailed, operateSuccesss);
|
|
|
}
|
|
|
|
|
|
//失败
|
|
|
function operateFailed(res) {
|
|
|
dd.close();
|
|
|
if(res && res.msg) {
|
|
|
dialog({
|
|
|
contentType: 'tipsbox',
|
|
|
bottom: true,
|
|
|
skin: 'bk-popup',
|
|
|
content: res.msg
|
|
|
}).show();
|
|
|
} else {
|
|
|
dialog({
|
|
|
contentType: 'tipsbox',
|
|
|
bottom: true,
|
|
|
skin: 'bk-popup',
|
|
|
content: '保存失败'
|
|
|
}).show();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//成功调用登录接口
|
|
|
function operateSuccesss(res) {
|
|
|
if(res.status == 200) {
|
|
|
dd.close();
|
|
|
dialog({
|
|
|
content: '保存成功',
|
|
|
okValue: '确定',
|
|
|
ok: function() {
|
|
|
if(type == 4) {
|
|
|
window.location.href = "my-detail.html?type=" + type + "&openid=" + openid;
|
|
|
} else {
|
|
|
if(doctor) {
|
|
|
checkDocInWork(doctor)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}).showModal();
|
|
|
} else {
|
|
|
//非200则为失败
|
|
|
operateFailed(res);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取签约医生的工作时间
|
|
|
function checkDocInWork(doctor) {
|
|
|
var url = 'patient/consult/isDoctorWorkWhenconsult',
|
|
|
params = {
|
|
|
doctor: doctor
|
|
|
};
|
|
|
sendPost(url, params, 'json', 'post', queryFailed, function(res) {
|
|
|
$("#isFocus").removeClass("disabled");
|
|
|
if(res.status == 200) {
|
|
|
d.close();
|
|
|
// data:0-医生不接受咨询/1-医生当前接受咨询/2-全科医生和健管师当前都不在工作时间/3-全科医生当前不在工作时间/4-健管师当前不在工作时间 健管师当前不在工作时间
|
|
|
if(!(res.data == "1")) {
|
|
|
dialog({
|
|
|
content: '您好,由于您关注的医生工作繁忙,设置了每日回复咨询的时间段,所以,在该时间段外的时间,您的咨询将不会马上获得医生的回复。',
|
|
|
okValue: '查看医生工作时间',
|
|
|
ok: function() {
|
|
|
window.location.href = "../../yszx/html/doctor-work-hours.html?doctor=" + doctor;
|
|
|
},
|
|
|
cancelValue: '继续新增咨询',
|
|
|
cancel: function() {
|
|
|
window.location.href = "../../yszx/html/add-consult.html?doctorCode=" + doctor;
|
|
|
}
|
|
|
}).showModal();
|
|
|
} else {
|
|
|
//跳转到新增咨询页面
|
|
|
window.location.href = "../../yszx/html/add-consult.html?doctorCode=" + doctor;
|
|
|
}
|
|
|
} else {
|
|
|
queryFailed(res);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function autodivheight() { //函数:获取尺寸
|
|
|
//获取浏览器窗口高度
|
|
|
var divWidth = $("#_service li").width();
|
|
|
$("#_service li").each(function() {
|
|
|
$(this).find(".outdiv").css('height', divWidth *1.28 + 'px');
|
|
|
})
|
|
|
}
|
|
|
window.onresize = autodivheight; //浏览器窗口发生变化时同时变化DIV高度
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|