zhidingzixun.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="author" content="yihu.com" />
  6. <meta name="format-detection" content="telephone=no" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  8. <meta name="apple-mobile-web-app-capable" content="yes" />
  9. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  10. <title>指定咨询</title>
  11. <link rel="stylesheet" href="../css/cross.css" type="text/css" />
  12. <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
  13. <link rel="stylesheet" type="text/css" href="../css/yy-qygl.css">
  14. <link rel="stylesheet" type="text/css" href="../css/yy-style.css">
  15. <link rel="stylesheet" type="text/css" href="../../../common/css/doc-style.css" />
  16. <style>
  17. .new-msg {
  18. background: url('../../../images/new_icon.png') no-repeat;
  19. background-size: 35px 35px;
  20. -webkit-background-size: 35px 35px;
  21. -moz-background-size: 35px 35px;
  22. -o-background-size: 35px 35px;
  23. background-position: top right!important;
  24. }
  25. .icon-noset {
  26. display: inline-block;
  27. width: 320px; height: 184px;
  28. background: url(../../../images/shujuweikong_img.png) no-repeat;
  29. background-size: 320px 184px;
  30. margin-bottom: 10px;
  31. }
  32. .zd-fixed{
  33. position: fixed;
  34. top: 0px;
  35. left: 0px;
  36. width: 100%;
  37. z-index: 99999;
  38. background-color: #fff;
  39. border-bottom:solid 1px #ccc;
  40. }
  41. .mt58{
  42. padding-top: 58px!important;
  43. }
  44. .view-more{
  45. margin-bottom: 10px;
  46. font-size: 14px;
  47. color: #17B3EC;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <div class="sign-comonhd plr10 pt10 bgc-fff c-border-tb zd-fixed">
  53. <div class="sanp-flex curr">
  54. <p class="c-f16 no-read">待回复</p>
  55. </div>
  56. <div class="sanp-flex">
  57. <p class="c-f16 active-msg">进行中</p>
  58. </div>
  59. <div class="sanp-flex">
  60. <p class="c-f16">已完成</p>
  61. </div>
  62. </div>
  63. <div class="c-failstate c-t-center c-hide" id="wushuju" style="padding-top:140px;">
  64. <i class="icon-noset"></i>
  65. <p class="c-5b5b5b">暂无相关消息</p>
  66. </div>
  67. <div class="mt58 ax-naills">
  68. <ul class="c-list c-border-tb c-hide" id="ask_me_list">
  69. </ul>
  70. <div id="load_more_ask_me" class="view-more" style="display: none;">点击加载更多</div>
  71. </div>
  72. <div class="mt58 ax-naills c-hide">
  73. <ul class="c-list c-border-tb c-hide" id="my_respont_list">
  74. <!--进行中内容-->
  75. </ul>
  76. <div id="load_more_my_respont" class="view-more" style="display: none;">点击加载更多</div>
  77. </div>
  78. <div class="mt58 ax-naills c-hide">
  79. <ul class="c-list c-border-tb c-hide" id="over_list">
  80. <!--已完成内容-->
  81. </ul>
  82. <div id="load_more_over" class="view-more" style="display: none;">点击加载更多</div>
  83. </div>
  84. </body>
  85. <script type="text/html" id="consult_tmpl">
  86. {{each data as val i}}
  87. <li class="c-list-cover pb5" data-info="{{val | setInfo}}" data-consult="{{val.consult}}" style="position: relative;height:100px;">
  88. <div class="c-avatar-m mt10"><img class="c-images-cycle" src="{{val.photo,val.sex | setPatiPic}}"></div>
  89. <div class="c-list-info ptb5 pl10">
  90. <h4 class="c-nowrap c-f16">{{val.patientName}}
  91. <div class="c-909090 c-f12">{{val.create_time}}</div>
  92. </h4>
  93. <p class="c-content-warp mt15 c-nowrap">
  94. <span class="c-dest-content c-f14">{{val.description}}</span>
  95. </p>
  96. </div>
  97. </li>
  98. {{/each}}
  99. </script>
  100. <script type="text/html" id="over_tmpl">
  101. {{each list as val i}}
  102. <ul class="n-list mt10 c-border-tb" data-id="{{val.id}}">
  103. <li class="ptb10" data-consult="{{val.consult}}" data-patient="{{val.patient}}" onclick="tiaozhuan('{{val.consult}}','{{val.patient}}')">
  104. <div class="n-list-key">
  105. <div class="n-avatar-m">
  106. <img src="{{val.photo,val.sex | setPatiPic}}" />
  107. </div>
  108. </div>
  109. <div class="n-list-info pl10">
  110. <p class="c-f17">
  111. <span class="fr c-909090 c-f14">{{val.time}}</span>
  112. <span>{{val.name}}</span>
  113. <span class="pl10 c-909090 c-f15">{{val.sex | setSex}}</span>
  114. <span class="pl5 c-909090 c-f15">{{val.age | setAge}}岁</span>
  115. </p>
  116. <p class="c-f15 c-nowrap">
  117. <span class="c-909090">{{val.title}}</span>
  118. </p>
  119. </div>
  120. </li>
  121. <li style="border-top:none;" onclick="openWebview('zixunxiangqing.html')">
  122. {{if val.comment }} {{if val.comment.length > 0}}
  123. <div class="n-list-key">
  124. <div class="n-avatar-m">
  125. </div>
  126. </div>
  127. <div class="n-list-info pl10 pt5 pb10" style="border-top:1px solid #f2f2f2;">
  128. <div class="seval-hold">
  129. <div class="seval-tit">评价</div>
  130. <div class="seval-con">{{val.comment}}</div>
  131. </div>
  132. </div>
  133. {{/if}} {{/if}}
  134. </li>
  135. <li class="ptb10 n-list-cover c-t-center"></li>
  136. </ul>
  137. {{/each}}
  138. </script>
  139. <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
  140. <script type="text/javascript" src="../js/base.js"></script>
  141. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  142. <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
  143. <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
  144. <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
  145. <script src="../../js/templateHelp.js" type="text/javascript" charset="utf-8"></script>
  146. <script type="text/javascript">
  147. var docInfo,
  148. docCode,
  149. onePage=1,//当前页
  150. twoPage = 1,
  151. threePage = 1,
  152. pagesize=10,//每页显示10条
  153. pagesize2=5;//每页显示5条
  154. mui.plusReady(function() {
  155. docInfo = JSON.parse(plus.storage.getItem("docInfo"));
  156. docCode = docInfo.code;
  157. plus.nativeUI.showWaiting("", {
  158. back: "none"
  159. });
  160. $(".sign-comonhd div").eq(0).trigger("click");
  161. });
  162. template.helper("setInfo", function(o){
  163. return JSON.stringify(o);
  164. })
  165. function gotoDetail($this, isOver,stutas){
  166. var info = JSON.parse($this.attr('data-info'));//info.id 咨询id
  167. mui.openWindow('zixunxiangqing.html', 'zixunxiangqing', {
  168. extras: {
  169. sessionId: info.session_id,
  170. sessionName: info.patientName,
  171. otherCode: info.patient,
  172. otherName: info.patientName,
  173. otherSex: info.sex,
  174. otherPhoto: info.photo || "../../../images/p-female.png",
  175. consultInfo: info,
  176. sessionTime: checkDate(info.create_time),
  177. stutas:stutas,
  178. type: info.type
  179. }
  180. })
  181. }
  182. function checkDate (d) {
  183. var t = new Date(d);
  184. return (function () {
  185. return (t.getMonth() + 1) < 10 ? '0' + (t.getMonth() + 1) : (t.getMonth() + 1);
  186. })() + '' +
  187. (function () {
  188. return t.getDate() < 10 ? '0' + t.getDate() : t.getDate();
  189. })();
  190. }
  191. /*
  192. * 未回复
  193. */
  194. mui("#ask_me_list").on("tap", "li", function() {
  195. $(this).removeClass("new-msg");
  196. if($("#ask_me_list li[class='new-msg']").length==0){
  197. $(".no-read").html("待回复");
  198. }
  199. gotoDetail($(this),0,0);
  200. });
  201. /*
  202. * 已回复跳转
  203. */
  204. mui("#over_list").on("tap", "li", function() {
  205. $(this).removeClass("new-msg");
  206. gotoDetail($(this),1,2);
  207. });
  208. /*
  209. * 进行中跳转
  210. */
  211. mui("#my_respont_list").on("tap", "li", function() {
  212. $(this).removeClass("new-msg");
  213. if($("#my_respont_list li[class='new-msg']").length==0){
  214. $(".active-msg").html("进行中");
  215. }
  216. gotoDetail($(this),0,1);
  217. });
  218. $(function() {
  219. $(".sign-comonhd div").click(function() {
  220. $(".sign-comonhd div").removeClass("curr");
  221. $(this).addClass("curr");
  222. $("#wushuju").hide();
  223. $(".ax-naills").hide().eq($(this).index()).show();
  224. switch($(this).index()) {
  225. case 0:
  226. ask_me_click();
  227. break;
  228. case 1:
  229. my_respont_click();
  230. break;
  231. case 2:
  232. over_click();
  233. break;
  234. }
  235. });
  236. });
  237. var ask_me_json=[];
  238. var my_respont_json=[];
  239. var over_json=[];
  240. var loadMore0 = false;
  241. var loadMore1 = false;
  242. var loadMore10 = false;
  243. /*
  244. * '待回复'数据获取
  245. * status=0,
  246. * reply=0
  247. * 未回复
  248. */
  249. function ask_me_click() {
  250. if(ask_me_json.length==0||loadMore0){
  251. plus.nativeUI.showWaiting();
  252. sendGet("im_new/consult/getList",{
  253. doctor: docCode,
  254. status: 0,
  255. reply: 0,
  256. page: onePage,
  257. pagesize: pagesize,
  258. }, null, handleSucc1);
  259. }
  260. }
  261. /*
  262. * '进行中'数据获取
  263. * status=0,
  264. * reply = 1
  265. * 已回复
  266. */
  267. function my_respont_click() {
  268. if(my_respont_json.length==0||loadMore1){
  269. plus.nativeUI.showWaiting();
  270. sendGet("im_new/consult/getList", {
  271. doctor: docCode,
  272. status: 0,
  273. reply: 1,
  274. page: twoPage,
  275. pagesize: pagesize,
  276. }, null, handleSucc3);
  277. }
  278. }
  279. /*
  280. * '已完成'数据获取
  281. * status = 10 已结束的咨询
  282. */
  283. function over_click() {
  284. if(over_json.length==0||loadMore10){
  285. plus.nativeUI.showWaiting();
  286. sendGet("im_new/consult/getList", {
  287. doctor: docCode,
  288. status: 10,
  289. reply: 1,
  290. page: threePage,
  291. pagesize: pagesize,
  292. }, null, handleSucc4);
  293. }
  294. }
  295. /*
  296. * 未回复处理
  297. */
  298. function handleSucc1(res) {
  299. //第一次请求
  300. if(ask_me_json.length==0){
  301. if(res.status != 200) {
  302. $("#load_more_ask_me").hide();
  303. $("#ask_me_list").addClass("c-hide");
  304. $("#wushuju").hide();
  305. plus.nativeUI.closeWaiting();
  306. mui.toast("数据加载失败");
  307. return
  308. }
  309. if(res.data.length == 0) {
  310. $("#load_more_ask_me").hide();
  311. $("#ask_me_list").addClass("c-hide");
  312. $("#wushuju").find("p").html("暂无需处理咨询");
  313. $("#wushuju").show();
  314. plus.nativeUI.closeWaiting();
  315. return
  316. }
  317. }else{
  318. if(res.status != 200) {
  319. $("#load_more_ask_me").hide();
  320. plus.nativeUI.closeWaiting();
  321. mui.toast("数据加载失败");
  322. return
  323. }
  324. if(res.data.length == 0) {
  325. $("#load_more_ask_me").text('没有更多了');
  326. $("#load_more_ask_me").off('click')
  327. plus.nativeUI.closeWaiting();
  328. return
  329. }
  330. if(res.data.length < pagesize){
  331. $("#load_more_ask_me").text('没有更多了');
  332. $("#load_more_ask_me").off('click')
  333. }
  334. }
  335. if(res.status == 200) {
  336. ask_me_json = ask_me_json.concat(res.data);
  337. dealTmpl("consult_tmpl", res, "#ask_me_list", 1);
  338. if(res.data.length >= pagesize){
  339. $("#load_more_ask_me").show()
  340. }
  341. $("#ask_me_list").show();
  342. plus.nativeUI.closeWaiting();
  343. }
  344. };
  345. /*
  346. * 进行中
  347. */
  348. function handleSucc3(res) {
  349. //第一次请求
  350. if(my_respont_json.length==0){
  351. if(res.status != 200) {
  352. $("#load_more_my_respont").hide();
  353. $("#my_respont_list").addClass("c-hide");
  354. $("#wushuju").hide();
  355. plus.nativeUI.closeWaiting();
  356. mui.toast("数据加载失败");
  357. return
  358. }
  359. if(res.data.length == 0) {
  360. $("#load_more_my_respont").hide();
  361. $("#my_respont_list").addClass("c-hide");
  362. $("#wushuju").find("p").html("暂无需处理咨询");
  363. $("#wushuju").show();
  364. plus.nativeUI.closeWaiting();
  365. return
  366. }
  367. }else{
  368. if(res.status != 200) {
  369. $("#load_more_my_respont").hide();
  370. plus.nativeUI.closeWaiting();
  371. mui.toast("数据加载失败");
  372. return
  373. }
  374. if(res.data.length == 0) {
  375. $("#load_more_my_respont").text('没有更多了');
  376. $("#load_more_my_respont").off('click')
  377. plus.nativeUI.closeWaiting();
  378. return
  379. }
  380. if(res.data.length < pagesize){
  381. $("#load_more_my_respont").text('没有更多了');
  382. $("#load_more_my_respont").off('click')
  383. }
  384. }
  385. if(res.status == 200) {
  386. my_respont_json = my_respont_json.concat(res.data);
  387. dealTmpl("consult_tmpl", res, "#my_respont_list", 2);
  388. if(res.data.length >= pagesize){
  389. $("#load_more_my_respont").show()
  390. }
  391. $('#my_respont_list').show();
  392. plus.nativeUI.closeWaiting();
  393. }
  394. };
  395. /*
  396. * 已完成的
  397. */
  398. function handleSucc4(res) {
  399. //第一次请求
  400. if(over_json.length==0){
  401. if(res.status != 200) {
  402. $("#load_more_over").hide();
  403. $("#over_list").addClass("c-hide");
  404. $("#wushuju").hide();
  405. plus.nativeUI.closeWaiting();
  406. mui.toast("数据加载失败");
  407. return
  408. }
  409. if(res.data.length == 0) {
  410. $("#load_more_over").hide();
  411. $("#over_list").addClass("c-hide")
  412. $("#wushuju").find("p").html("暂无已完成咨询");
  413. $("#wushuju").show();
  414. plus.nativeUI.closeWaiting();
  415. return
  416. }
  417. }else{
  418. if(res.status != 200) {
  419. $("#load_more_over").hide();
  420. plus.nativeUI.closeWaiting();
  421. mui.toast("数据加载失败");
  422. return
  423. }
  424. if(res.data.length == 0) {
  425. $("#load_more_over").text('没有更多了');
  426. $("#load_more_over").off('click')
  427. plus.nativeUI.closeWaiting();
  428. return
  429. }
  430. if(res.data.length < pagesize){
  431. $("#load_more_over").text('没有更多了');
  432. $("#load_more_over").off('click')
  433. }
  434. }
  435. if(res.status == 200) {
  436. over_json = over_json.concat(res.data);
  437. dealTmpl("consult_tmpl", res, "#over_list", 3);
  438. if(res.data.length >= pagesize){
  439. $("#load_more_over").show()
  440. }
  441. $('#over_list').show();
  442. plus.nativeUI.closeWaiting();
  443. }
  444. };
  445. /*
  446. * 处理模板 逻辑,
  447. */
  448. function dealTmpl(tmplId, tmplData, domId, tabId) {
  449. var cont = template(tmplId, tmplData);
  450. switch(tabId){
  451. case 1:
  452. if(onePage == 1){
  453. $(domId).empty().append(cont);
  454. }else{
  455. $(domId).append(cont);
  456. }
  457. break;
  458. case 2:
  459. if(twoPage == 1){
  460. $(domId).empty().append(cont);
  461. }else{
  462. $(domId).append(cont);
  463. }
  464. break;
  465. case 3:
  466. if(threePage == 1){
  467. $(domId).empty().append(cont);
  468. }else{
  469. $(domId).append(cont);
  470. }
  471. break;
  472. }
  473. }
  474. /*
  475. * 加载更多 咨询我的
  476. */
  477. $('.view-more').on('click',function () {
  478. var that = $(this),
  479. thatChildCN = that.attr('id');
  480. switch (thatChildCN) {
  481. case 'load_more_ask_me':
  482. onePage++;
  483. loadMore0=true;
  484. ask_me_click();
  485. loadMore0=false;
  486. break;
  487. case 'load_more_my_respont':
  488. twoPage++;
  489. loadMore1=true;
  490. my_respont_click();
  491. loadMore1=false;
  492. break;
  493. case 'load_more_over':
  494. threePage++;
  495. loadMore10=true;
  496. over_click();
  497. loadMore10=false;
  498. break;
  499. }
  500. })
  501. /*
  502. * 检查建议
  503. */
  504. function clickCheck(dom) {
  505. var patientCode = dom.getAttribute("data-pati-code");
  506. var consultCode = dom.getAttribute("data-consult");
  507. var rhtml = '';
  508. rhtml += '<div class="referral-pop">';
  509. rhtml += ' <div class="referral-pop-hold">';
  510. /*rhtml += ' <a onclick="zicha(this)" data-consult="' + consultCode + '" data-pati-code="' + patientCode + '">居民自查</a>';*/
  511. rhtml += ' <a onclick="jiancha(this)" data-consult="' + consultCode + '" data-pati-code="' + patientCode + '">检查检验</a>';
  512. rhtml += " <a href=\"javascript:;\" onclick=\"$('.referral-pop').remove();\">取消</a>";
  513. rhtml += ' </div>';
  514. rhtml += ' <div class="referral-pop-mb"></div>';
  515. rhtml += '</div>';
  516. $('body').append(rhtml);
  517. }
  518. /*
  519. * 居民自查
  520. */
  521. var zicha = function(dom) {
  522. var patientCode = dom.getAttribute("data-pati-code");
  523. var consultCode = dom.getAttribute("data-consult");
  524. mui.openWindow('zdzx-huanzhezicha.html', 'zdzx-huanzhezicha', {
  525. extras: {
  526. patient: patientCode,
  527. consult: consultCode
  528. }
  529. });
  530. $('.referral-pop').remove();
  531. }
  532. /*
  533. * 检查检验
  534. */
  535. var jiancha = function(dom) {
  536. var patientCode = dom.getAttribute("data-pati-code");
  537. var consultCode = dom.getAttribute("data-consult");
  538. mui.openWindow('zdzx-jianchajianyan.html', 'zdzx-jianchajianyan', {
  539. extras: {
  540. patient: patientCode,
  541. consult: consultCode
  542. }
  543. });
  544. $('.referral-pop').remove();
  545. }
  546. /*
  547. * 病例夹
  548. */
  549. function clickBlj(dom) {
  550. var patientCode = dom.getAttribute("data-pati-code");
  551. mui.openWindow('../../huanzhe/html/xinzengsuishouji.html', 'xinzengsuishouji', {
  552. extras: {
  553. pCode: patientCode
  554. }
  555. });
  556. }
  557. /*
  558. * 转诊
  559. */
  560. function clickAppo(dom) {
  561. var patientCode = dom.getAttribute("data-pati-code");
  562. // alert(patientCode);
  563. mui.openWindow('../../zxyy/html/xuanzeyiyuan.html', 'xuanzeyiyuan', {
  564. extras: {
  565. pCode: patientCode
  566. }
  567. });
  568. }
  569. function clickYyzd(dom) {
  570. var patientCode = dom.getAttribute("data-pati-code");
  571. mui.openWindow('../../../blgl/html/yongyaozhidao.html', 'binglijiaxiangqing', {
  572. extras: {
  573. pCode: patientCode
  574. }
  575. });
  576. }
  577. function clickyygl(dom) {
  578. mui.openWindow('yongyaozhidao.html', 'yongyaozhidao');
  579. }
  580. //刷新
  581. window.addEventListener("refresh", function() {
  582. // plus.webview.currentWebview().reload();
  583. ask_me_json=[];
  584. my_respont_json=[];
  585. over_json=[];
  586. loadMore0 = false;
  587. loadMore1 = false;
  588. loadMore10 = false;
  589. onePage=1;//当前页
  590. twoPage = 1;
  591. threePage = 1;
  592. $(".sign-comonhd div.curr").trigger("click");
  593. });
  594. </script>
  595. </html>