index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. "use strict";
  2. var common_vendor = require("../../common/vendor.js");
  3. var api_doctor = require("../../api/doctor.js");
  4. var api_department = require("../../api/department.js");
  5. require("../../common/request.js");
  6. const _sfc_main = {
  7. data() {
  8. return {
  9. depts: [],
  10. doctors: []
  11. };
  12. },
  13. onShow() {
  14. this.getDepartmentList();
  15. this.getDoctorList();
  16. },
  17. methods: {
  18. getDoctorList() {
  19. var data = {
  20. isTui: 1,
  21. pageNum: 1,
  22. pageSize: 10
  23. };
  24. api_doctor.getDoctorList(data).then((res) => {
  25. if (res.code == 200) {
  26. res.data.list.forEach(function(value, index, array) {
  27. value.prices = JSON.parse(value.priceJson);
  28. });
  29. this.doctors = res.data.list;
  30. console.log(this.doctors);
  31. } else {
  32. common_vendor.index.showToast({
  33. icon: "none",
  34. title: "\u8BF7\u6C42\u5931\u8D25"
  35. });
  36. }
  37. });
  38. },
  39. getDepartmentList(page) {
  40. var data = {};
  41. api_department.getDepartmentList(data).then((res) => {
  42. if (res.code == 200) {
  43. this.depts = res.data;
  44. } else {
  45. common_vendor.index.showToast({
  46. icon: "none",
  47. title: "\u8BF7\u6C42\u5931\u8D25"
  48. });
  49. }
  50. });
  51. },
  52. navTo(url) {
  53. common_vendor.index.navigateTo({
  54. url
  55. });
  56. }
  57. }
  58. };
  59. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  60. return {
  61. a: common_vendor.f($data.depts, (item, index, i0) => {
  62. return {
  63. a: item.iconUrl,
  64. b: common_vendor.t(item.deptName),
  65. c: common_vendor.o(($event) => $options.navTo("./doctorList?deptId=" + item.deptId))
  66. };
  67. }),
  68. b: common_vendor.f($data.doctors, (item, index, i0) => {
  69. return {
  70. a: item.avatar,
  71. b: common_vendor.t(item.doctorName),
  72. c: common_vendor.t(item.position),
  73. d: common_vendor.t(item.hospitalName),
  74. e: common_vendor.t(item.deptName),
  75. f: common_vendor.t(item.speciality),
  76. g: common_vendor.t(item.pingStar),
  77. h: common_vendor.t(item.orderNumber),
  78. i: common_vendor.f(item.prices, (price, index2, i1) => {
  79. return common_vendor.e({
  80. a: common_vendor.t(price.price.toFixed(2)),
  81. b: index2 == 0
  82. }, index2 == 0 ? {} : {});
  83. }),
  84. j: common_vendor.o(($event) => $options.navTo("./doctorDetails?doctorId=" + item.doctorId))
  85. };
  86. })
  87. };
  88. }
  89. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-1619804a"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages/doctor/index.vue"]]);
  90. wx.createPage(MiniProgramPage);