hospital-source.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. (function() {
  2. Vue.component('hospital-source', {
  3. template: '<div class="plr20 ptb15 clearfix">\
  4. <div class="clearfix">\
  5. <div class="c-f20 c-323232">按医院</div>\
  6. <div :class="{\'pr15\': (index%2==0)}" class="c-50 fl mt10" v-for="(data, index) in hospitalData" @click="hostipalClick(data)">\
  7. <div class="ui-grid h160 c-border ptb15 plr15">\
  8. <div class="ui-col-0 hospital-photo-box mr20">\
  9. <img v-bind:src="data.photoUri">\
  10. </div>\
  11. <div class="ui-col-1">\
  12. <div class="c-f16 c-323232">{{data.hosName}}<span class="ml10 c-f14 c-ef6b00">[{{data.levelName}}]</span></div>\
  13. <div class="mt20">\
  14. <img src="../../../images/icon_dizhi.png" width="24" height="24" />\
  15. <span class="ml5 c-f14 c-909090">{{data.address}}</span>\
  16. </div>\
  17. </div>\
  18. </div>\
  19. </div>\
  20. </div>\
  21. <div id="page" class="page_div"></div>\
  22. </div>',
  23. props: [],
  24. data: function() {
  25. return {
  26. isInit: true,
  27. hospitalData: [],
  28. currentPage: 1,
  29. pageSize: 10,
  30. totalPage: 0
  31. }
  32. },
  33. mounted: function() {
  34. var vm = this;
  35. vm.getHospitalList();
  36. },
  37. methods: {
  38. hostipalClick: function(data) {
  39. location.href = "../html/select-hospital.html?hospitalId=" + data.hospitalId + "&hosName=" + data.hosName;
  40. },
  41. getHospitalList: function() {
  42. var vm = this;
  43. var params = {
  44. pageIndex: vm.currentPage,
  45. pageSize: vm.pageSize,
  46. provinceCode: "360000",
  47. cityCode: 361100
  48. }
  49. appointmentAPI.querySimpleHospitalList(params).then(function(res) {
  50. if(res.successFlg && res.obj.Code == "10000") {
  51. var hospitalData = res.obj;
  52. vm.hospitalData = hospitalData.Result;
  53. if(vm.isInit) {
  54. vm.totalPage = Math.ceil(hospitalData.Total / vm.pageSize);
  55. //分页初始化
  56. $("#page").paging({
  57. pageNo: 1,
  58. totalPage: vm.totalPage,
  59. totalSize: hospitalData.Total,
  60. callback: function(num) {
  61. vm.currentPage = num; //回调的页数
  62. getHospitalList(vm);
  63. }
  64. })
  65. vm.isInit = false;
  66. }
  67. }
  68. })
  69. }
  70. }
  71. });
  72. })()
  73. //<div class="mt16 c-f14">\
  74. // <span class="c-0AD9C9">{{data.doctorNum}}</span>\
  75. // <span class="c-909090">个推荐医生</span>\
  76. //</div>\