index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import history from "../../utils/history";
  2. import { getHospitalDistrictList } from "./service";
  3. import { getRegisteredAnnouncement } from "../../../../core/utils/ywtService";
  4. Component({
  5. props: {
  6. height: "100vh",
  7. componentData: {},
  8. },
  9. methods: {
  10. getExtInfo() {
  11. const { componentData } = this.props;
  12. const { componentExtInfo } = componentData;
  13. return componentExtInfo || {};
  14. },
  15. async onService() {
  16. const list = await getHospitalDistrictList();
  17. return {
  18. list,
  19. pagination: {
  20. total: list.length,
  21. },
  22. };
  23. },
  24. onItemTap({ target: { dataset } }) {
  25. this.toNextPage(dataset.item);
  26. },
  27. async toNextPage(item, replace) {
  28. const { name, hospitalDistrictId, extInfo, address } = item;
  29. const { componentData } = this.props;
  30. const { query = {} } = this.$page.data;
  31. history[replace ? "replace" : "push"]({
  32. query: {
  33. ...query,
  34. name,
  35. hospitalDistrictId,
  36. hospitalId: extInfo.hospitalId || "",
  37. subHospitalId: extInfo.subHospitalId || "",
  38. subHospitalTitle: `${name}(${address})`,
  39. },
  40. componentData,
  41. title: "医院介绍",
  42. pageType: "hospital-introduce",
  43. });
  44. return;
  45. },
  46. },
  47. });