"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const common_assets = require("../../common/assets.js");
|
const _sfc_main = {
|
__name: "record",
|
setup(__props) {
|
const recordTypes = [
|
{ label: "全部", value: "all" },
|
{ label: "待接种", value: "upcoming" },
|
{ label: "已完成", value: "completed" },
|
{ label: "已取消", value: "cancelled" }
|
];
|
const currentType = common_vendor.ref("all");
|
const refreshing = common_vendor.ref(false);
|
const hasMore = common_vendor.ref(true);
|
const records = common_vendor.ref([
|
{
|
id: 1,
|
vaccineNameKey: "vaccine.list.covid.name",
|
status: "upcoming",
|
statusText: "待接种",
|
time: "2024-03-25 09:30",
|
clinicName: "青岛镜湖医院预防接种门诊",
|
clinicAddress: "青岛连胜马路33号",
|
clinicImage: "/static/hospital/kiang-wu.jpg",
|
patientName: "张三",
|
doseNumber: "第1剂",
|
batchNo: "BN2024001",
|
fee: 0
|
},
|
{
|
id: 2,
|
vaccineNameKey: "vaccine.list.flu.name",
|
status: "completed",
|
statusText: "已完成",
|
time: "2024-03-20 15:00",
|
clinicName: "青岛科大医院疫苗中心",
|
clinicAddress: "青岛氹仔大学大马路",
|
clinicImage: "/static/hospital/must.jpg",
|
patientName: "张三",
|
doseNumber: "第1剂",
|
batchNo: "BN2024002",
|
fee: 180
|
}
|
]);
|
const filteredRecords = common_vendor.computed(() => {
|
if (currentType.value === "all") {
|
return records.value;
|
}
|
return records.value.filter((record) => record.status === currentType.value);
|
});
|
const selectType = (type) => {
|
currentType.value = type;
|
};
|
const cancelAppointment = (record) => {
|
common_vendor.index.showModal({
|
title: "取消预约",
|
content: "确定要取消该预约吗?",
|
success: (res) => {
|
if (res.confirm) {
|
common_vendor.index.__f__("log", "at pages/vaccine/record.vue:163", "取消预约:", record.id);
|
}
|
}
|
});
|
};
|
const viewCertificate = (record) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/vaccine/certificate?id=${record.id}`
|
});
|
};
|
const onRefresh = () => {
|
refreshing.value = true;
|
loadRecords();
|
setTimeout(() => {
|
refreshing.value = false;
|
}, 1e3);
|
};
|
const onLoadMore = () => {
|
if (!hasMore.value)
|
return;
|
loadRecords();
|
};
|
const loadRecords = () => {
|
setTimeout(() => {
|
hasMore.value = false;
|
}, 1e3);
|
};
|
return (_ctx, _cache) => {
|
return common_vendor.e({
|
a: common_vendor.f(recordTypes, (type, index, i0) => {
|
return {
|
a: common_vendor.t(type.label),
|
b: index,
|
c: currentType.value === type.value ? 1 : "",
|
d: common_vendor.o(($event) => selectType(type.value), index)
|
};
|
}),
|
b: common_vendor.f(filteredRecords.value, (record, index, i0) => {
|
return common_vendor.e({
|
a: common_vendor.t(_ctx.$t(record.vaccineNameKey)),
|
b: common_vendor.t(record.statusText),
|
c: common_vendor.n(record.status),
|
d: common_vendor.t(record.time),
|
e: record.clinicImage,
|
f: common_vendor.t(record.clinicName),
|
g: common_vendor.t(record.clinicAddress),
|
h: common_vendor.t(record.patientName),
|
i: common_vendor.t(record.doseNumber),
|
j: common_vendor.t(record.batchNo),
|
k: record.fee > 0
|
}, record.fee > 0 ? {
|
l: common_vendor.t(record.fee)
|
} : {}, {
|
m: record.status === "upcoming"
|
}, record.status === "upcoming" ? {
|
n: common_vendor.o(($event) => cancelAppointment(record), index)
|
} : {}, {
|
o: record.status === "completed"
|
}, record.status === "completed" ? {
|
p: common_vendor.o(($event) => viewCertificate(record), index)
|
} : {}, {
|
q: index
|
});
|
}),
|
c: hasMore.value
|
}, hasMore.value ? {} : {}, {
|
d: filteredRecords.value.length === 0
|
}, filteredRecords.value.length === 0 ? {
|
e: common_assets._imports_0$3
|
} : {}, {
|
f: refreshing.value,
|
g: common_vendor.o(onRefresh),
|
h: common_vendor.o(onLoadMore),
|
i: common_vendor.gei(_ctx, "")
|
});
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/vaccine/record.js.map
|