"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: "expert", setup(__props) { const keyword = common_vendor.ref(""); const currentDepartment = common_vendor.ref(0); const departments = common_vendor.ref([ { id: 0, name: "全部" }, { id: 1, name: "内科" }, { id: 2, name: "外科" }, { id: 3, name: "妇产科" }, { id: 4, name: "儿科" }, { id: 5, name: "中医科" } ]); const experts = common_vendor.ref([ { id: 1, name: "张医生", title: "主任医师", avatar: "/static/doctor/expert1.jpg", hospital: "青岛镜湖医院", tags: ["专家门诊", "视频问诊"], specialty: "冠心病、高血压、心律失常等心血管疾病", schedule: { date: "今天", period: "上午 9:00-11:30", price: 500, available: true } }, { id: 2, name: "李医生", title: "副主任医师", avatar: "/static/doctor/expert2.jpg", hospital: "青岛科大医院", tags: ["专家门诊"], specialty: "糖尿病、内分泌疾病", schedule: { date: "明天", period: "下午 14:00-16:30", price: 300, available: false } } ]); const filter = common_vendor.ref({ title: "", hospital: "", consultType: "", sort: "default" }); const titles = [ { value: "chief", label: "主任医师" }, { value: "deputy", label: "副主任医师" }, { value: "attending", label: "主治医师" } ]; const hospitals = [ { value: "jh", label: "镜湖医院" }, { value: "kd", label: "科大医院" } ]; const consultTypes = [ { value: "expert", label: "专家门诊" }, { value: "video", label: "视频问诊" }, { value: "phone", label: "电话问诊" } ]; const sortOptions = [ { value: "default", label: "综合排序" }, { value: "rating", label: "评分最高" }, { value: "price", label: "价格排序" } ]; const refreshing = common_vendor.ref(false); const loadMoreStatus = common_vendor.ref("more"); const onSearch = (e) => { e.detail.value.trim(); }; const selectDepartment = (department) => { currentDepartment.value = department.id; }; const viewDoctor = (doctor) => { common_vendor.index.navigateTo({ url: `/pages/doctor/detail?id=${doctor.id}` }); }; const filterDrawer = common_vendor.ref(null); const showFilter = () => { filterDrawer.value.open(); }; const resetFilter = () => { filter.value = { title: "", hospital: "", consultType: "", sort: "default" }; }; const selectTitle = (value) => { filter.value.title = value; }; const selectHospital = (value) => { filter.value.hospital = value; }; const selectConsultType = (value) => { filter.value.consultType = 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(departments.value, (item, index, i0) => { return { a: common_vendor.t(item.name), b: index, c: currentDepartment.value === item.id ? 1 : "", d: common_vendor.o(($event) => selectDepartment(item), index) }; }), e: common_vendor.f(experts.value, (item, index, i0) => { return common_vendor.e({ a: item.avatar, b: common_vendor.t(item.name), c: common_vendor.t(item.title), d: common_vendor.f(item.tags, (tag, idx, i1) => { return { a: common_vendor.t(tag), b: idx }; }), e: common_vendor.t(item.hospital), f: common_vendor.t(item.specialty), g: item.schedule }, item.schedule ? { h: common_vendor.t(item.schedule.date), i: common_vendor.t(item.schedule.period), j: common_vendor.t(item.schedule.price), k: common_vendor.t(item.schedule.available ? "可预约" : "约满"), l: !item.schedule.available ? 1 : "" } : {}, { m: index, n: common_vendor.o(($event) => viewDoctor(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(titles, (item, index, i0) => { return { a: common_vendor.t(item.label), b: index, c: filter.value.title === item.value ? 1 : "", d: common_vendor.o(($event) => selectTitle(item.value), index) }; }), l: 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) }; }), m: common_vendor.f(consultTypes, (item, index, i0) => { return { a: common_vendor.t(item.label), b: index, c: filter.value.consultType === item.value ? 1 : "", d: common_vendor.o(($event) => selectConsultType(item.value), index) }; }), n: 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) }; }), o: common_vendor.o(applyFilter), p: common_vendor.sr(filterDrawer, "a3acbd34-1", { "k": "filterDrawer" }), q: common_vendor.p({ mode: "right" }), r: common_vendor.gei(_ctx, "") }; }; } }; wx.createPage(_sfc_main); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/featured/expert.js.map