import{_ as e,b as s,aI as t,z as a,d as i,e as l,f as n,w as d,i as r,o as c,h as o,j as h,t as m,S as u,T as f,V as p,W as k,m as g,a1 as I,a2 as _,a3 as b,l as v,aB as w}from"./index-CxGmch-J.js";import{_ as S}from"./next-watermark.B0wpWeDX.js";import{_ as C}from"./uni-search-bar.PMtMroqB.js";import{_ as x}from"./head-image.DN8AEIH3.js";import"./uni-icons.C7m4sqJM.js";const A=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,A,N){const y=i(l("next-watermark"),S),F=r,T=i(l("uni-search-bar"),C),j=i(l("head-image"),x),z=v,M=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:A.searchText,"onUpdate:modelValue":s[0]||(s[0]=e=>A.searchText=e),radius:"100",cancelButton:"none",placeholder:"输入姓名，短号或手机号码"},null,8,["modelValue"]),o(F,{class:"check-all",onClick:N.checkAllFun},{default:d((()=>[h(m(A.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(A.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(z,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(M,{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{A as default};
