jumindangan.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. var self,
  2. idCard,
  3. state;
  4. mui.plusReady(function(){
  5. self = plus.webview.currentWebview();
  6. state = self.state;
  7. idCard = self.idCard;
  8. //返回事件
  9. mui.back = function(){
  10. backAction();
  11. }
  12. plus.nativeUI.showWaiting();
  13. sendGet("doctor/patient/getPatientJWInfo",{idcard:idCard}, function(){
  14. plus.nativeUI.closeWaiting();
  15. mui.toast("请求失败");
  16. }, function(res){
  17. plus.nativeUI.closeWaiting();
  18. if(res.status==200){
  19. var html = template('list_tmp',{data:res.data,state:state})
  20. $(".c-main").html(html)
  21. bindEvent()
  22. }else{
  23. mui.toast('获取数据失败')
  24. }
  25. })
  26. function bindEvent(){
  27. $(".jm-btn").on('tap',function(){
  28. mui.openWindow({
  29. id: "juminqianyue",
  30. url: "juminqianyue.html",
  31. extras: {
  32. idCard:idCard,
  33. state:1
  34. }
  35. })
  36. })
  37. $(".jm-btn2").on('tap',function(){
  38. mui.openWindow({
  39. id: "dailiqianyue",
  40. url: "../../mine/html/dailiqianyue.html",
  41. extras: {
  42. name:self.name,
  43. idCard:self.idCard,
  44. kind:1
  45. }
  46. })
  47. })
  48. }
  49. //关闭页面
  50. function backAction(){
  51. var jmqy = plus.webview.getWebviewById('juminqianyue');
  52. var dljd = plus.webview.getWebviewById('dailijiandang');
  53. if(dljd){dljd.close('none')}
  54. if(jmqy){jmqy.close('none')}
  55. mui.later(function(){
  56. self.close()
  57. }, 300);
  58. }
  59. })
  60. template.helper("setPhoto", function(p) {
  61. return getImgUrl(p);
  62. })
  63. template.helper("setSex", function(p) {
  64. if(p==1){return '男'}
  65. if(p==2){return '女'}
  66. })