1 |
- import{_ as a,A as t,q as s,o as e,c as l,w as c,f as o,v as u,d as n,t as i,b as d,a as r,r as p,F as h,e as y,x as g,i as m,a4 as f}from"./index-01d5b8eb.js";const _=a({name:"search",data:()=>({title:"搜索聊天",keywords:"",allContacts:[],contacts:[],groupList:[],type:1}),watch:{keywords(a){this.search()}},onLoad(a){this.type=a.type,2==this.type?this.title="搜索联系人":3==this.type?this.title="搜索群聊":this.title="搜索聊天"},mounted(){this.allContacts=t("allContacts")},methods:{search(){const a=this.$util.searchObject(this.allContacts,["displayName","name_py","account"],this.keywords),t=[],s=[];a.forEach((a=>{1==a.is_group?s.push(a):t.push(a)})),this.groupList=s,this.contacts=t},openDetails(a){2==this.type&&0==a.is_gourp&&s({url:"/pages/contacts/detail?id="+a.id}),s({url:"/pages/message/chat?id="+a.id})}}},[["render",function(a,t,s,_,k,x){const C=g("cu-custom"),b=m,w=f,v=o,L=g("Empty");return e(),l(v,null,{default:c((()=>[u(C,{bgColor:"bg-gradual-green",isBack:!0},{backText:c((()=>[])),content:c((()=>[n(i(k.title),1)])),_:1}),u(v,{class:"cu-bar bg-white search fixed",style:d([{top:a.CustomBar+"px"}])},{default:c((()=>[u(v,{class:"search-form round"},{default:c((()=>[u(b,{class:"cuIcon-search"}),u(w,{type:"text",modelValue:k.keywords,"onUpdate:modelValue":t[0]||(t[0]=a=>k.keywords=a),placeholder:"输入搜索的关键词","confirm-type":"search"},null,8,["modelValue"])])),_:1})])),_:1},8,["style"]),u(v,{style:{"margin-top":"120rpx"}},{default:c((()=>[k.type<3&&k.contacts.length>0?(e(),l(v,{key:0},{default:c((()=>[u(v,{class:"padding"},{default:c((()=>[n("联系人")])),_:1}),u(v,{class:"cu-list menu-avatar no-padding"},{default:c((()=>[(e(!0),r(h,null,p(k.contacts,((a,t)=>(e(),l(v,{class:"cu-item",key:t,onClick:t=>x.openDetails(a)},{default:c((()=>[u(v,{class:"cu-avatar lg radius mr-15",style:d([{backgroundImage:"url("+a.avatar+")"}])},null,8,["style"]),u(v,{class:"content"},{default:c((()=>[u(v,{class:"c-333"},{default:c((()=>[n(i(a.displayName),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})):y("",!0),k.groupList.length>0?(e(),l(v,{key:1},{default:c((()=>[u(v,{class:"padding"},{default:c((()=>[n("群聊")])),_:1}),u(v,{class:"cu-list menu-avatar no-padding"},{default:c((()=>[(e(!0),r(h,null,p(k.groupList,((a,t)=>(e(),l(v,{class:"cu-item",key:t,onClick:t=>x.openDetails(a)},{default:c((()=>[u(v,{class:"cu-avatar lg radius mr-15",style:d([{backgroundImage:"url("+a.avatar+")"}])},null,8,["style"]),u(v,{class:"content"},{default:c((()=>[u(v,{class:"c-333"},{default:c((()=>[n(i(a.displayName),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})):y("",!0),k.groupList.length||k.contacts.length?y("",!0):(e(),l(v,{key:2},{default:c((()=>[u(L,{noDatatext:"暂无数据",textcolor:"#999"})])),_:1}))])),_:1})])),_:1})}]]);export{_ as default};
|