fuwutongji.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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(teamName);
  23. $('#patientName').text(patiName);
  24. initScroller();
  25. resolve(true);
  26. })
  27. }).then(function() {
  28. initData();
  29. }).catch(function(e) {
  30. console && console.error(e);
  31. })
  32. function initData(){
  33. getReqPromise("doctor/patient/service/statistics",{
  34. patient: patiCode,
  35. teamCode: teamCode
  36. }, 'POST', true).then(function(res) {
  37. if(res.status == 200) {
  38. var html = template('table_tmpl',res);
  39. $('#wrapper').html(html);
  40. } else {
  41. mui.toast(res.msg);
  42. }
  43. }).catch(function(e) {
  44. console && console.error(e);
  45. });
  46. }
  47. function initScroller(){
  48. //阻尼系数
  49. var deceleration = mui.os.ios?0.003:0.0009;
  50. mui('.mui-scroll-wrapper').scroll({
  51. bounce: false,
  52. indicators: true, //是否显示滚动条
  53. deceleration:deceleration
  54. });
  55. mui(".mui-scroll").pullToRefresh({
  56. down: {
  57. callback: function() {
  58. var self = this;
  59. setTimeout(function() {
  60. initData();
  61. self.endPullDownToRefresh();
  62. }, 1000);
  63. }
  64. }
  65. });
  66. }