jiatingchengyuan.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. var patiCode = "";
  2. var oPatiInfo ="";
  3. mui.plusReady(function() {
  4. plus.nativeUI.showWaiting();
  5. var docInfo= JSON.parse(plus.storage.getItem("docInfo")) ;
  6. self = plus.webview.currentWebview();
  7. patiCode = self.code;
  8. oPatiInfo = self.patiInfo;
  9. sendPost("doctor/family/getfamilyMember?tim="+ new Date().getTime(), {idcard: oPatiInfo.idcard, patientCode: patiCode, doctorCode: docInfo.code}, function(){
  10. mui.toast("查询家庭成员列表失败!");
  11. plus.nativeUI.closeWaiting();
  12. }, function(res) {
  13. console.log(JSON.stringify(res))
  14. if(res.status == 200) {
  15. template.helper('setPhoto', function(s){
  16. return "../../../images/p-female.png";
  17. })
  18. res.qyRelation = self.qyRelation;
  19. var html = template("familyMember_tmpl", res);
  20. $("#familyMemberList").empty();
  21. $("#familyMemberList").append(html);
  22. plus.nativeUI.closeWaiting();
  23. //默认头像设置
  24. // $('#familyMemberList img.photo').error(function(){
  25. // $(this).attr('src', $(this).attr('data-sex') == '1' ?
  26. // "../../../images/p-male.png" : "../../../images/p-female.png");
  27. // }).load(function(){
  28. // $(this).prev().hide();
  29. // $(this).show();
  30. // });
  31. //邀请按钮绑定事件
  32. $('.btn-yqqy').on('tap', function(){
  33. var dom = $(this);
  34. plus.nativeUI.showWaiting("处理中,请稍等...");
  35. var p = {patient: dom.attr('data-code'), relation: dom.attr('data-relaholder'),
  36. currentPatient: patiCode, doctor: docInfo.code};
  37. sendPost("/doctor/family/inviteFamilyMember", p, function(){
  38. mui.toast("邀请失败!");
  39. }, function(res) {
  40. plus.nativeUI.closeWaiting();
  41. if(res.status == 200) {
  42. mui.toast("已成功邀请签约,待对方处理!");
  43. dom.closest(".div-content").find(".lbl-type").html("签约状态:已邀请");
  44. dom.remove();
  45. }
  46. else {
  47. mui.toast(res.msg);
  48. }
  49. });
  50. });
  51. $('.btn-tzsb').on('tap', function(){
  52. var params={};
  53. params.patient = $(this).attr("data-code");
  54. openWebviewExtras("../../wdsb/html/my-equipments.html",params);
  55. })
  56. }
  57. else {
  58. mui.toast(res.msg);
  59. plus.nativeUI.closeWaiting();
  60. }
  61. });
  62. });