doctor-homepage.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  5. <meta charset="utf-8">
  6. <title>医生主页</title>
  7. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/sq-style.css" />
  10. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  11. <link rel="stylesheet" type="text/css" href="../css/wdz.css">
  12. <script src="../../../js/jquery/2.1.3/jquery.js"></script>
  13. <script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
  14. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  15. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
  16. <script src="../js/general.js"></script>
  17. <script src="../../../widget/marques/marquee.js"></script>
  18. <script type="text/javascript" src="../../../js/common_http.js" ></script>
  19. <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
  20. <link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.15.1/css/mobiscroll.css">
  21. <script src="../../../widget/mobiscroll/2.15.1/js/mobiscroll.js"></script>
  22. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  23. </head>
  24. <body>
  25. <div class="c-main">
  26. <!--<div class="h45">
  27. <div class="demo-comtop">
  28. <a class="mui-action-back"></a>
  29. <h1>医生主页</h1>
  30. </div>
  31. </div>-->
  32. <div class="sdoc-top smil short clearfix">
  33. <span class="sdimg fl">
  34. <img id="photo" src="" class="c-images-cycle" />
  35. </span>
  36. <p class="c-t-left mt5 c-f18">
  37. <span id="name" class="c-f20 mr10 ml10"></span><label id="jobName"></label></p>
  38. <p class="c-t-left c-f16">
  39. <span id="hospitalName" class="mr10 ml10"></span></p>
  40. <p class="c-t-left c-f16">
  41. <span id="deptName" class="mr10 ml10"></span></p>
  42. </div>
  43. <div class="slider-detail plr15 bgc-fff mtb10 c-border-tb">
  44. <ul>
  45. <li class="c-border-b">
  46. <h2 class="c-f18">擅长</h2>
  47. <p class="c-f16 show" id="expertise"></p>
  48. </li>
  49. <li>
  50. <h2 class="c-f18">简介</h2>
  51. <p class="c-f16 show" id="introduce"></p>
  52. </li>
  53. </ul>
  54. </div>
  55. <div id="divAgree" class="bgc-fff mt10 c-border-tb list-item-1">
  56. <div class="ui-grid ptb15 plr10 c-border-b">
  57. <img src="../images/xieyi@2x.png" style="width: 20px; height: 20px;"/>
  58. <div class="ui-col-1" style="padding-left: 5px;">
  59. <p class="tit-name c-nowrap c-f18 c-333">签约协议</p>
  60. </div>
  61. </div>
  62. <ul class="c-list sever-list">
  63. <li class="c-list-cover c-list-text" onclick="changeAgreement()" style="height: 80px;">
  64. <div style="padding-top: 15px; padding-bottom: 5px;">
  65. <img src="../images/jiatingqianyue@2x.png" style="width: 45px; height: 45px;"/>
  66. </div>
  67. <div class="c-list-info" style="padding-left: 10px;">
  68. <h4 class="c-nowrap c-f16">家庭医生签约协议</h4>
  69. </div>
  70. <span class="list-icon arrow-right"></span>
  71. </li>
  72. </ul>
  73. </div>
  74. <!-- 服务介绍 开始 -->
  75. <div class="bgc-fff c-border-tb list-item-1 mt10 mb30">
  76. <!-- 头部部分 开始 -->
  77. <div class="ui-grid ptb15 plr10 c-border-b">
  78. <i class="logo-icon iconfont icon-yanghu bgc-fb8d7c"></i>
  79. <div class="ui-col-1">
  80. <p class="tit-name c-nowrap c-f18 c-333">服务介绍</p>
  81. </div>
  82. </div>
  83. <!-- 头部部分 结束 -->
  84. <!-- 列表项 开始 -->
  85. <ul id="ul-common" class="c-list sever-list" style="display: none;">
  86. <li class="c-list-cover c-list-text">
  87. <div class="c-avatar-m bgc-3fcba9" style="border-radius: 15px;">
  88. <i class="iconfont icon-yisheng"></i>
  89. </div>
  90. <div class="c-list-info">
  91. <h4 class="c-nowrap">家庭医生服务</h4>
  92. <p class="c-nowrap-multi">贴心家庭医生为居民提供健康指导,保健,随访等服务</p>
  93. </div>
  94. </li>
  95. <li class="c-list-cover c-list-text">
  96. <div class="c-avatar-m bgc-52a5f1" style="border-radius: 15px;">
  97. <i class="iconfont icon-zixun"></i>
  98. </div>
  99. <div class="c-list-info">
  100. <h4 class="c-nowrap">健康咨询服务</h4>
  101. <p class="c-nowrap-multi">身体疾病,用药疑问让居民足不出户,在家就能及时咨询到医生</p>
  102. </div>
  103. </li>
  104. <li class="c-list-cover c-list-text">
  105. <div class="c-avatar-m bgc-f98d44" style="border-radius: 15px;">
  106. <i class="iconfont icon-yanghu1"></i>
  107. </div>
  108. <div class="c-list-info">
  109. <h4 class="c-nowrap">慢病养护</h4>
  110. <p class="c-nowrap-multi">对患有慢性疾病居民进行健康管理与干预,定期进行随访以及保健指导</p>
  111. </div>
  112. </li>
  113. <li class="c-list-cover c-list-text">
  114. <div class="c-avatar-m bgc-67bfed" style="border-radius: 15px;">
  115. <i class="iconfont icon-zixun1"></i>
  116. </div>
  117. <div class="c-list-info">
  118. <h4 class="c-nowrap">健康头条资讯</h4>
  119. <p class="c-nowrap-multi">热点健康知识推送,提升家庭健康意识</p>
  120. </div>
  121. </li>
  122. <li class="c-list-cover c-list-text">
  123. <div class="c-avatar-m bgc-91c66a" style="border-radius: 15px;">
  124. <i class="iconfont icon-fenzhen"></i>
  125. </div>
  126. <div class="c-list-info">
  127. <h4 class="c-nowrap">分诊预约</h4>
  128. <p class="c-nowrap-multi">社区可以帮助有需要的居民进行分诊预约三甲医院</p>
  129. </div>
  130. </li>
  131. <li class="c-list-cover c-list-text">
  132. <div class="c-avatar-m bgc-f792b1" style="border-radius: 15px;">
  133. <i class="iconfont icon-yunfu"></i>
  134. </div>
  135. <div class="c-list-info">
  136. <h4 class="c-nowrap">妇幼保健</h4>
  137. <p class="c-nowrap-multi">对儿童疫苗接种进行提醒,对孕产、妇幼人群提供养生保健知识</p>
  138. </div>
  139. </li>
  140. </ul>
  141. <ul id="ul-health" class="c-list sever-list" style="display: none;">
  142. <li class="c-list-cover c-list-text">
  143. <div class="c-avatar-m bgc-3fcba9" style="border-radius: 15px;">
  144. <i class="iconfont icon-yisheng"></i>
  145. </div>
  146. <div class="c-list-info">
  147. <h4 class="c-nowrap">医保优惠</h4>
  148. <p>社区门诊免除500元起付线,住院医疗费不设二次及以上起付标准(二次及以上住院可以免付100-500起付线)</p>
  149. </div>
  150. </li>
  151. <li class="c-list-cover c-list-text">
  152. <div class="c-avatar-m bgc-52a5f1" style="border-radius: 15px;">
  153. <i class="iconfont icon-zixun"></i>
  154. </div>
  155. <div class="c-list-info">
  156. <h4 class="c-nowrap">免费服务</h4>
  157. <p>11类43项基本公共卫生服务,专家门诊预约,团队健康管理,便捷双向转诊,大型设备检查预约,康复训练指导,健康指导。</p>
  158. </div>
  159. </li>
  160. <li class="c-list-cover c-list-text">
  161. <div class="c-avatar-m bgc-f98d44" style="border-radius: 15px;">
  162. <i class="iconfont icon-yanghu1"></i>
  163. </div>
  164. <div class="c-list-info">
  165. <h4 class="c-nowrap">个性化服务(按物价规定标准收费)</h4>
  166. <p>基本医疗服务,针对性康复训练和康复治疗服务,健康检查项目:血、尿常规检查、肝功、肾功、血脂、血糖、心电图、胸片,糖化血红蛋白、眼底检查、尿微量白蛋白检测、糖尿病足筛查、踝肱指数、动态血压监测等,提供建立家庭病床、导尿、换药、上门测血糖、上门抽血检验等有偿上门服务。</p>
  167. </div>
  168. </li>
  169. </ul>
  170. <ul id="ul-sixfive" class="c-list sever-list" style="display: none;">
  171. <li class="c-list-cover c-list-text">
  172. <div class="c-avatar-m bgc-3fcba9" style="border-radius: 15px;">
  173. <i class="iconfont icon-yisheng"></i>
  174. </div>
  175. <div class="c-list-info">
  176. <h4 class="c-nowrap">医保优惠</h4>
  177. <p>慢性病长处方,一次可开取4-8周用药,社区门诊免除500元起付线,住院医疗费不设二次及以上起付标准(二次及以上住院可以免付50-250起付线)</p>
  178. </div>
  179. </li>
  180. <li class="c-list-cover c-list-text">
  181. <div class="c-avatar-m bgc-52a5f1" style="border-radius: 15px;">
  182. <i class="iconfont icon-zixun"></i>
  183. </div>
  184. <div class="c-list-info">
  185. <h4 class="c-nowrap">免费服务</h4>
  186. <p>11类43项基本公共卫生服务,专家门诊预约,团队健康管理,便捷双向转诊,大型设备检查预约,康复训练指导,每年一次健康检查(血、尿常规检查、肝功、肾功、血脂、血糖、心电图检查),对失能、半失能、80岁以上老年人每年一次免费上门出诊,健康指导。</p>
  187. </div>
  188. </li>
  189. <li class="c-list-cover c-list-text">
  190. <div class="c-avatar-m bgc-f98d44" style="border-radius: 15px;">
  191. <i class="iconfont icon-yanghu1"></i>
  192. </div>
  193. <div class="c-list-info">
  194. <h4 class="c-nowrap">个性化服务(按物价规定标准收费)</h4>
  195. <p>基本医疗服务,针对性康复训练和康复治疗服务,健康检查项目:血、尿常规检查、肝功、肾功、血脂、血糖、心电图、胸片,糖化血红蛋白、眼底检查、尿微量白蛋白检测、糖尿病足筛查、踝肱指数、动态血压监测等,提供建立家庭病床、导尿、换药、上门测血糖、上门抽血检验等有偿上门服务。</p>
  196. </div>
  197. </li>
  198. </ul>
  199. <ul id="ul-disease" class="c-list sever-list" style="display: none;">
  200. <li class="c-list-cover c-list-text">
  201. <div class="c-avatar-m bgc-3fcba9" style="border-radius: 15px;">
  202. <i class="iconfont icon-yisheng"></i>
  203. </div>
  204. <div class="c-list-info">
  205. <h4 class="c-nowrap">医保优惠</h4>
  206. <p>慢性病长处方,一次可开取4-8周用药,社区门诊免除500元起付线,住院医疗费不设二次及以上起付标准(二次及以上住院可以免付50-500起付线)</p>
  207. </div>
  208. </li>
  209. <li class="c-list-cover c-list-text">
  210. <div class="c-avatar-m bgc-52a5f1" style="border-radius: 15px;">
  211. <i class="iconfont icon-zixun"></i>
  212. </div>
  213. <div class="c-list-info">
  214. <h4 class="c-nowrap">免费服务</h4>
  215. <p>11类43项基本公共卫生服务,专家门诊预约,“三师共管”慢病精细化管理,便捷双向转诊,大型设备检查预约,康复训练指导,每年一次健康检查,糖尿病患者4次空腹血糖检测,对失能、半失能、80岁以上老年人每年一次免费上门出诊,健康指导。</p>
  216. </div>
  217. </li>
  218. <li class="c-list-cover c-list-text">
  219. <div class="c-avatar-m bgc-f98d44" style="border-radius: 15px;">
  220. <i class="iconfont icon-yanghu1"></i>
  221. </div>
  222. <div class="c-list-info">
  223. <h4 class="c-nowrap">个性化服务(按物价规定标准收费)</h4>
  224. <p>基本医疗服务,针对性康复训练和康复治疗服务,健康检查项目:血、尿常规检查、肝功、肾功、血脂、血糖、心电图、胸片,糖化血红蛋白、眼底检查、尿微量白蛋白检测、糖尿病足筛查、踝肱指数、动态血压监测等,提供建立家庭病床、导尿、换药、上门测血糖、上门抽血检验等有偿上门服务。</p>
  225. </div>
  226. </li>
  227. </ul>
  228. <!-- 列表项 结束 -->
  229. </div>
  230. <div class="h61">
  231. <div class="plr15 pb15 bottom-btn-box c-border-t" id="btnSign">
  232. </div>
  233. </div>
  234. <div class="input-group width-100 mt10" id="xf-artd" style="display:none">
  235. <textarea id="textReason" class="form-textarea width-100" maxlength="200" placeholder="请输入解约原因" rows="5"></textarea>
  236. <input id="txtInfo" style="display: none; color: red;" value="请填写解约原因"/>
  237. </div>
  238. </div>
  239. <script type="text/javascript">
  240. var d = dialog({contentType:'load', skin:'bk-popup'});
  241. var d1 = dialog({contentType:'load', skin:'bk-popup', content:'提交中...'});
  242. var doctor = "";
  243. var isQr="";
  244. $(function() {
  245. var userAgent = window.localStorage.getItem(agentName);
  246. Request = GetRequest();
  247. var openid = Request["openid"];
  248. var code = Request["code"];
  249. isQr = Request["isQr"];
  250. if(!userAgent){
  251. if(!openid){
  252. sendPost("weixin/getOpenidByCode",{"code":code},'JSON','GET',
  253. function(res){
  254. queryFailed(res);
  255. },function(res){
  256. if(res.status==200){
  257. openid = res.openid;
  258. window.localStorage.setItem(pageName,"{\"pageurl\":\""+window.location.href+"\"}");
  259. window.location.href = "../../home/html/login.html?type=0&openid=" + openid;
  260. }else{
  261. queryFailed(res);
  262. }
  263. })
  264. }
  265. }
  266. closeWindow();
  267. queryInit();
  268. });
  269. function closeWindow(){
  270. var Request = new Object();
  271. Request = GetRequest();
  272. var code = Request["code"];
  273. //从后台那边获取签名等信息
  274. var params = {};
  275. params.pageUrl = window.location.href;
  276. $.ajax(server + "weixin/getSign", {
  277. data: params,
  278. dataType: "json",
  279. type: "post",
  280. success: function(res){
  281. if (res.status == 200) {
  282. var t = res.data.timestamp;
  283. var noncestr = res.data.noncestr;
  284. var signature = res.data.signature;
  285. wx.config({
  286. //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  287. appId: appId, // 必填,公众号的唯一标识
  288. timestamp: t, // 必填,生成签名的时间戳
  289. nonceStr: noncestr, // 必填,生成签名的随机串
  290. signature: signature,// 必填,签名,见附录1
  291. jsApiList: [
  292. 'closeWindow'
  293. ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  294. });
  295. }
  296. }
  297. });
  298. }
  299. function queryInit(){
  300. d.show();
  301. var data={};
  302. var Request = new Object();
  303. Request = GetRequest();
  304. doctor = Request["state"];
  305. data.doctor = doctor;
  306. sendPost('patient/family_contract/homepage', data, 'json', 'post', queryFailed, querySuccess);
  307. }
  308. function queryFailed(res) {
  309. d.close();
  310. if (res && res.msg) {
  311. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
  312. } else {
  313. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败'}).show();
  314. }
  315. }
  316. function querySuccess(res) {
  317. if (res.status == 200) {
  318. var name = res.data.name;
  319. var jobName = res.data.job;
  320. var hospitalName = res.data.hospital;
  321. var deptName = res.data.dept;
  322. var photo = getImgUrl(res.data.photo);
  323. var expertise = res.data.expertise;
  324. var introduce = res.data.intro;
  325. var sign = Number(res.data.sign);
  326. var group = Number(res.data.group);
  327. var url2 = "../../../images/d-default.png";
  328. if(photo != null && photo != ""){
  329. url2 = photo;
  330. }
  331. if(!jobName) jobName = "";
  332. if(!deptName) deptName = "";
  333. if(!expertise) expertise = "无";
  334. if(!introduce) introduce = "无";
  335. document.getElementById("photo").src = url2;
  336. document.getElementById("name").innerHTML = name;
  337. document.getElementById("jobName").innerHTML = jobName;
  338. document.getElementById("hospitalName").innerHTML = hospitalName;
  339. document.getElementById("deptName").innerHTML = deptName;
  340. document.getElementById("expertise").innerHTML = expertise;
  341. document.getElementById("introduce").innerHTML = introduce;
  342. if(group == 1){
  343. $("#ul-health").show();
  344. }else if(group == 2){
  345. $("#ul-disease").show();
  346. }else if(group == 3){
  347. $("#ul-sixfive").show();
  348. }else{
  349. $("#ul-common").show();
  350. }
  351. if(sign == 0){
  352. document.getElementById("btnSign").innerHTML ='<a onclick="cancelSign()" class="c-btn c-btn-E0A526 c-btn-full c-btn-radius c-f18">取消申请</a>';
  353. }
  354. else if(sign == 1){
  355. document.getElementById("btnSign").innerHTML ='<a onclick="overSign()" class="c-btn c-btn-E0A526 c-btn-full c-btn-radius c-f18">申请解约</a>';
  356. }
  357. else if(sign == -1){
  358. document.getElementById("btnSign").innerHTML ='<a onclick="startSign()" class="c-btn c-btn-4dcd70 c-btn-full c-btn-radius c-f18">申请签约</a>';
  359. $("#divAgree").hide();
  360. }
  361. else if(sign == 2){
  362. document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">您已申请了解约,流程审核中,请等待!!</span>';
  363. }
  364. else{
  365. document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">医生申请与您解约,流程审核中,请等待!!</span>';
  366. }
  367. d.close();
  368. }
  369. else{
  370. queryFailed(res);
  371. }
  372. }
  373. //申请签约
  374. function startSign(){
  375. if(isQr!=false){
  376. sendPost('patient/family_contract/checkOpenid', {}, 'json', 'post', queryFailed, openidSuccess2);
  377. }else{
  378. var doctorName = encodeURI(document.getElementById("name").innerHTML);
  379. var hospitalName = encodeURI(document.getElementById("hospitalName").innerHTML);
  380. window.location.href = "sign-agreement.html?doctor=" + doctor + "&doctorName=" + doctorName + "&hospitalName=" + hospitalName;
  381. }
  382. }
  383. function changeAgreement(){
  384. window.location.href = "sign-agreement1.html";
  385. }
  386. function cancelSign(){
  387. dialog({
  388. title: '提示',
  389. content: '您确定继续取消和' + document.getElementById("name").innerHTML + '医生的签约吗?',
  390. ok: function (){
  391. d1.showModal();
  392. var data = {};
  393. data.doctor = doctor;
  394. sendPost('patient/family_contract/unsign', data, 'json', 'post', submitFailed, submitSuccess);
  395. },
  396. cancel: function () {
  397. return;
  398. }
  399. }).showModal();
  400. }
  401. function overSign(){
  402. $("#txtInfo").hide();
  403. dialog({
  404. title: '申请解约',
  405. skin:"ui-dialog ax-popup pror",
  406. content:$("#xf-artd").get(0),
  407. ok: function (){
  408. var data = {};
  409. data.doctor = doctor;
  410. data.doctorName = document.getElementById("name").innerHTML;
  411. data.reason = $("#textReason").val();
  412. if(data.reason == "" || data.reason == null){
  413. $("#txtInfo").show();
  414. return false;
  415. }
  416. else{
  417. $("#txtInfo").hide();
  418. d1.showModal();
  419. sendPost('patient/family_contract/surrender', data, 'json', 'post', submitFailed, submitSuccess2);
  420. return;
  421. }
  422. },
  423. cancel: function () {
  424. return;
  425. }
  426. }).showModal();
  427. }
  428. function submitFailed(res) {
  429. d1.close();
  430. if (res && res.msg) {
  431. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
  432. } else {
  433. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'操作失败'}).show();
  434. }
  435. }
  436. function submitSuccess(res) {
  437. if (res.status == 200) {
  438. d1.close();
  439. window.location.href = "choose-region.html";
  440. } else{
  441. submitFailed(res);
  442. }
  443. }
  444. function submitSuccess2(res) {
  445. if (res.status == 200) {
  446. document.getElementById("btnSign").innerHTML = '<span class="c-f18" style="color: #E71F19;">您已申请了解约,流程审核中,请等待!!</span>';
  447. d1.close();
  448. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'解约申请成功'}).show();
  449. window.scrollTo(0,0);
  450. //window.location.href = "doctor-home-page.html?doctor=" + doctor;
  451. } else{
  452. submitFailed(res);
  453. }
  454. }
  455. //判断是否有三师信息
  456. function checkTeacter(){
  457. var data = {};
  458. sendPost('patient/teachers', data, 'json', 'post', queryFailedTeacter, querySuccessTeacter);
  459. }
  460. function querySuccessTeacter(res) {
  461. if (res.status == 200) {
  462. d.close();
  463. var list = res.data.list;
  464. if(list.length > 0){
  465. var doctorTemp = "";
  466. var doctorName = "";
  467. for(var i=0; i<list.length; i++){
  468. var data = list[i];
  469. if(Number(data.type) == 2){
  470. doctorTemp = data.code;
  471. doctorName = data.name;
  472. }
  473. }
  474. var doctorNameTemp = document.getElementById("name").innerHTML;
  475. if(doctorNameTemp!=doctorName){
  476. dialog({
  477. title:'提示',
  478. content:'您已存在三师签约,签约医生为' + doctorName + '医生,继续与' + doctorName + '医生签约家庭医生服务吗?',
  479. ok: function (){
  480. window.location.href = "doctor-home-page.html?doctor=" + doctorTemp;
  481. }
  482. }).showModal();
  483. }else{
  484. familyDoctor();
  485. }
  486. }else{
  487. familyDoctor();
  488. }
  489. } else if(res.status == 1 || res.status == 2){
  490. d.close();
  491. familyDoctor();
  492. }
  493. else{
  494. queryFailedTeacter(res);
  495. }
  496. }
  497. //成功
  498. function openidSuccess2(res) {
  499. if (res.status == 200) {
  500. if(res.data == null || res.data == ""){
  501. checkTeacter();
  502. }
  503. else{
  504. queryDoctor(res);
  505. }
  506. } else {
  507. queryFailed(res);
  508. }
  509. }
  510. //获取家庭签约的医生信息
  511. function queryDoctor(res){
  512. var data={};
  513. data.doctor = res.data;
  514. sendPost('patient/family_contract/homepage', data, 'json', 'post', queryFailed, querySuccess3);
  515. }
  516. function querySuccess3(res) {
  517. if (res.status == 200) {
  518. var doctorName = document.getElementById("name").innerHTML;
  519. if(res.data.name!=doctorName){
  520. dialog({
  521. title:'提示',
  522. content:'您已存在家庭签约,签约医生为' + res.data.name + '医生,只可以签约一个家庭医生',
  523. ok: function (){
  524. wx.closeWindow();
  525. }
  526. }).showModal();
  527. }else{
  528. familyDoctor();
  529. }
  530. }else{
  531. queryFailed(res);
  532. }
  533. }
  534. function familyDoctor(){
  535. var doctorName = encodeURI(document.getElementById("name").innerHTML);
  536. var hospitalName = encodeURI(document.getElementById("hospitalName").innerHTML);
  537. window.location.href = "sign-agreement.html?doctor=" + doctor + "&doctorName=" + doctorName + "&hospitalName=" + hospitalName;
  538. }
  539. function queryFailedTeacter(res) {
  540. d.close();
  541. if (res && res.msg) {
  542. dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
  543. } else {
  544. dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败'}).show();
  545. }
  546. }
  547. </script>
  548. </body>
  549. </html>