123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- var d = dialog({contentType:'load', skin:'bk-popup'});
- var pagetype = 1;
- $(function(){
- switchTab(".pt-tab li",".pt-tab-list",".pt-tab-a");
- checkUserAgent();
- })
- function queryInit(){
- doctorList();
- }
- //选择项切换
- function switchTab(tab,con,a) {
- $(tab).click(function(){
- $(tab).removeClass("hit");
- $(this).addClass("hit");
- $(con).hide().eq($(this).index()).show();
- $(a).hide().eq($(this).index()).show();
- })
- }
- //跳转医生咨询
- function doctorConsult(){
- checkSign(1);
- }
- //公共咨询和病友圈跳转
- function jumpPage(type1){
- window.location.href = "public-patients-consult.html?type=" + type1;
- }
- //咨询记录
- function doctorList(){
- d.show();
- var data = {};
- var uid = "";
- var userAgent = window.localStorage.getItem(agentName);
- if(userAgent){
- var jsonstr = $.parseJSON(userAgent);
- uid = jsonstr.uid;
- }
- data.patient = uid;
- data.id = 0;
- data.pagesize = 10;
- sendPost('user/guaihao/appoDoctor', data, 'json', 'post', queryFailed, queryRecordSuccess1);
- }
- //咨询记录
- function consultRecord(){
- var data = {};
- data.id = 0;
- data.pagesize = 10;
- sendPost('patient/consult/records', data, 'json', 'post', queryFailed, queryRecordSuccess);
- }
- function queryFailed(res) {
- d.close();
- if (res && res.msg) {
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:res.msg}).show();
- } else {
- dialog({contentType:'tipsbox', skin:'bk-popup' , content:'加载失败'}).show();
- }
- }
- function queryRecordSuccess1(res) {
- if (res.status == 200) {
- if (res.list.length > 0) {
- var list = res.list;
- var $list = document.querySelector("#online_doc_list");
- for (var i = 0; i < list.length; i++) {
- var $li = document.createElement("li");
- var doctorCode = list[i].doctorCode;
- $li.setAttribute('data-code', doctorCode);
- var content = '<div class="pic"><img style="border-radius: 100px;" src="../../../images/d-default.png"></div>';
- content += '<p class="c-333 c-f15 pt5">' + list[i].doctorName + '</p>';
- $li.innerHTML = content;
- $list.appendChild($li);
- }
- } else {
- document.querySelector("#view_more_1").removeAttribute("style");
- }
- consultRecord();
- } else {
- queryFailed(res);
- }
- }
- function queryRecordSuccess(res) {
- if (res.status == 200) {
- if (res.list.length > 0) {
- var list = res.list;
- var $list = document.querySelector("#divRecoder");
- for (var i = 0; i < list.length; i++) {
- var $li = document.createElement("div");
- var consultCode = list[i].code;
- var symptoms = list[i].symptoms;
- var type = list[i].type;
- var czrq = list[i].czrq;
-
- var typeName = "";
- switch (type) {
- case 1:
- typeName = "三师咨询";
- break;
- case 2:
- typeName = "家庭咨询";
- break;
- case 3:
- typeName = "图文咨询";
- break;
- case 4:
- typeName = "公共咨询";
- break;
- case 5:
- typeName = "病友圈";
- break;
- default:
- break;
- }
-
- $li.setAttribute('data-type', type);
- $li.setAttribute('data-code', consultCode);
- $li.className = "n-list c-border-b";
- var content = '<div class="n-list-li n-list-link ptb12">';
- content += '<div class="n-list-info">';
- content += '<h4 class="c-333 c-f17">'+ typeName + '</h4>';
- content += '<p class="c-nowrap c-909090 c-f15" style="word-break: break-word;">症  状:' + symptoms + '</p>';
- content += '<p class="c-909090 c-f15">咨询时间:' + czrq + '</p>';
- content += ' </div>';
- content += ' </div>';
- $li.innerHTML = content;
- $list.appendChild($li);
- }
- $(".n-list").click(function() {
- var code = this.getAttribute("data-code");
- var type = Number(this.getAttribute("data-type"));
- switch (type) {
- case 1:
- window.location.href = "consulting-doctor.html?consult=" + code;
- break;
- case 2:
- window.location.href = "consulting-doctor.html?consult=" + code;
- break;
- case 3:
- break;
- case 4:
- window.location.href = "public-consult-detail.html?code=" + code;
- break;
- case 5:
- window.location.href = "patients-consult-detail.html?code=" + code;
- break;
- default:
- break;
- }
- });
- } else {
- document.querySelector("#view_more").removeAttribute("style");
- }
- d.close();
- } else {
- queryFailed(res);
- }
- }
- //查询更多约过的医生
- function yueguoMore(){
- window.location.href = "yuyueguo-record-more.html";
- }
- //查询更多咨询记录
- function recordMore(){
- window.location.href = "consult-record-more.html";
- }
- function notOnline(){
- dialog({
- title:'提示',
- skin:"ui-dialog ax-popup pror",
- content:"该功能暂未上线",
- ok: function (){}
- }).showModal();
- }
|