fuwutongji.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var patiCode = "",
  2. patiName = "",
  3. teamCode = "",
  4. teamName = "";
  5. new Promise(function(resolve, reject) {
  6. var html = template('table_tmpl',{
  7. data: {
  8. consult: {},
  9. followup: {},
  10. reservation: {},
  11. guidance: {},
  12. article: {}
  13. }
  14. });
  15. $('#wrapper').html(html);
  16. mui.plusReady(function() {
  17. var self = plus.webview.currentWebview();
  18. patiCode = self.patiCode;
  19. patiName = self.patiName;
  20. teamCode = self.teamCode;
  21. teamName = self.teamName;
  22. $('#team_name').text(JSON.parse(plus.storage.getItem("docInfo")).name);
  23. $('#patientName').text(patiName);
  24. initScroller();
  25. resolve(true);
  26. })
  27. }).then(function() {
  28. plus.nativeUI.showWaiting();
  29. initData();
  30. }).catch(function(e) {
  31. console && console.error(e);
  32. })
  33. function initData(){
  34. getReqPromise("doctor/patient/service/statistics",{
  35. patient: patiCode,
  36. teamCode: teamCode
  37. }, 'POST', true).then(function(res) {
  38. if(res.status == 200) {
  39. var html = template('table_tmpl',res);
  40. $('#wrapper').html(html);
  41. } else {
  42. mui.toast(res.msg);
  43. }
  44. plus.nativeUI.closeWaiting();
  45. }).catch(function(e) {
  46. console && console.error(e);
  47. });
  48. }
  49. function initScroller(){
  50. //阻尼系数
  51. var deceleration = mui.os.ios?0.003:0.0009;
  52. mui('.mui-scroll-wrapper').scroll({
  53. bounce: false,
  54. indicators: true, //是否显示滚动条
  55. deceleration:deceleration
  56. });
  57. mui(".mui-scroll").pullToRefresh({
  58. down: {
  59. callback: function() {
  60. var self = this;
  61. setTimeout(function() {
  62. initData();
  63. self.endPullDownToRefresh();
  64. }, 1000);
  65. }
  66. }
  67. });
  68. }