"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const common_assets = require("../../common/assets.js");
|
const _sfc_main = {
|
__name: "cases",
|
setup(__props) {
|
const currentPage = common_vendor.ref(1);
|
const hasMore = common_vendor.ref(true);
|
const refreshing = common_vendor.ref(false);
|
const caseList = common_vendor.ref([
|
{
|
id: 1,
|
date: "2024-03-25 09:30",
|
hospitalName: "青岛镜湖医院",
|
hospitalLogo: "/static/hospital/kiang-wu.jpg",
|
departmentName: "心内科",
|
complaint: "胸闷、气短2天",
|
diagnosis: "冠心病、高血压2级",
|
treatment: "1. 硝酸甘油片含服\n2. 阿司匹林肠溶片口服\n3. 建议定期复查",
|
doctorName: "张医生",
|
doctorTitle: "主任医师",
|
doctorAvatar: "/static/doctor/doctor1.jpg",
|
hasReport: true
|
},
|
{
|
id: 2,
|
date: "2024-03-20 15:00",
|
hospitalName: "青岛科大医院",
|
hospitalLogo: "/static/hospital/must.jpg",
|
departmentName: "消化内科",
|
complaint: "上腹部不适1周",
|
diagnosis: "慢性胃炎",
|
treatment: "1. 奥美拉唑胶囊\n2. 多潘立酮片\n3. 注意饮食调理",
|
doctorName: "李医生",
|
doctorTitle: "副主任医师",
|
doctorAvatar: "/static/doctor/doctor2.jpg",
|
hasReport: true
|
}
|
// ... 更多病例数据
|
]);
|
const onRefresh = () => {
|
refreshing.value = true;
|
currentPage.value = 1;
|
loadCases();
|
setTimeout(() => {
|
refreshing.value = false;
|
}, 1e3);
|
};
|
const onLoadMore = () => {
|
if (!hasMore.value)
|
return;
|
currentPage.value++;
|
loadCases();
|
};
|
const loadCases = () => {
|
setTimeout(() => {
|
if (currentPage.value >= 3) {
|
hasMore.value = false;
|
}
|
}, 1e3);
|
};
|
const viewDetail = (item) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/my/case-detail?id=${item.id}`
|
});
|
};
|
const viewReport = (item) => {
|
if (item.hasReport) {
|
common_vendor.index.navigateTo({
|
url: `/pages/records/report?id=${item.id}`
|
});
|
}
|
};
|
const bookAgain = (item) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/appointment/doctor?departmentId=${item.departmentId}&hospitalId=${item.hospitalId}`
|
});
|
};
|
return (_ctx, _cache) => {
|
return common_vendor.e({
|
a: common_vendor.f(caseList.value, (item, index, i0) => {
|
return {
|
a: common_vendor.t(item.date.split(" ")[0]),
|
b: common_vendor.t(item.date.split(" ")[1]),
|
c: item.hospitalLogo,
|
d: common_vendor.t(item.hospitalName),
|
e: common_vendor.t(item.departmentName),
|
f: common_vendor.t(item.complaint),
|
g: common_vendor.t(item.diagnosis),
|
h: common_vendor.t(item.treatment),
|
i: item.doctorAvatar,
|
j: common_vendor.t(item.doctorName),
|
k: common_vendor.t(item.doctorTitle),
|
l: common_vendor.o(($event) => viewReport(item), index),
|
m: common_vendor.o(($event) => bookAgain(item), index),
|
n: index,
|
o: common_vendor.o(($event) => viewDetail(item), index)
|
};
|
}),
|
b: hasMore.value
|
}, hasMore.value ? {} : {}, {
|
c: !hasMore.value && caseList.value.length > 0
|
}, !hasMore.value && caseList.value.length > 0 ? {} : {}, {
|
d: caseList.value.length === 0
|
}, caseList.value.length === 0 ? {
|
e: common_assets._imports_0$4
|
} : {}, {
|
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/my/cases.js.map
|