"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const _sfc_main = {
|
__name: "detail",
|
setup(__props) {
|
const department = common_vendor.ref({
|
id: 1,
|
name: "心内科",
|
icon: "/static/department/cardiology.png",
|
description: "主要诊治心血管疾病,包括冠心病、高血压等",
|
doctorCount: 8,
|
rating: 4.9,
|
appointmentCount: 2580,
|
doctors: [
|
{
|
id: 1,
|
name: "张医生",
|
title: "主任医师",
|
avatar: "/static/doctor/doctor1.jpg",
|
specialty: "冠心病、心律失常",
|
rating: 4.9,
|
ratingCount: 1280
|
}
|
// ... 更多医生数据
|
],
|
services: [
|
{
|
name: "普通门诊",
|
price: 60
|
},
|
{
|
name: "专家门诊",
|
price: 120
|
},
|
{
|
name: "心电图检查",
|
price: 80
|
}
|
],
|
guide: [
|
{
|
title: "预约挂号",
|
description: "在线选择医生和就诊时间进行预约"
|
},
|
{
|
title: "取号就诊",
|
description: "就诊当天提前半小时到医院取号"
|
},
|
{
|
title: "医生诊疗",
|
description: "按时到诊室就医,出示预约信息"
|
}
|
],
|
reviews: [
|
{
|
avatar: "/static/avatar/user1.jpg",
|
name: "张**",
|
time: "2024-03-20",
|
content: "医生很专业,态度也很好,解答很详细",
|
reply: "感谢您的信任,祝您身体健康!"
|
}
|
]
|
});
|
const selectDoctor = (doctor) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/appointment/doctor?doctorId=${doctor.id}`
|
});
|
};
|
const bookDepartment = () => {
|
common_vendor.index.navigateTo({
|
url: `/pages/appointment/doctor?departmentId=${department.value.id}&hospitalId=${hospital.value.id}`
|
});
|
};
|
const hospital = common_vendor.ref({
|
id: 1,
|
name: "青岛镜湖医院",
|
logo: "/static/hospital/kiang-wu.jpg",
|
address: "青岛连胜马路33号",
|
tags: ["综合医院", "24小时急诊", "特需门诊"],
|
rating: 4.8,
|
distance: 2.5
|
});
|
const navigateToHospital = () => {
|
common_vendor.index.navigateTo({
|
url: `/pages/hospital/detail?id=${hospital.value.id}`
|
});
|
};
|
common_vendor.onMounted(() => {
|
var _a, _b, _c, _d;
|
const pages = getCurrentPages();
|
const page = pages[pages.length - 1];
|
(_b = (_a = page.$page) == null ? void 0 : _a.options) == null ? void 0 : _b.id;
|
const hospitalId = (_d = (_c = page.$page) == null ? void 0 : _c.options) == null ? void 0 : _d.hospitalId;
|
loadHospitalInfo(hospitalId);
|
loadDepartmentDetail();
|
});
|
const loadHospitalInfo = (hospitalId) => {
|
common_vendor.index.__f__("log", "at pages/department/detail.vue:265", "加载医院信息:", hospitalId);
|
};
|
const loadDepartmentDetail = (id) => {
|
};
|
const getStepColor = (index) => {
|
const colors = [
|
"#0f95b0, #89C4C1",
|
"#747CF9, #9B7CF9",
|
"#FF9B6A, #FF6B8B",
|
"#4DCEA5, #2FB4AE"
|
];
|
return colors[index % colors.length];
|
};
|
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: department.value.icon,
|
g: common_vendor.t(department.value.name),
|
h: common_vendor.t(department.value.description),
|
i: common_vendor.t(department.value.doctorCount),
|
j: common_vendor.t(department.value.rating),
|
k: common_vendor.t(department.value.appointmentCount),
|
l: common_vendor.f(department.value.doctors, (doctor, index, i0) => {
|
return {
|
a: doctor.avatar,
|
b: common_vendor.t(doctor.name),
|
c: common_vendor.t(doctor.title),
|
d: common_vendor.t(doctor.specialty),
|
e: common_vendor.t(doctor.rating),
|
f: common_vendor.t(doctor.ratingCount),
|
g: index,
|
h: common_vendor.o(($event) => selectDoctor(doctor), index)
|
};
|
}),
|
m: common_vendor.f(department.value.services, (service, index, i0) => {
|
return {
|
a: common_vendor.t(service.name),
|
b: common_vendor.t(service.price),
|
c: index
|
};
|
}),
|
n: common_vendor.f(department.value.guide, (step, index, i0) => {
|
return {
|
a: common_vendor.t(index + 1),
|
b: `linear-gradient(135deg, ${getStepColor(index)})`,
|
c: common_vendor.t(step.title),
|
d: common_vendor.t(step.description),
|
e: index
|
};
|
}),
|
o: common_vendor.t(department.value.reviews.length),
|
p: common_vendor.f(department.value.reviews, (review, index, i0) => {
|
return common_vendor.e({
|
a: review.avatar,
|
b: common_vendor.t(review.name),
|
c: common_vendor.t(review.time),
|
d: common_vendor.t(review.content),
|
e: review.reply
|
}, review.reply ? {
|
f: common_vendor.t(review.reply)
|
} : {}, {
|
g: index
|
});
|
}),
|
q: common_vendor.o(bookDepartment),
|
r: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/department/detail.js.map
|