var patiCode = ""; var oPatiInfo =""; mui.plusReady(function() { plus.nativeUI.showWaiting(); var docInfo= JSON.parse(plus.storage.getItem("docInfo")) ; self = plus.webview.currentWebview(); patiCode = self.code; oPatiInfo = self.patiInfo; sendPost("doctor/family/getfamilyMember?tim="+ new Date().getTime(), {idcard: oPatiInfo.idcard, patientCode: patiCode, doctorCode: docInfo.code}, function(){ mui.toast("查询家庭成员列表失败!"); plus.nativeUI.closeWaiting(); }, function(res) { console.log(JSON.stringify(res)) if(res.status == 200) { template.helper('setPhoto', function(s){ return "../../../images/p-female.png"; }) res.qyRelation = self.qyRelation; var html = template("familyMember_tmpl", res); $("#familyMemberList").empty(); $("#familyMemberList").append(html); plus.nativeUI.closeWaiting(); //默认头像设置 // $('#familyMemberList img.photo').error(function(){ // $(this).attr('src', $(this).attr('data-sex') == '1' ? // "../../../images/p-male.png" : "../../../images/p-female.png"); // }).load(function(){ // $(this).prev().hide(); // $(this).show(); // }); //邀请按钮绑定事件 $('.btn-yqqy').on('tap', function(){ var dom = $(this); plus.nativeUI.showWaiting("处理中,请稍等..."); var p = {patient: dom.attr('data-code'), relation: dom.attr('data-relaholder'), currentPatient: patiCode, doctor: docInfo.code}; sendPost("/doctor/family/inviteFamilyMember", p, function(){ mui.toast("邀请失败!"); }, function(res) { plus.nativeUI.closeWaiting(); if(res.status == 200) { mui.toast("已成功邀请签约,待对方处理!"); dom.closest(".div-content").find(".lbl-type").html("签约状态:已邀请"); dom.remove(); } else { mui.toast(res.msg); } }); }); $('.btn-tzsb').on('tap', function(){ var params={}; params.patient = $(this).attr("data-code"); openWebviewExtras("../../wdsb/html/my-equipments.html",params); }) } else { mui.toast(res.msg); plus.nativeUI.closeWaiting(); } }); });