123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- var d = dialog({
- contentType: 'load',
- skin: 'bk-popup'
- });
- var userAgent = localStorage.getItem(agentName);
- if(userAgent){
- userAgent = JSON.parse(userAgent);
- }
- var request = GetRequest(),
- code = request.id,
- renew = request.renew;
- var doctorName = "";
- $(function() {
- getDocInfo();
- });
- function getDocInfo(){
- d.show();
- var url = "family_contract/homepage/homepage",
- params = {doctor: code};
- // url2 = "patient/family_contract/getPatientSign",
- // params2 = {homePageDoctorCode: code, invitePatientCode: userAgent.uid};
- sendPost(url, params, 'json', 'post', queryFailed, querySuccess);
- sendPost("patient/consult/evaluate/doctor/label", params, 'json', 'get', queryFailed, success2);
- // getReqPromises();
- }
-
- function success2(res) {
- var html='';
- if(res.list.length > 0){
- $.each(res.list, function(i,v) {
- html += '<li class="one">'+v.content+'</li>';
- });
- }else{
- html = '<span>暂无标签</span>';
- }
- $('#tag_group').append(html);
- d.close();
- }
- 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 querySuccess(res) {
- if(res.status == 200){
- d.close();
- var data = res.data;
- doctorName = res.data.name;
- $(".doc-photo").attr("src", getImgUrl(data.photo));
- $("#docName").text(data.name);
- $("#docJob").text(data.jobName);
- $("#docHospital").text(data.hospital);
- $("#intro").text(data.intro);
- $("#expertise").text(data.expertise);
- if(data.evaluateScore == 0){
- $("#docScore").text('暂无评分');
- }else{
- $("#docScore").text(data.evaluateScore);
- }
-
- //判断签约状态
- var sign = res.data.sign;
- if(sign == 0) { // 待签约
- $('#btnSign').show();
- }
- d.close();
- } else {
- queryFailed(res);
- }
- }
- function cancelSign() {
- var url = 'patient/family_contract/unsign',
- msg = '您确定取消和' + doctorName + '医生的签约申请吗?';
- if(renew){
- url = 'patient/family_contract/unsignRenew';
- msg = '您确定取消和' + doctorName + '医生的续签申请吗?'
- }
- dialog({
- content: msg,
- ok: function() {
- d.showModal();
- var data = {};
- var userAgent = localStorage.getItem(agentName);
- data.patientCode = JSON.parse(userAgent).represented?JSON.parse(userAgent).represented:JSON.parse(userAgent).uid;
- data.doctor = code;
-
- sendPost(url , data, 'json', 'post', submitFailed, submitSuccess);
- },
- cancel: function() {
- return;
- }
- }).showModal();
- }
- function submitFailed(res) {
- d1.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 submitSuccess(res) {
- if(res.status == 200) {
- d.close();
- dialog({
- content: '您已成功取消了与'+doctorName+'医生的签约申请,是否需要选择其他医生签约?',
- okValue:'选择其他医生',
- ok: function() {
- window.location.href = "select-doctor.html";
- },
- cancelValue: "不了,谢谢",
- cancel: function(){
- history.go(-1);
- }
- }).showModal();
- } else {
- submitFailed(res);
- }
- }
|