import{_ as e,z as t,as as o,a as r,d as s,e as a,f as u,w as i,k as l,i as n,o as p,h as d,R as h,S as m,T as g,j as c,t as f,a0 as _,a2 as I,l as b,m as w}from"./index-D1_eyi4k.js";import{_ as k}from"./next-watermark.C2zULsYF.js";import{_ as S}from"./head-image.BSShoiS5.js";import{_ as G}from"./uni-icons.DFs-W6zX.js";import{_ as x,a as y}from"./uni-notice-bar.CgGpkU4u.js";const M=e({data:()=>({groupId:null,group:{},groupMembers:[]}),methods:{onFocusSearch(){},onInviteMember(){t({url:`/pages/group/group-invite?id=${this.groupId}`})},onShowMoreMmeber(){t({url:`/pages/group/group-member?id=${this.groupId}`})},onEditGroup(){t({url:`/pages/group/group-edit?id=${this.groupId}`})},onSendMessage(){let e={type:"GROUP",targetId:this.group.id,showName:this.group.showGroupName,headImage:this.group.headImage};this.chatStore.openChat(e);let o=this.chatStore.findChatIdx(e);t({url:"/pages/chat/chat-box?chatIdx="+o})},onQuitGroup(){o({title:"确认退出?",content:"退出群聊后将不再接受群里的消息，确认退出吗?",success:e=>{e.cancel||this.$http({url:`/group/quit/${this.groupId}`,method:"DELETE"}).then((()=>{o({title:"退出成功",content:`您已退出群聊'${this.group.name}'`,showCancel:!1,success:()=>{setTimeout((()=>{r({url:"/pages/group/group"}),this.groupStore.removeGroup(this.groupId),this.chatStore.removeGroupChat(this.groupId)}),100)}})}))}})},onDissolveGroup(){o({title:"确认解散?",content:`确认要解散群聊'${this.group.name}'吗?`,success:e=>{e.cancel||this.$http({url:`/group/delete/${this.groupId}`,method:"delete"}).then((()=>{o({title:"解散成功",content:`群聊'${this.group.name}'已解散`,showCancel:!1,success:()=>{setTimeout((()=>{r({url:"/pages/group/group"}),this.groupStore.removeGroup(this.groupId),this.chatStore.removeGroupChat(this.groupId)}),100)}})}))}})},loadGroupInfo(){this.$http({url:`/group/find/${this.groupId}`,method:"GET"}).then((e=>{this.group=e,this.chatStore.updateChatFromGroup(e),this.groupStore.updateGroup(e)}))},loadGroupMembers(){console.log("loadGroupMembers"),this.$http({url:`/group/members/${this.groupId}`,method:"GET"}).then((e=>{this.groupMembers=e.filter((e=>!e.quit))}))}},computed:{ownerName(){let e=this.groupMembers.find((e=>e.userId==this.group.ownerId));return e&&e.showNickName},isOwner(){return this.group.ownerId==this.userStore.userInfo.id}},onLoad(e){this.groupId=e.id,this.loadGroupInfo(e.id),this.loadGroupMembers(e.id)}},[["render",function(e,t,o,r,M,$){const C=s(a("next-watermark"),k),N=n,v=s(a("head-image"),S),z=b,E=s(a("uni-icons"),G),F=s(a("uni-section"),x),j=s(a("uni-notice-bar"),y),T=w;return 1==e.userStore.userInfo.type?(p(),u(N,{key:0,class:"page group-info"},{default:i((()=>[d(N,null,{default:i((()=>[d(C,{watermark:String(e.userStore.watermark)},null,8,["watermark"])])),_:1}),M.group.quit?l("",!0):(p(),u(N,{key:0,class:"group-members"},{default:i((()=>[d(N,{class:"member-items"},{default:i((()=>[(p(!0),h(g,null,m(M.groupMembers,((e,t)=>(p(),u(N,{key:t},{default:i((()=>[t<9?(p(),u(N,{key:0,class:"member-item"},{default:i((()=>[d(v,{id:e.userId,name:e.showNickName,url:e.headImage,size:100,online:e.online},null,8,["id","name","url","online"]),d(N,{class:"member-name"},{default:i((()=>[d(z,null,{default:i((()=>[c(f(e.showNickName),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)):l("",!0)])),_:2},1024)))),128)),d(N,{class:"invite-btn",onClick:t[0]||(t[0]=e=>$.onInviteMember())},{default:i((()=>[d(E,{type:"plusempty",size:"28",color:"#888888"})])),_:1})])),_:1}),d(N,{class:"member-more",onClick:t[1]||(t[1]=e=>$.onShowMoreMmeber())},{default:i((()=>[c(f(`查看全部群成员${M.groupMembers.length}人`)+">",1)])),_:1})])),_:1})),d(N,{class:"group-detail"},{default:i((()=>[d(F,{title:"群聊名称:",titleFontSize:"14px"},{right:i((()=>[d(z,{class:"detail-text"},{default:i((()=>[c(f(M.group.name),1)])),_:1})])),_:1}),d(F,{title:"群主:",titleFontSize:"14px"},{right:i((()=>[d(z,{class:"detail-text"},{default:i((()=>[c(f($.ownerName),1)])),_:1})])),_:1}),d(F,{title:"群名备注:",titleFontSize:"14px"},{right:i((()=>[d(z,{class:"detail-text"},{default:i((()=>[c(f(M.group.remarkGroupName),1)])),_:1})])),_:1}),d(F,{title:"我在本群的昵称:",titleFontSize:"14px"},{right:i((()=>[d(z,{class:"detail-text"},{default:i((()=>[c(f(M.group.showNickName),1)])),_:1})])),_:1}),M.group.notice?(p(),u(F,{key:0,title:"群公告:",titleFontSize:"14px"},{default:i((()=>[d(j,{text:M.group.notice},null,8,["text"])])),_:1})):l("",!0),M.group.quit?l("",!0):(p(),u(N,{key:1,class:"group-edit",onClick:t[2]||(t[2]=e=>$.onEditGroup())},{default:i((()=>[c("修改群聊资料 > ")])),_:1}))])),_:1}),M.group.quit?l("",!0):(p(),u(N,{key:1,class:"btn-group"},{default:i((()=>[d(T,{class:"btn",type:"primary",onClick:t[3]||(t[3]=e=>$.onSendMessage())},{default:i((()=>[c("发消息")])),_:1}),_(d(T,{class:"btn",type:"warn",onClick:t[4]||(t[4]=e=>$.onQuitGroup())},{default:i((()=>[c("退出群聊")])),_:1},512),[[I,!$.isOwner]]),_(d(T,{class:"btn",type:"warn",onClick:t[5]||(t[5]=e=>$.onDissolveGroup())},{default:i((()=>[c("解散群聊")])),_:1},512),[[I,$.isOwner]])])),_:1}))])),_:1})):l("",!0)}],["__scopeId","data-v-74562536"]]);export{M as default};
