"use strict";
|
const common_vendor = require("../../common/vendor.js");
|
if (!Array) {
|
const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
|
const _easycom_uni_drawer2 = common_vendor.resolveComponent("uni-drawer");
|
(_easycom_uni_load_more2 + _easycom_uni_drawer2)();
|
}
|
const _easycom_uni_load_more = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more.js";
|
const _easycom_uni_drawer = () => "../../node-modules/@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.js";
|
if (!Math) {
|
(_easycom_uni_load_more + _easycom_uni_drawer)();
|
}
|
const _sfc_main = {
|
__name: "all",
|
setup(__props) {
|
const keyword = common_vendor.ref("");
|
const currentCategory = common_vendor.ref(0);
|
const categories = common_vendor.ref([
|
{ id: 0, name: "全部" },
|
{ id: 1, name: "中医特色" },
|
{ id: 2, name: "跨境医疗" },
|
{ id: 3, name: "专家门诊" },
|
{ id: 4, name: "特色科室" }
|
]);
|
const featuredList = common_vendor.ref([
|
{
|
id: 1,
|
name: "中医特色诊疗",
|
desc: "传承千年中医精华,守护您的健康",
|
image: "/static/featured/tcm.jpg",
|
tags: ["针灸推拿", "中药调理", "艾灸养生"],
|
doctors: 20,
|
cases: 1e3,
|
rating: 4.9
|
},
|
{
|
id: 2,
|
name: "跨境医疗服务",
|
desc: "连接全球优质医疗资源",
|
image: "/static/featured/cross-border.jpg",
|
tags: ["专家会诊", "转诊服务", "康复护理"],
|
doctors: 30,
|
cases: 500,
|
rating: 4.8
|
},
|
{
|
id: 3,
|
name: "专家门诊",
|
desc: "汇聚顶尖医疗专家",
|
image: "/static/featured/expert.jpg",
|
tags: ["名医问诊", "远程会诊", "特需门诊"],
|
doctors: 50,
|
cases: 2e3,
|
rating: 4.9
|
}
|
]);
|
const filter = common_vendor.ref({
|
hospital: "",
|
priceRange: "",
|
sort: "default"
|
});
|
const hospitals = [
|
{ value: "jh", label: "镜湖医院" },
|
{ value: "kd", label: "科大医院" }
|
];
|
const priceRanges = [
|
{ value: "0-500", label: "500以下" },
|
{ value: "500-1000", label: "500-1000" },
|
{ value: "1000-2000", label: "1000-2000" },
|
{ value: "2000+", label: "2000以上" }
|
];
|
const sortOptions = [
|
{ value: "default", label: "综合排序" },
|
{ value: "rating", label: "评分最高" },
|
{ value: "cases", label: "案例最多" }
|
];
|
const refreshing = common_vendor.ref(false);
|
const loadMoreStatus = common_vendor.ref("more");
|
const onSearch = (e) => {
|
e.detail.value.trim();
|
};
|
const selectCategory = (category) => {
|
currentCategory.value = category.id;
|
};
|
const viewDetail = (item) => {
|
const routes = {
|
1: "/pages/featured/tcm",
|
2: "/pages/featured/cross-border",
|
3: "/pages/featured/expert"
|
};
|
common_vendor.index.navigateTo({
|
url: routes[item.id] || "/pages/featured/project"
|
});
|
};
|
const filterDrawer = common_vendor.ref(null);
|
const showFilter = () => {
|
filterDrawer.value.open();
|
};
|
const resetFilter = () => {
|
filter.value = {
|
hospital: "",
|
priceRange: "",
|
sort: "default"
|
};
|
};
|
const selectHospital = (value) => {
|
filter.value.hospital = value;
|
};
|
const selectPriceRange = (value) => {
|
filter.value.priceRange = value;
|
};
|
const selectSort = (value) => {
|
filter.value.sort = value;
|
};
|
const applyFilter = () => {
|
filterDrawer.value.close();
|
};
|
const onRefresh = () => {
|
setTimeout(() => {
|
refreshing.value = false;
|
}, 1e3);
|
};
|
const loadMore = () => {
|
if (loadMoreStatus.value !== "more")
|
return;
|
loadMoreStatus.value = "loading";
|
setTimeout(() => {
|
loadMoreStatus.value = "noMore";
|
}, 1e3);
|
};
|
return (_ctx, _cache) => {
|
return {
|
a: common_vendor.o([($event) => keyword.value = $event.detail.value, onSearch]),
|
b: keyword.value,
|
c: common_vendor.o(showFilter),
|
d: common_vendor.f(categories.value, (item, index, i0) => {
|
return {
|
a: common_vendor.t(item.name),
|
b: index,
|
c: currentCategory.value === item.id ? 1 : "",
|
d: common_vendor.o(($event) => selectCategory(item), index)
|
};
|
}),
|
e: common_vendor.f(featuredList.value, (item, index, i0) => {
|
return {
|
a: item.image,
|
b: common_vendor.t(item.name),
|
c: common_vendor.t(item.desc),
|
d: common_vendor.f(item.tags, (tag, idx, i1) => {
|
return {
|
a: common_vendor.t(tag),
|
b: idx
|
};
|
}),
|
e: common_vendor.t(item.doctors),
|
f: common_vendor.t(item.cases),
|
g: common_vendor.t(item.rating),
|
h: index,
|
i: common_vendor.o(($event) => viewDetail(item), index)
|
};
|
}),
|
f: common_vendor.p({
|
status: loadMoreStatus.value,
|
["content-text"]: {
|
contentdown: "上拉加载更多",
|
contentrefresh: "加载中...",
|
contentnomore: "没有更多了"
|
}
|
}),
|
g: refreshing.value,
|
h: common_vendor.o(onRefresh),
|
i: common_vendor.o(loadMore),
|
j: common_vendor.o(resetFilter),
|
k: common_vendor.f(hospitals, (item, index, i0) => {
|
return {
|
a: common_vendor.t(item.label),
|
b: index,
|
c: filter.value.hospital === item.value ? 1 : "",
|
d: common_vendor.o(($event) => selectHospital(item.value), index)
|
};
|
}),
|
l: common_vendor.f(priceRanges, (item, index, i0) => {
|
return {
|
a: common_vendor.t(item.label),
|
b: index,
|
c: filter.value.priceRange === item.value ? 1 : "",
|
d: common_vendor.o(($event) => selectPriceRange(item.value), index)
|
};
|
}),
|
m: common_vendor.f(sortOptions, (item, index, i0) => {
|
return {
|
a: common_vendor.t(item.label),
|
b: index,
|
c: filter.value.sort === item.value ? 1 : "",
|
d: common_vendor.o(($event) => selectSort(item.value), index)
|
};
|
}),
|
n: common_vendor.o(applyFilter),
|
o: common_vendor.sr(filterDrawer, "04e5d095-1", {
|
"k": "filterDrawer"
|
}),
|
p: common_vendor.p({
|
mode: "right"
|
}),
|
q: common_vendor.gei(_ctx, "")
|
};
|
};
|
}
|
};
|
wx.createPage(_sfc_main);
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/featured/all.js.map
|