"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