import{_ as e,s,aI as t,A as a,e as i,f as l,h as n,w as d,i as r,o as c,j as o,k as h,t as m,T as u,V as f,W as p,X as k,p as g,a2 as I,a3 as _,a4 as b,m as v,aA as w}from"./index-BiZOcPG_.js";import{_ as C}from"./next-watermark.DOJ_cSSS.js";import{_ as S}from"./uni-search-bar.Dv-vOcpm.js";import{_ as A}from"./head-image.CtNbpm50.js";import"./uni-icons.BKTssli-.js";const x=e({data:()=>({type:null,searchText:"",groupMembers:[],friendItems:[],checkAll:!1,msg:null}),methods:{showFriends(e){var s,t,a;const i=this.searchText.trim();if(!i)return!0;return/^\d+$/.test(i)&&i.length>=4?!!(null==(s=e.phone)?void 0:s.includes(i))||((null==(t=e.phoneShort)?void 0:t.includes(i))??!1):(null==(a=e.nickName)?void 0:a.includes(i))??!1},checkAllFun(){this.friendItems.forEach((e=>{e.checked=!this.checkAll})),this.checkAll=!this.checkAll},onInviteFriends(){let e={sendMethod:this.type,receiveIdList:[],sendContent:this.msg,isAll:this.checkAll?1:0};this.friendItems.forEach((s=>{s.checked&&!s.disabled&&e.receiveIdList.push(s.id)})),e.receiveIdList.length>0&&e.sendContent&&this.$http({url:"/message/sendDx/send",method:"POST",data:e}).then((()=>{s({title:"发送成功！",icon:"none"}),setTimeout((()=>{t()}),1e3)}))},onShowUserInfo(e){a({url:"/pages/common/user-info?id="+e})},onSwitchChecked(e){e.disabled||(e.checked=!e.checked)},loadGroupMembers(e){let s=`/group/members/${e}`;this.$http({url:s,method:"GET"}).then((e=>{this.groupMembers=e.filter((e=>!e.quit)),this.initFriendItems(this.groupMembers)}))},initFriendItems(e){this.friendItems=[],e.forEach((e=>{let s={id:e.userId,headImage:e.headImage,nickName:e.showNickName,phone:e.phone,phoneShort:e.phoneShort,deptName:e.deptName,online:e.online};this.friendItems.push(s)}))}},computed:{inviteSize(){return this.friendItems.filter((e=>!e.disabled&&e.checked)).length}},onLoad(e){this.type=e.type,this.msg=e.msg,this.loadGroupMembers(e.id)}},[["render",function(e,s,t,a,x,N){const y=i(l("next-watermark"),C),F=r,T=i(l("uni-search-bar"),S),j=i(l("head-image"),A),M=v,z=w,E=k,L=g;return c(),n(F,{class:"page group-invite"},{default:d((()=>[o(F,null,{default:d((()=>[o(y,{watermark:String(e.userStore.watermark)},null,8,["watermark"])])),_:1}),o(F,{class:"search-bar"},{default:d((()=>[o(T,{class:"search-box",modelValue:x.searchText,"onUpdate:modelValue":s[0]||(s[0]=e=>x.searchText=e),radius:"100",cancelButton:"none",placeholder:"输入姓名，短号或手机号码"},null,8,["modelValue"]),o(F,{class:"check-all",onClick:N.checkAllFun},{default:d((()=>[h(m(x.checkAll?"全不选":"全选"),1)])),_:1},8,["onClick"])])),_:1}),o(F,{class:"friend-items"},{default:d((()=>[o(E,{class:"scroll-bar","scroll-with-animation":"true","scroll-y":"true"},{default:d((()=>[(c(!0),u(p,null,f(x.friendItems,(e=>I((c(),n(F,{key:e.id},{default:d((()=>[o(F,{class:"friend-item",onClick:s=>N.onSwitchChecked(e)},{default:d((()=>[o(j,{name:e.nickName,online:e.online,url:e.headImage,size:100},null,8,["name","online","url"]),o(F,{class:"friend-item-right"},{default:d((()=>[o(F,{class:"friend-name"},{default:d((()=>[o(M,null,{default:d((()=>[h(m(e.nickName),1)])),_:2},1024)])),_:2},1024),o(F,{class:"dept-name"},{default:d((()=>[h(m(e.deptName),1)])),_:2},1024)])),_:2},1024),o(F,{class:"friend-checked"},{default:d((()=>[o(z,{checked:e.checked,disabled:e.disabled,onClick:_((s=>N.onSwitchChecked(e)),["stop"])},null,8,["checked","disabled","onClick"])])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)),[[b,N.showFriends(e)]]))),128))])),_:1})])),_:1}),o(F,null,{default:d((()=>[o(L,{type:"primary",disabled:0==N.inviteSize,onClick:s[1]||(s[1]=e=>N.onInviteFriends())},{default:d((()=>[h(" 发送("+m(N.inviteSize)+") ",1)])),_:1},8,["disabled"])])),_:1})])),_:1})}],["__scopeId","data-v-1434f319"]]);export{x as default};
