"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const common_assets = require("../../common/assets.js");
|
const _sfc_main = {
|
__name: "index",
|
setup(__props) {
|
const userInfo = common_vendor.ref({
|
avatar: "/static/avatar/default.jpg",
|
name: "张三"
|
});
|
const records = common_vendor.ref([
|
{
|
date: "2024-03-20",
|
hospital: "青岛镜湖医院",
|
department: "内科",
|
diagnosis: "上呼吸道感染"
|
}
|
// ...更多记录
|
]);
|
const reports = common_vendor.ref([
|
{
|
icon: "/static/report/blood.png",
|
name: "血常规检查",
|
time: "2024-03-20",
|
status: "normal",
|
statusText: "正常"
|
}
|
// ...更多报告
|
]);
|
const symptoms = common_vendor.ref([
|
{
|
icon: "/static/symptoms/fever.png",
|
name: "发热"
|
}
|
// ...更多症状
|
]);
|
const goAIConsult = () => {
|
common_vendor.index.navigateTo({
|
url: "/pages/consultation/ai"
|
});
|
};
|
const goDoctorConsult = () => {
|
common_vendor.index.navigateTo({
|
url: "/pages/consultation/chat"
|
});
|
};
|
const analyzeRecord = (record) => {
|
common_vendor.index.navigateTo({
|
url: "/pages/consultation/ai",
|
success: (res) => {
|
var _a;
|
const message = `请分析以下病历:
|
医院: ${record.hospital}
|
科室: ${record.department}
|
诊断: ${record.diagnosis}`;
|
if ((_a = res.eventChannel) == null ? void 0 : _a.emit) {
|
res.eventChannel.emit("initMessage", { message });
|
}
|
}
|
});
|
};
|
const analyzeReport = (report) => {
|
common_vendor.index.navigateTo({
|
url: "/pages/consultation/ai",
|
success: (res) => {
|
var _a;
|
const message = `请分析以下检查报告:
|
检查项目: ${report.name}
|
检查时间: ${report.time}
|
检查结果: ${report.status}`;
|
if ((_a = res.eventChannel) == null ? void 0 : _a.emit) {
|
res.eventChannel.emit("initMessage", { message });
|
}
|
}
|
});
|
};
|
return (_ctx, _cache) => {
|
return {
|
a: userInfo.value.avatar,
|
b: common_vendor.t(userInfo.value.name),
|
c: common_assets._imports_0$13,
|
d: common_vendor.o(goAIConsult),
|
e: common_assets._imports_1$2,
|
f: common_vendor.o(goDoctorConsult),
|
g: common_vendor.o((...args) => _ctx.viewAllRecords && _ctx.viewAllRecords(...args)),
|
h: common_vendor.f(records.value, (record, index, i0) => {
|
return {
|
a: common_vendor.o(($event) => analyzeRecord(record), index),
|
b: common_vendor.t(record.date),
|
c: common_vendor.t(record.hospital),
|
d: common_vendor.t(record.department),
|
e: common_vendor.t(record.diagnosis),
|
f: index,
|
g: common_vendor.o(($event) => _ctx.selectRecord(record), index)
|
};
|
}),
|
i: common_vendor.o((...args) => _ctx.viewAllReports && _ctx.viewAllReports(...args)),
|
j: common_vendor.f(reports.value, (report, index, i0) => {
|
return {
|
a: common_vendor.o(($event) => analyzeReport(report), index),
|
b: report.icon,
|
c: common_vendor.t(report.name),
|
d: common_vendor.t(report.time),
|
e: common_vendor.t(report.statusText),
|
f: common_vendor.n(report.status),
|
g: index,
|
h: common_vendor.o(($event) => _ctx.selectReport(report), index)
|
};
|
}),
|
k: common_vendor.f(symptoms.value, (symptom, index, i0) => {
|
return {
|
a: symptom.icon,
|
b: common_vendor.t(symptom.name),
|
c: index,
|
d: common_vendor.o(($event) => _ctx.consultSymptom(symptom), index)
|
};
|
}),
|
l: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/consultation/index.js.map
|