"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const _sfc_main = {
|
__name: "record",
|
setup(__props) {
|
const tabs = [
|
{ label: "全部", value: "all" },
|
{ label: "待支付", value: "unpaid" },
|
{ label: "待就诊", value: "paid" },
|
{ label: "已完成", value: "completed" },
|
{ label: "已取消", value: "cancelled" }
|
];
|
const currentTab = common_vendor.ref("all");
|
const records = common_vendor.ref([
|
{
|
id: 1,
|
hospital: "青岛镜湖医院",
|
department: "心内科",
|
doctorName: "张医生",
|
doctorTitle: "主任医师",
|
doctorAvatar: "/static/doctor/doctor1.png",
|
date: "2024-03-21",
|
time: "09:00",
|
patientName: "张三",
|
patientRelation: "本人",
|
fee: 100,
|
status: "unpaid",
|
statusText: "待支付"
|
},
|
{
|
id: 2,
|
hospital: "青岛科大医院",
|
department: "儿科",
|
doctorName: "李医生",
|
doctorTitle: "副主任医师",
|
doctorAvatar: "/static/doctor/doctor2.png",
|
date: "2024-03-20",
|
time: "10:30",
|
patientName: "张小明",
|
patientRelation: "子女",
|
fee: 80,
|
status: "paid",
|
statusText: "待就诊"
|
}
|
]);
|
const filteredRecords = common_vendor.computed(() => {
|
if (currentTab.value === "all") {
|
return records.value;
|
}
|
return records.value.filter((record) => record.status === currentTab.value);
|
});
|
const switchTab = (tab) => {
|
currentTab.value = tab;
|
};
|
const goPay = (record) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/payment/index?orderId=${record.id}`
|
});
|
};
|
const cancelAppointment = (record) => {
|
common_vendor.index.showModal({
|
title: "取消预约",
|
content: "确定要取消该预约吗?",
|
success: (res) => {
|
if (res.confirm) {
|
common_vendor.index.showToast({
|
title: "取消成功",
|
icon: "success"
|
});
|
}
|
}
|
});
|
};
|
const viewReport = (record) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/report/detail?id=${record.id}`
|
});
|
};
|
return (_ctx, _cache) => {
|
return {
|
a: common_vendor.f(tabs, (tab, index, i0) => {
|
return {
|
a: common_vendor.t(tab.label),
|
b: index,
|
c: currentTab.value === tab.value ? 1 : "",
|
d: common_vendor.o(($event) => switchTab(tab.value), index)
|
};
|
}),
|
b: common_vendor.f(filteredRecords.value, (record, index, i0) => {
|
return common_vendor.e({
|
a: common_vendor.t(record.hospital),
|
b: common_vendor.t(record.statusText),
|
c: common_vendor.n(record.status),
|
d: common_vendor.t(record.department),
|
e: common_vendor.t(record.doctorName),
|
f: common_vendor.t(record.doctorTitle),
|
g: common_vendor.t(record.date),
|
h: common_vendor.t(record.time),
|
i: record.doctorAvatar,
|
j: common_vendor.t(record.patientName),
|
k: common_vendor.t(record.patientRelation),
|
l: common_vendor.t(record.fee),
|
m: record.status === "unpaid"
|
}, record.status === "unpaid" ? {
|
n: common_vendor.o(($event) => goPay(record), index)
|
} : {}, {
|
o: record.status === "paid"
|
}, record.status === "paid" ? {
|
p: common_vendor.o(($event) => cancelAppointment(), index)
|
} : {}, {
|
q: record.status === "completed"
|
}, record.status === "completed" ? {
|
r: common_vendor.o(($event) => viewReport(record), index)
|
} : {}, {
|
s: index
|
});
|
}),
|
c: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/appointment/record.js.map
|