WXL
11 小时以前 05c363fdd7ab04e3bd9a753e2c5d5bfff04d681c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "department",
  setup(__props) {
    const keyword = common_vendor.ref("");
    const disease = common_vendor.ref("");
    const commonDepartments = common_vendor.ref([
      {
        id: 1,
        name: "内科",
        icon: "/static/department/internal.png"
      },
      {
        id: 2,
        name: "外科",
        icon: "/static/department/surgery.png"
      },
      {
        id: 3,
        name: "儿科",
        icon: "/static/department/pediatrics.png"
      },
      {
        id: 4,
        name: "妇产科",
        icon: "/static/department/obstetrics.png"
      },
      {
        id: 5,
        name: "眼科",
        icon: "/static/department/ophthalmology.png"
      },
      {
        id: 6,
        name: "口腔科",
        icon: "/static/department/dentistry.png"
      }
    ]);
    const departments = common_vendor.ref([
      {
        name: "内科",
        departments: [
          { id: 101, name: "心内科" },
          { id: 102, name: "呼吸内科" },
          { id: 103, name: "消化内科" },
          { id: 104, name: "神经内科" },
          { id: 105, name: "内分泌科" }
        ]
      },
      {
        name: "外科",
        departments: [
          { id: 201, name: "普外科" },
          { id: 202, name: "骨科" },
          { id: 203, name: "神经外科" },
          { id: 204, name: "心胸外科" },
          { id: 205, name: "泌尿外科" }
        ]
      },
      {
        name: "专科",
        departments: [
          { id: 301, name: "眼科" },
          { id: 302, name: "耳鼻喉科" },
          { id: 303, name: "口腔科" },
          { id: 304, name: "皮肤科" },
          { id: 305, name: "精神科" }
        ]
      }
    ]);
    const onSearch = (e) => {
      e.detail.value.trim();
    };
    const selectDepartment = (department) => {
      common_vendor.index.navigateTo({
        url: `/pages/appointment/doctor?departmentId=${department.id}&disease=${disease.value}`
      });
    };
    common_vendor.onMounted(() => {
      var _a;
      const pages = getCurrentPages();
      const page = pages[pages.length - 1];
      const { disease: diseaseName } = ((_a = page.$page) == null ? void 0 : _a.options) || {};
      if (diseaseName) {
        disease.value = decodeURIComponent(diseaseName);
      }
    });
    return (_ctx, _cache) => {
      return {
        a: common_vendor.o([($event) => keyword.value = $event.detail.value, onSearch]),
        b: keyword.value,
        c: common_vendor.f(commonDepartments.value, (item, index, i0) => {
          return {
            a: item.icon,
            b: common_vendor.t(item.name),
            c: index,
            d: common_vendor.o(($event) => selectDepartment(item), index)
          };
        }),
        d: common_vendor.f(departments.value, (category, index, i0) => {
          return {
            a: common_vendor.t(category.name),
            b: common_vendor.f(category.departments, (dept, idx, i1) => {
              return {
                a: common_vendor.t(dept.name),
                b: idx,
                c: common_vendor.o(($event) => selectDepartment(dept), idx)
              };
            }),
            c: index
          };
        }),
        e: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/appointment/department.js.map