123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="author" content="yihu.com" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black" />
- <title>续方咨询</title>
- <link rel="stylesheet" href="../css/cross.css" type="text/css" />
- <link rel="stylesheet" href="../../../common/cross/css/cross.ui.css" type="text/css" />
- <link rel="stylesheet" type="text/css" href="../css/yy-qygl.css">
- <link rel="stylesheet" type="text/css" href="../css/yy-style.css">
- <link rel="stylesheet" type="text/css" href="../../../common/css/doc-style.css" />
- <style>
- .new-msg {
- background: url('../../../images/new_icon.png') no-repeat;
- background-size: 35px 35px;
- -webkit-background-size: 35px 35px;
- -moz-background-size: 35px 35px;
- -o-background-size: 35px 35px;
- background-position: top right!important;
- }
-
- .icon-noset {
- display: inline-block;
- width: 320px; height: 184px;
- background: url(../../../images/shujuweikong_img.png) no-repeat;
- background-size: 320px 184px;
- margin-bottom: 10px;
- }
- .zd-fixed{
- position: fixed;
- top: 0px;
- left: 0px;
- width: 100%;
- z-index: 99999;
- background-color: #fff;
- border-bottom:solid 1px #ccc;
- }
- .mt48{
- padding-top: 48px!important;
- }
- .view-more{
- margin-bottom: 10px;
- font-size: 14px;
- color: #323232;
- }
-
- .c-list{background: none;margin: 10px;width: calc(100% - 20px);}
- .c-list > .c-list-cover{
- position: relative;
- height: 100px;
- margin-bottom: 10px;
- border-radius: 5px;
- border: 1px solid #dcdcdc;
- background: #fff;
- }
- .c-list > li:first-child{border: 1px solid #dcdcdc;}
- .c-avatar-m {
- width: 50px;
- height: 50px;
-
- }
- .c-list .c-avatar-m{
- margin: 18px 10px 0 10px;
- overflow: hidden;
- display: -webkit-box;
- -webkit-box-pack: center;
- -webkit-box-align: center;
- }
- .c-f16,.c-f12{
- display: inline-block;
- }
- .c-f12{
- float: right;
- position: relative;
- top: 10px;
- font-size: 14px;
- color: #666666;
-
- }
- .c-list .c-list-info > h4 {
- font-size: 16px;
- position: relative;
- top: 10px;
-
- }
- .mt15{
- font-size: 14px;
- position: relative;
- bottom: 10px;
- }
- </style>
- </head>
- <body>
- <div class="sign-comonhd plr10 pt10 bgc-fff c-border-tb zd-fixed">
- <div class="sanp-flex curr">
- <p class="c-f16 no-read">待回复</p>
- </div>
- <div class="sanp-flex">
- <p class="c-f16 active-msg">进行中</p>
- </div>
- <div class="sanp-flex">
- <p class="c-f16">已完成</p>
- </div>
- </div>
- <div class="c-failstate c-t-center c-hide" id="wushuju" style="padding-top:140px;">
- <i class="icon-noset"></i>
- <p class="c-5b5b5b">暂无相关消息</p>
- </div>
- <div class="mt48 ax-naills">
- <ul class="c-list c-hide" id="ask_me_list">
-
- </ul>
- <div id="load_more_ask_me" class="view-more" style="display: none;">点击加载更多</div>
- </div>
-
- <div class="mt48 ax-naills c-hide">
- <ul class="c-list c-hide" id="my_respont_list">
- <!--进行中内容-->
- </ul>
- <div id="load_more_my_respont" class="view-more" style="display: none;">点击加载更多</div>
- </div>
- <div class="mt48 ax-naills c-hide">
- <ul class="c-list c-hide" id="over_list">
- <!--已完成内容-->
- </ul>
- <div id="load_more_over" class="view-more" style="display: none;">点击加载更多</div>
- </div>
- </body>
- <script type="text/html" id="consult_tmpl">
- {{each data as val i}}
- <li class="c-list-cover pb5" data-info="{{val | setInfo}}" data-consult="{{val.consult}}" style="position: relative;height:80px;">
- <div class="c-avatar-m mt10"><img class="c-images-cycle" src="{{val.photo,val.sex | setPatiPic}}"></div>
- <div class="c-list-info ptb5 pl10">
- <h4 class="c-nowrap c-f16">{{val.patientName}}
- </h4>
- <div class="c-909090 c-f12">{{val.create_time}}</div>
- <p class="c-content-warp mt15 c-nowrap">
- <span class="c-dest-content c-f14">{{val.description.title}}</span>
- </p>
- </div>
- </li>
- {{/each}}
- </script>
- <script type="text/html" id="over_tmpl">
- {{each list as val i}}
- <ul class="n-list mt10 c-border-tb" data-id="{{val.id}}">
- <li class="ptb10" data-consult="{{val.consult}}" data-patient="{{val.patient}}" onclick="tiaozhuan('{{val.consult}}','{{val.patient}}')">
- <div class="n-list-key">
- <div class="n-avatar-m">
- <img src="{{val.photo,val.sex | setPatiPic}}" />
- </div>
- </div>
- <div class="n-list-info pl10">
- <p class="c-f17">
- <span class="fr c-909090 c-f14">{{val.time}}</span>
- <span>{{val.name}}</span>
- <span class="pl10 c-909090 c-f15">{{val.sex | setSex}}</span>
- <span class="pl5 c-909090 c-f15">{{val.age | setAge}}岁</span>
- </p>
- <p class="c-f15 c-nowrap">
- <span class="c-909090">{{val.title}}</span>
- </p>
- </div>
- </li>
- <li style="border-top:none;" onclick="openWebview('zixunxiangqing.html')">
- {{if val.comment }} {{if val.comment.length > 0}}
- <div class="n-list-key">
- <div class="n-avatar-m">
- </div>
- </div>
- <div class="n-list-info pl10 pt5 pb10" style="border-top:1px solid #f2f2f2;">
- <div class="seval-hold">
- <div class="seval-tit">评价</div>
- <div class="seval-con">{{val.comment}}</div>
- </div>
- </div>
- {{/if}} {{/if}}
- </li>
- <li class="ptb10 n-list-cover c-t-center"></li>
- </ul>
- {{/each}}
- </script>
- <script type="text/javascript" src="../../../js/jquery/2.1.3/jquery.js"></script>
- <script type="text/javascript" src="../js/base.js"></script>
- <script type="text/javascript" src="../../../js/mui.min.js"></script>
- <script src="../../../js/common_http.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/template.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/templateHelp.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- var docInfo,
- docCode,
- onePage=1,//当前页
- twoPage = 1,
- threePage = 1,
- pagesize=10,//每页显示10条
- pagesize2=5;//每页显示5条
-
- mui.plusReady(function() {
- docInfo = JSON.parse(plus.storage.getItem("docInfo"));
- docCode = docInfo.code;
- plus.nativeUI.showWaiting("", {
- back: "none"
- });
- $(".sign-comonhd div").eq(0).trigger("click");
- });
-
- template.helper("setInfo", function(o){
- return JSON.stringify(o);
- })
-
- function gotoDetail($this, isOver,stutas){
- var info = JSON.parse($this.attr('data-info'));//info.id 咨询id
- mui.openWindow('xufangzixunxiangqing.html', 'xufangzixunxiangqing', {
- extras: {
- sessionId: info.session_id,
- sessionName: info.patientName,
- patiCode: info.patient,
- consultInfo: info,
- sessionTime: checkDate(info.create_time),
- stutas:stutas,
- type: 8
- }
- })
- }
-
- function checkDate (d) {
- var t = new Date(d);
- return (function () {
- return (t.getMonth() + 1) < 10 ? '0' + (t.getMonth() + 1) : (t.getMonth() + 1);
- })() + '' +
- (function () {
- return t.getDate() < 10 ? '0' + t.getDate() : t.getDate();
- })();
- }
- /*
- * 未回复
- */
- mui("#ask_me_list").on("tap", "li", function() {
- $(this).removeClass("new-msg");
- if($("#ask_me_list li[class='new-msg']").length==0){
- $(".no-read").html("待回复");
- }
- gotoDetail($(this),0,0);
- });
- /*
- * 已回复跳转
- */
- mui("#over_list").on("tap", "li", function() {
- $(this).removeClass("new-msg");
- gotoDetail($(this),1,2);
- });
- /*
- * 进行中跳转
- */
- mui("#my_respont_list").on("tap", "li", function() {
- $(this).removeClass("new-msg");
- if($("#my_respont_list li[class='new-msg']").length==0){
- $(".active-msg").html("进行中");
- }
- gotoDetail($(this),0,1);
- });
- $(function() {
- $(".sign-comonhd div").click(function() {
- $(".sign-comonhd div").removeClass("curr");
- $(this).addClass("curr");
- $("#wushuju").hide();
- $(".ax-naills").hide().eq($(this).index()).show();
- switch($(this).index()) {
- case 0:
- ask_me_click();
- break;
- case 1:
- my_respont_click();
- break;
- case 2:
- over_click();
- break;
- }
- });
- });
- var ask_me_json=[];
- var my_respont_json=[];
- var over_json=[];
- var loadMore0 = false;
- var loadMore1 = false;
- var loadMore10 = false;
-
- /*
- * '待回复'数据获取
- * status=0,
- * reply=0
- * 未回复
- */
- function ask_me_click() {
- if(ask_me_json.length==0||loadMore0){
- plus.nativeUI.showWaiting();
- sendGet("im_new/consult/getList",{
- doctor: docCode,
- status: 0,
- reply: 0,
- page: onePage,
- pagesize: pagesize,
- type: 8
- }, null, handleSucc1);
- }
- }
- /*
- * '进行中'数据获取
- * status=0,
- * reply = 1
- * 已回复
- */
- function my_respont_click() {
- if(my_respont_json.length==0||loadMore1){
- plus.nativeUI.showWaiting();
- sendGet("im_new/consult/getList", {
- doctor: docCode,
- status: 0,
- reply: 1,
- page: twoPage,
- pagesize: pagesize,
- type: 8
- }, null, handleSucc3);
- }
- }
- /*
- * '已完成'数据获取
- * status = 10 已结束的咨询
- */
- function over_click() {
- if(over_json.length==0||loadMore10){
- plus.nativeUI.showWaiting();
- sendGet("im_new/consult/getList", {
- doctor: docCode,
- status: 10,
- reply: 1,
- page: threePage,
- pagesize: pagesize,
- type: 8
- }, null, handleSucc4);
- }
- }
- /*
- * 未回复处理
- */
- function handleSucc1(res) {
- //第一次请求
- if(ask_me_json.length==0){
- if(res.status != 200) {
- $("#load_more_ask_me").hide();
- $("#ask_me_list").addClass("c-hide");
- $("#wushuju").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- $("#load_more_ask_me").hide();
- $("#ask_me_list").addClass("c-hide");
- $("#wushuju").find("p").html("暂无需处理咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
- }else{
- if(res.status != 200) {
- $("#load_more_ask_me").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- $("#load_more_ask_me").text('没有更多了');
- $("#load_more_ask_me").off('click')
- plus.nativeUI.closeWaiting();
- return
- }
- if(res.data.length <= pagesize){
- $("#load_more_ask_me").text('没有更多了');
- $("#load_more_ask_me").off('click')
- }
- }
-
- if(res.status == 200) {
- var Arr = [] ,d;
- for (var i in res.data){
- d = res.data[i];
- if (d.type==8) {
- Arr.push(d);
- d.description = JSON.parse(d.description);
- }else{
- $("#load_more_ask_me").hide();
- $("#ask_me_list").addClass("c-hide");
- $("#wushuju").find("p").html("暂无需处理咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
-
- }
- ask_me_json = Arr;
- dealTmpl("consult_tmpl",{data:Arr},"#ask_me_list");
- if(res.data.length >= pagesize){
- $("#load_more_ask_me").show()
- }
- $("#ask_me_list").show();
- plus.nativeUI.closeWaiting();
- }
- };
- /*
- * 进行中
- */
- function handleSucc3(res) {
- //第一次请求
- if(my_respont_json.length==0){
- if(res.status != 200) {
- $("#load_more_my_respont").hide();
- $("#my_respont_list").addClass("c-hide");
- $("#wushuju").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- $("#load_more_my_respont").hide();
- $("#my_respont_list").addClass("c-hide");
- $("#wushuju").find("p").html("暂无需处理咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
- }else{
- if(res.status != 200) {
- $("#load_more_my_respont").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- plus.nativeUI.closeWaiting();
- $("#load_more_my_respont").text('没有更多了');
- $("#load_more_my_respont").off('click')
- return
- }
- if(res.data.length <= pagesize){
- $("#load_more_my_respont").text('没有更多了');
- $("#load_more_my_respont").off('click')
- }
- }
-
- if(res.status == 200) {
- var Arr = [] ,d;
- for (var i in res.data){
- d = res.data[i];
- if (d.type==8) {
- Arr.push(d);
- d.description = JSON.parse(d.description);
- }else{
- $("#load_more_my_respont").hide();
- $("#my_respont_list").addClass("c-hide");
- $("#wushuju").find("p").html("暂无需处理咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
-
- }
- my_respont_json = Arr;
- dealTmpl("consult_tmpl",{data:Arr},"#my_respont_list");
- if(res.data.length >= pagesize){
- $("#load_more_my_respont").show()
- }
- $('#my_respont_list').show();
- plus.nativeUI.closeWaiting();
- }
- };
- /*
- * 已完成的
- */
- function handleSucc4(res) {
- //第一次请求
- if(over_json.length==0){
- if(res.status != 200) {
- $("#load_more_over").hide();
- $("#over_list").addClass("c-hide");
- $("#wushuju").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- $("#load_more_over").hide();
- $("#over_list").addClass("c-hide")
- $("#wushuju").find("p").html("暂无已完成咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
- }else{
- if(res.status != 200) {
- $("#load_more_over").hide();
- plus.nativeUI.closeWaiting();
- mui.toast("数据加载失败");
- return
- }
- if(res.data.length == 0) {
- $("#load_more_over").text('没有更多了');
- $("#load_more_over").off('click')
- plus.nativeUI.closeWaiting();
- return
- }
- if(res.data.length <= pagesize){
- $("#load_more_over").text('没有更多了');
- $("#load_more_over").off('click')
- }
- }
-
- if(res.status == 200) {
-
- var Arr = [] ,d;
- for (var i in res.data){
- d = res.data[i];
- if (d.type==8) {
- Arr.push(d);
- d.description = JSON.parse(d.description);
- }else{
- $("#load_more_my_respont").hide();
- $("#over_list").addClass("c-hide");
- $("#wushuju").find("p").html("暂无需处理咨询");
- $("#wushuju").show();
- plus.nativeUI.closeWaiting();
- return
- }
-
- }
- over_json = Arr;
- dealTmpl("consult_tmpl", {data:Arr}, "#over_list");
- if(res.data.length >= pagesize){
- $("#load_more_over").show()
- }
- $('#over_list').show();
- plus.nativeUI.closeWaiting();
- }
- };
- /*
- * 处理模板 逻辑,
- */
- function dealTmpl(tmplId, tmplData, domId) {
- var cont = template(tmplId, tmplData);
- $(domId).append(cont);
- }
- /*
- * 加载更多 咨询我的
- */
- $('.view-more').on('click',function () {
- var that = $(this),
- thatChildCN = that.attr('id');
- switch (thatChildCN) {
- case 'load_more_ask_me':
- onePage++;
- loadMore0=true;
- ask_me_click();
- loadMore0=false;
- break;
- case 'load_more_my_respont':
- twoPage++;
- loadMore1=true;
- my_respont_click();
- loadMore1=false;
- break;
- case 'load_more_over':
- threePage++;
- loadMore10=true;
- over_click();
- loadMore10=false;
- break;
- }
- })
- //刷新
- window.addEventListener("refreshPage", function() {
- plus.webview.currentWebview().reload();
- });
- </script>
- </html>
|