"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const _sfc_main = {
|
__name: "list",
|
setup(__props) {
|
const categoryName = common_vendor.ref("");
|
const departments = common_vendor.ref([
|
{
|
id: 1,
|
name: "心内科",
|
icon: "/static/department/cardiology.png",
|
description: "心血管疾病诊治",
|
status: "available",
|
statusText: "可预约",
|
fee: 60,
|
doctorCount: 8,
|
availableCount: 25,
|
rating: 4.9,
|
doctors: [
|
{
|
name: "张医生",
|
title: "主任医师",
|
avatar: "/static/doctor/doctor1.jpg"
|
},
|
{
|
name: "李医生",
|
title: "副主任医师",
|
avatar: "/static/doctor/doctor2.jpg"
|
}
|
]
|
}
|
// ... 更多科室数据
|
]);
|
const hospital = common_vendor.ref({
|
id: 1,
|
name: "青岛镜湖医院",
|
logo: "/static/hospital/kiang-wu.jpg",
|
address: "青岛连胜马路33号",
|
tags: ["综合医院", "24小时急诊", "特需门诊"],
|
rating: 4.8,
|
distance: 2.5
|
});
|
common_vendor.onMounted(() => {
|
var _a, _b, _c, _d;
|
const pages = getCurrentPages();
|
const page = pages[pages.length - 1];
|
const category = ((_b = (_a = page.$page) == null ? void 0 : _a.options) == null ? void 0 : _b.category) || "全部科室";
|
const hospitalId = (_d = (_c = page.$page) == null ? void 0 : _c.options) == null ? void 0 : _d.hospitalId;
|
categoryName.value = category;
|
loadHospitalInfo(hospitalId);
|
loadDepartments();
|
});
|
const loadHospitalInfo = (hospitalId) => {
|
common_vendor.index.__f__("log", "at pages/department/list.vue:141", "加载医院信息:", hospitalId);
|
};
|
const navigateToDetail = (dept) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/department/detail?id=${dept.id}&hospitalId=${hospital.value.id}`
|
});
|
};
|
const bookDepartment = (dept) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/appointment/doctor?departmentId=${dept.id}`
|
});
|
};
|
const loadDepartments = (category) => {
|
};
|
const navigateToHospital = () => {
|
common_vendor.index.navigateTo({
|
url: `/pages/hospital/detail?id=${hospital.value.id}`
|
});
|
};
|
return (_ctx, _cache) => {
|
return {
|
a: hospital.value.logo,
|
b: common_vendor.t(hospital.value.name),
|
c: common_vendor.t(hospital.value.address),
|
d: common_vendor.f(hospital.value.tags, (tag, idx, i0) => {
|
return {
|
a: common_vendor.t(tag),
|
b: idx
|
};
|
}),
|
e: common_vendor.o(navigateToHospital),
|
f: common_vendor.t(categoryName.value),
|
g: common_vendor.t(departments.value.length),
|
h: common_vendor.f(departments.value, (dept, index, i0) => {
|
return {
|
a: dept.icon,
|
b: common_vendor.t(dept.name),
|
c: common_vendor.t(dept.description),
|
d: common_vendor.t(dept.statusText),
|
e: common_vendor.n(dept.status),
|
f: common_vendor.t(dept.fee === 0 ? "免费" : `¥${dept.fee}`),
|
g: dept.fee === 0 ? 1 : "",
|
h: common_vendor.t(dept.doctorCount),
|
i: common_vendor.t(dept.availableCount),
|
j: common_vendor.t(dept.rating),
|
k: 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
|
};
|
}),
|
l: common_vendor.o(($event) => bookDepartment(dept), index),
|
m: index,
|
n: common_vendor.o(($event) => navigateToDetail(dept), index)
|
};
|
}),
|
i: hospital.value.logo,
|
j: common_vendor.t(hospital.value.name),
|
k: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/department/list.js.map
|