"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
const _sfc_main = {
|
__name: "detail",
|
setup(__props) {
|
const vaccine = common_vendor.ref({
|
id: 1,
|
nameKey: "vaccine.list.covid.name",
|
fullDescKey: "vaccine.list.covid.fullDesc",
|
suitableKey: "vaccine.list.covid.suitable",
|
noticeKey: "vaccine.list.covid.notice",
|
image: "/static/vaccine/covid.jpg",
|
price: 0,
|
recommended: true
|
});
|
const clinics = common_vendor.ref([
|
{
|
id: 1,
|
name: "青岛镜湖医院预防接种门诊",
|
address: "青岛连胜马路33号",
|
image: "/static/hospital/kiang-wu.jpg",
|
tags: ["全天候接种", "可预约", "免费停车"]
|
},
|
{
|
id: 2,
|
name: "青岛科大医院疫苗中心",
|
address: "青岛氹仔大学大马路",
|
image: "/static/hospital/must.jpg",
|
tags: ["专业团队", "环境舒适", "交通便利"]
|
}
|
]);
|
const selectClinic = (clinic) => {
|
common_vendor.index.navigateTo({
|
url: `/pages/vaccine/book?id=${vaccine.value.id}&clinicId=${clinic.id}`
|
});
|
};
|
const bookVaccine = () => {
|
common_vendor.index.navigateTo({
|
url: `/pages/vaccine/book?id=${vaccine.value.id}`
|
});
|
};
|
common_vendor.onMounted(() => {
|
var _a, _b;
|
const pages = getCurrentPages();
|
const page = pages[pages.length - 1];
|
const vaccineId = (_b = (_a = page.$page) == null ? void 0 : _a.options) == null ? void 0 : _b.id;
|
loadVaccineDetail(vaccineId);
|
});
|
const loadVaccineDetail = (id) => {
|
common_vendor.index.__f__("log", "at pages/vaccine/detail.vue:128", "加载疫苗详情:", id);
|
};
|
return (_ctx, _cache) => {
|
return common_vendor.e({
|
a: vaccine.value.image,
|
b: common_vendor.t(_ctx.$t(vaccine.value.nameKey)),
|
c: vaccine.value.price === 0
|
}, vaccine.value.price === 0 ? {
|
d: common_vendor.t(_ctx.$t("vaccine.tag.free"))
|
} : {}, {
|
e: vaccine.value.recommended
|
}, vaccine.value.recommended ? {
|
f: common_vendor.t(_ctx.$t("vaccine.tag.recommended"))
|
} : {}, {
|
g: vaccine.value.seasonal
|
}, vaccine.value.seasonal ? {
|
h: common_vendor.t(_ctx.$t("vaccine.tag.seasonal"))
|
} : {}, {
|
i: common_vendor.t(_ctx.$t("vaccine.detail.description")),
|
j: common_vendor.t(_ctx.$t(vaccine.value.fullDescKey)),
|
k: common_vendor.t(_ctx.$t("vaccine.detail.suitable")),
|
l: common_vendor.t(_ctx.$t(vaccine.value.suitableKey)),
|
m: common_vendor.t(_ctx.$t("vaccine.detail.notice")),
|
n: common_vendor.t(_ctx.$t(vaccine.value.noticeKey)),
|
o: common_vendor.f(clinics.value, (clinic, index, i0) => {
|
return {
|
a: clinic.image,
|
b: common_vendor.t(clinic.name),
|
c: common_vendor.t(clinic.address),
|
d: common_vendor.f(clinic.tags, (tag, idx, i1) => {
|
return {
|
a: common_vendor.t(tag),
|
b: idx
|
};
|
}),
|
e: index,
|
f: common_vendor.o(($event) => selectClinic(clinic), index)
|
};
|
}),
|
p: common_vendor.t(_ctx.$t("vaccine.detail.price")),
|
q: vaccine.value.price > 0
|
}, vaccine.value.price > 0 ? {
|
r: common_vendor.t(vaccine.value.price)
|
} : {
|
s: common_vendor.t(_ctx.$t("vaccine.free"))
|
}, {
|
t: common_vendor.t(_ctx.$t("vaccine.book")),
|
v: common_vendor.o(bookVaccine),
|
w: common_vendor.gei(_ctx, "")
|
});
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/vaccine/detail.js.map
|