xufangzixun.html 16 KB

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