WXL
15 小时以前 05c363fdd7ab04e3bd9a753e2c5d5bfff04d681c
1
"use strict";const e=require("../../common/vendor.js"),a={__name:"search",setup(a){const t=e.ref(""),o=e.ref(!1),l=e.ref(["心内科","发烧","骨科","儿科"]),i=["心内科","儿科","发烧","骨科","高血压","糖尿病","感冒","头痛"],n=e.computed(()=>t.value?[t.value+"科","儿童"+t.value,t.value+"专科",t.value+"疾病"]:[]),u=[{value:"department",count:5},{value:"doctor",count:8},{value:"disease",count:3}],r=e.ref("department"),d=e.ref([{id:1,name:"心内科",icon:"/static/department/cardiology.png",description:"心血管疾病诊治",rating:4.9,doctorCount:8,hospitalId:1,hospitalName:"青岛镜湖医院",hospitalLogo:"/static/hospital/kiang-wu.jpg",distance:2.5},{id:2,name:"心内科",icon:"/static/department/cardiology.png",description:"心血管疾病诊治",rating:4.8,doctorCount:6,hospitalId:2,hospitalName:"青岛科大医院",hospitalLogo:"/static/hospital/must.jpg",distance:5.8}]),c=e.ref([{id:1,name:"张医生",title:"主任医师",avatar:"/static/doctor/doctor1.jpg",department:"心内科",specialty:"冠心病、心律失常",rating:4.9,ratingCount:1280}]),v=e.ref([{id:1,name:"冠心病",description:"心脏冠状动脉血管发生动脉粥样硬化病变而引起的心脏病",departments:["心内科","心外科"]}]),s=()=>{t.value="",o.value=!1},p=()=>{e.index.navigateBack()},m=()=>{e.index.showModal({title:"提示",content:"确定要清空搜索历史吗?",success:e=>{e.confirm&&(l.value=[])}})},g=()=>{t.value.trim()&&(l.value.includes(t.value)||(l.value.unshift(t.value),l.value.length>10&&l.value.pop()),o.value=!0)};return(a,h)=>e.e({a:a.$t("common.search.placeholder"),b:e.o(g),c:t.value,d:e.o(e=>t.value=e.detail.value),e:t.value},t.value?{f:e.o(s)}:{},{g:e.t(a.$t("common.search.cancel")),h:e.o(p),i:!t.value&&l.value.length},!t.value&&l.value.length?{j:e.t(a.$t("common.search.history")),k:e.t(a.$t("common.search.clear")),l:e.o(m),m:e.f(l.value,(a,o,i)=>({a:e.t(a),b:e.o(e=>(e=>{l.value.splice(e,1)})(o),o),c:o,d:e.o(e=>{return o=a,t.value=o,void g();var o},o)}))}:{},{n:!t.value},t.value?{}:{o:e.t(a.$t("common.search.hot")),p:e.f(i,(a,o,l)=>({a:e.t(a),b:o,c:e.o(e=>{return o=a,t.value=o,void g();var o},o),d:o<3?1:""}))},{q:t.value&&!o.value},t.value&&!o.value?{r:e.f(n.value,(a,o,l)=>({a:e.t(a),b:o,c:e.o(e=>{return o=a,t.value=o,void g();var o},o)}))}:{},{s:o.value},o.value?e.e({t:e.f(u,(t,o,l)=>({a:e.t(a.$t(`department.search.tabs.${t.value}`)),b:e.t(t.count),c:o,d:r.value===t.value?1:"",e:e.o(e=>(e=>{r.value=e})(t.value),o)})),v:"department"===r.value},"department"===r.value?{w:e.f(d.value,(a,t,o)=>({a:a.hospitalLogo,b:e.t(a.hospitalName),c:a.icon,d:e.t(a.name),e:e.t(a.description),f:e.t(a.distance),g:e.t(a.rating),h:e.t(a.doctorCount),i:t,j:e.o(t=>(a=>{e.index.navigateTo({url:`/pages/department/detail?id=${a.id}&hospitalId=${a.hospitalId}`})})(a),t)}))}:{},{x:"doctor"===r.value},"doctor"===r.value?{y:e.f(c.value,(a,t,o)=>({a:a.avatar,b:e.t(a.name),c:e.t(a.title),d:e.t(a.department),e:e.t(a.specialty),f:e.t(a.rating),g:e.t(a.ratingCount),h:t,i:e.o(t=>(a=>{e.index.navigateTo({url:`/pages/appointment/doctor?doctorId=${a.id}`})})(a),t)}))}:{},{z:"disease"===r.value},"disease"===r.value?{A:e.f(v.value,(a,t,o)=>({a:e.t(a.name),b:e.t(a.description),c:e.f(a.departments,(a,t,o)=>({a:e.t(a),b:t})),d:t,e:e.o(t=>(a=>{e.index.navigateTo({url:`/pages/disease/detail?id=${a.id}`})})(a),t)}))}:{}):{},{B:e.gei(a,"")})}};wx.createPage(a);