"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