import{_ as e,B as s,a as r,s as a,aG as o,f as t,h as i,i as u,w as l,j as n,o as m,k as c,V as d,W as h,X as p,Y as f,a3 as g,l as k,t as b,m as w,a4 as I,a5 as _,q as y}from"./index-mnxZbLx5.js";import{_ as x}from"./next-watermark.B6CAgmmH.js";import{_ as M}from"./uni-search-bar.BXM-nqpH.js";import{_ as $}from"./head-image.BknvLL5Z.js";import{_ as N}from"./uni-tag.D55utB6z.js";import"./uni-icons.DUOKuwLq.js";const S=e({data:()=>({isModify:!1,searchText:"",group:{},groupMembers:[],source:""}),methods:{onShowUserInfo(e){s({url:"/pages/common/user-info?id="+e})},onKickOut(e,s){r({title:"确认移出?",content:`确定将成员'${e.showNickName}'移出群聊吗？`,success:r=>{r.cancel||this.$http({url:`/group/kick/${this.group.id}?userId=${e.userId}`,method:"DELETE"}).then((()=>{a({title:`已将${e.showNickName}移出群聊`,icon:"none"}),this.groupMembers.splice(s,1),this.isModify=!0}))}})},loadGroupInfo(e){this.$http({url:`/group/find/${e}`,method:"GET"}).then((e=>{this.group=e}))},loadGroupMembers(e){let s,r;"synergy"===this.source?(s=`/group/selGroupMember?groupId=${e}`,r="POST"):(s=`/group/members/${e}`,r="GET"),this.$http({url:s,method:r}).then((e=>{this.groupMembers=e.filter((e=>!e.quit))}))},isSelf(e){return this.userStore.userInfo.id==e}},computed:{isOwner(){return this.userStore.userInfo.id==this.group.ownerId}},onLoad(e){e.source&&(this.source=e.source),this.loadGroupInfo(e.id),this.loadGroupMembers(e.id)},onUnload(){if(this.isModify){let e=o();e[e.length-2].$vm.loadGroupMembers()}}},[["render",function(e,s,r,a,o,S){const G=t(i("next-watermark"),x),T=n,j=t(i("uni-search-bar"),M),E=t(i("head-image"),$),z=t(i("uni-tag"),N),C=y,O=f;return m(),u(T,{class:"page group-member"},{default:l((()=>[c(T,null,{default:l((()=>[c(G,{watermark:String(e.userStore.watermark)},null,8,["watermark"])])),_:1}),c(T,{class:"search-bar"},{default:l((()=>[c(j,{modelValue:o.searchText,"onUpdate:modelValue":s[0]||(s[0]=e=>o.searchText=e),radius:"100",cancelButton:"none",placeholder:"输入昵称搜索"},null,8,["modelValue"])])),_:1}),c(T,{class:"member-items"},{default:l((()=>[c(O,{class:"scroll-bar","scroll-with-animation":"true","scroll-y":"true"},{default:l((()=>[(m(!0),d(p,null,h(o.groupMembers,((s,r)=>g((m(),u(T,{key:r},{default:l((()=>[c(T,{class:"member-item",onClick:e=>S.onShowUserInfo(s.userId)},{default:l((()=>[c(E,{name:s.showNickName,online:s.online,url:s.headImage,size:100},null,8,["name","online","url"]),c(T,{class:"member-name"},{default:l((()=>[k(b(s.showNickName)+" ",1),s.userId==o.group.ownerId?(m(),u(z,{key:0,text:"群主",size:"small",circle:"","custom-style":"background-color: #e30a0a;"})):w("",!0),s.userId==e.userStore.userInfo.id?(m(),u(z,{key:1,text:"我",size:"small",circle:""})):w("",!0)])),_:2},1024),g(c(T,{class:"member-kick"},{default:l((()=>[g(c(C,{type:"warn",plain:"",size:"mini",onClick:I((e=>S.onKickOut(s,r)),["stop"])},{default:l((()=>[k("移出群聊")])),_:2},1032,["onClick"]),[[_,S.isOwner&&!S.isSelf(s.userId)]])])),_:2},1536),[[_,"synergy"!==o.source]])])),_:2},1032,["onClick"])])),_:2},1024)),[[_,!o.searchText||s.showNickName.includes(o.searchText)]]))),128))])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-91a89aa7"]]);export{S as default};
