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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
  __name: "index",
  setup(__props) {
    const hospitalId = common_vendor.ref("");
    common_vendor.onMounted(() => {
      var _a, _b;
      const pages = getCurrentPages();
      const page = pages[pages.length - 1];
      hospitalId.value = (_b = (_a = page.$page) == null ? void 0 : _a.options) == null ? void 0 : _b.hospitalId;
    });
    const categories = [
      { value: "all", name: "全部科室", icon: "/static/department/all.png" },
      { value: "internal", name: "内科", icon: "/static/department/internal.png" },
      { value: "surgery", name: "外科", icon: "/static/department/surgery.png" },
      { value: "pediatrics", name: "儿科", icon: "/static/department/pediatrics.png" }
    ];
    const currentCategory = common_vendor.ref("all");
    const departments = common_vendor.ref([
      {
        id: 1,
        name: "心内科",
        icon: "/static/department/cardiology.png",
        status: "available",
        statusText: "可预约",
        description: "主要诊治心血管疾病,包括冠心病、高血压等",
        fee: 60,
        category: "internal",
        doctors: [
          {
            name: "张医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor1.jpg"
          },
          {
            name: "李医生",
            title: "副主任医师",
            avatar: "/static/doctor/doctor2.jpg"
          }
        ]
      },
      {
        id: 2,
        name: "消化内科",
        icon: "/static/department/gastro.png",
        status: "busy",
        statusText: "较忙",
        description: "诊治胃肠道、肝胆等消化系统疾病",
        fee: 60,
        category: "internal",
        doctors: [
          {
            name: "王医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor3.jpg"
          },
          {
            name: "赵医生",
            title: "副主任医师",
            avatar: "/static/doctor/doctor4.jpg"
          }
        ]
      },
      {
        id: 3,
        name: "普通外科",
        icon: "/static/department/surgery.png",
        status: "available",
        statusText: "可预约",
        description: "开展各类手术治疗,包括微创手术等",
        fee: 80,
        category: "surgery",
        doctors: [
          {
            name: "陈医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor5.jpg"
          }
        ]
      },
      {
        id: 4,
        name: "骨科",
        icon: "/static/department/orthopedics.png",
        status: "available",
        statusText: "可预约",
        description: "专注骨关节、脊柱等疾病的诊治",
        fee: 80,
        category: "surgery",
        doctors: [
          {
            name: "林医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor6.jpg"
          },
          {
            name: "黄医生",
            title: "副主任医师",
            avatar: "/static/doctor/doctor7.jpg"
          }
        ]
      },
      {
        id: 5,
        name: "儿科门诊",
        icon: "/static/department/pediatrics.png",
        status: "busy",
        statusText: "较忙",
        description: "为儿童提供全面的医疗保健服务",
        fee: 50,
        category: "pediatrics",
        doctors: [
          {
            name: "刘医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor8.jpg"
          }
        ]
      },
      {
        id: 6,
        name: "儿童保健科",
        icon: "/static/department/child-care.png",
        status: "available",
        statusText: "可预约",
        description: "提供儿童生长发育监测、疫苗接种等服务",
        fee: 40,
        category: "pediatrics",
        doctors: [
          {
            name: "周医生",
            title: "主任医师",
            avatar: "/static/doctor/doctor9.jpg"
          },
          {
            name: "吴医生",
            title: "副主任医师",
            avatar: "/static/doctor/doctor10.jpg"
          }
        ]
      }
    ]);
    const filteredDepartments = common_vendor.computed(() => {
      if (currentCategory.value === "all") {
        return departments.value;
      }
      return departments.value.filter((dept) => dept.category === currentCategory.value);
    });
    const selectCategory = (category) => {
      currentCategory.value = category;
    };
    const selectDepartment = (dept) => {
      common_vendor.index.navigateTo({
        url: `/pages/appointment/doctor?departmentId=${dept.id}`
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.f(categories, (category, index, i0) => {
          return {
            a: category.icon,
            b: common_vendor.t(category.name),
            c: index,
            d: currentCategory.value === category.value ? 1 : "",
            e: common_vendor.o(($event) => selectCategory(category.value), index)
          };
        }),
        b: common_vendor.f(filteredDepartments.value, (dept, index, i0) => {
          return {
            a: dept.icon,
            b: common_vendor.t(dept.name),
            c: common_vendor.t(dept.statusText),
            d: common_vendor.n(dept.status),
            e: common_vendor.t(dept.description),
            f: common_vendor.f(dept.doctors, (doctor, idx, i1) => {
              return {
                a: doctor.avatar,
                b: common_vendor.t(doctor.name),
                c: common_vendor.t(doctor.title),
                d: idx
              };
            }),
            g: common_vendor.t(dept.fee),
            h: common_vendor.o(($event) => selectDepartment(dept), index),
            i: index,
            j: common_vendor.o(($event) => selectDepartment(dept), index)
          };
        }),
        c: common_vendor.gei(_ctx, "")
      };
    };
  }
};
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/department/index.js.map