qianyuejumin.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. var self;
  2. var checkeds = {}, num = 0;
  3. var docInfo;
  4. mui.plusReady(function(){
  5. self = plus.webview.currentWebview();
  6. docInfo = JSON.parse(plus.storage.getItem('docInfo'));
  7. getGroups();
  8. })
  9. function getGroups(){
  10. plus.nativeUI.showWaiting();
  11. sendPost("/doctor/family_contract/getPatientByLevel", {doctorCode: self.docCode, team: self.teamCode}, null, function(res){
  12. var html = "";
  13. if(res.status==200){
  14. if(!res.data.jk){
  15. res.data.jk = [];
  16. }
  17. if(self.level==2 && !res.data.qk){
  18. res.data.qk = [];
  19. }
  20. $('.content').html(template('pati_group_tmpl', res.data));
  21. mui(document).imageLazyload({
  22. placeholder: '../../../images/morenjiazhai_icon.png'
  23. });
  24. if(self.level == 2){
  25. $('.l-tab').css('display', '-webkit-box');
  26. $('#qkqx_list').show();
  27. $('#qk_nodata').show();
  28. } else {
  29. $('.content').css('padding-top', '45px');
  30. $('#jgqx_list').show();
  31. $('#jg_nodata').show();
  32. }
  33. plus.nativeUI.closeWaiting();
  34. } else {
  35. queryErr(res);
  36. }
  37. })
  38. }
  39. function queryErr(res){
  40. plus.nativeUI.closeWaiting();
  41. if(res.msg)
  42. mui.toast(res.msg);
  43. else
  44. mui.toast('程序开了点小差,请稍后重试!');
  45. }
  46. $('.l-tab li').on('tap', function(){
  47. if($(this).hasClass('l-tab-cur'))
  48. return;
  49. var i =$(this).addClass('l-tab-cur').siblings().removeClass('l-tab-cur').index();
  50. if(i == 1){
  51. $('#qkqx_list').show();
  52. $('#qk_nodata').show();
  53. $('#jgqx_list').hide();
  54. $('#jg_nodata').hide();
  55. } else {
  56. $('#jgqx_list').show();
  57. $('#jg_nodata').show();
  58. $('#qkqx_list').hide();
  59. $('#qk_nodata').hide();
  60. }
  61. })
  62. function selectZy(){
  63. if(self.level == 2){
  64. mui.openWindow({
  65. id: "zyjm-layer.html",
  66. url: "zyjm-layer.html",
  67. styles: {
  68. background: 'transparent'
  69. },
  70. show:{aniShow: "none"},
  71. waiting:{autoShow: false},
  72. extras: {
  73. teamCode: self.teamCode,
  74. docCode: self.docCode
  75. }
  76. })
  77. } else{
  78. mui.openWindow({
  79. id: "zhuanyijumin",
  80. url: "../../search/html/zhuanyijumin.html",
  81. extras: {
  82. level: 3,
  83. teamCode: self.teamCode,
  84. docCode: self.docCode,
  85. type:'转移'
  86. }
  87. });
  88. }
  89. }
  90. template.helper("setPhoto", function(p) {
  91. return getImgUrl(p);
  92. });