import{_ as e,u as t,s as a,h as l,q as s,ad as i,H as n,l as d,a8 as c,o,c as u,w as r,f,v as g,d as m,b as _,t as b,e as h,a as x,F as k,n as p,x as y,i as C,B as I}from"./index-01d5b8eb.js";const N=t(a),v=l(a);const w=e({data:()=>({modelName:"",detail:{},userInfo:v.userInfo,globalConfig:v.globalConfig}),computed:{validatePhone(){return/^1[3456789]\d{9}$/.test(this.detail.account)}},onLoad(e){this.$api.msgApi.getUserInfo({user_id:e.id}).then((e=>{0==e.code&&(this.detail=e.data)}))},methods:{sendMsg(e){s({url:"/pages/message/chat?id="+e.user_id})},sex:e=>["女","男","未知"][e]||"未知",callPhone(){i({phoneNumber:this.detail.account})},calling(e){if(N.webrtcLock)return n({title:"其他终端正在通话中",icon:"none"});this.modelName="";let t=this.$util.getUuid();s({url:"/pages/message/call?msg_id="+t+"&type="+e+"&status=1&id="+this.detail.user_id+"&name="+this.detail.realname+"&avatar="+encodeURI(this.detail.avatar)})},delFriend(){d({title:"确定要删除该好友吗?",success:e=>{if(e.confirm){let e={id:this.detail.user_id};this.$api.friendApi.delFriend(e).then((t=>{0==t.code&&(N.deleteContacts(e),c({url:"/pages/index/index"}))}))}}})},addFriend(){d({title:"请输入验证信息",editable:!0,success:e=>{if(e.confirm){if(""==e.content)return n({title:"请输入备注!",icon:"error"});this.$api.friendApi.addFriend({user_id:this.detail.user_id,remark:e.content}).then((e=>{0==e.code&&n({title:e.msg,icon:"none"})}))}}})},setNickname(){let e=this.detail.friend.friend_id??"";if(!this.detail.friend)return n({title:"无法设置",icon:"error"});d({title:"请输入备注信息",editable:!0,success:t=>{if(t.confirm){if(""==t.content)return n({title:"请输入好友备注!",icon:"error"});this.$api.friendApi.setNickname({friend_id:e,nickname:t.content}).then((e=>{0==e.code&&(this.detail.friend.nickname=t.content,N.updateContacts({id:this.detaild.user_id,displayName:t.content}),n({title:e.msg,icon:"none"}))}))}}})}}},[["render",function(e,t,a,l,s,i){const n=y("cu-custom"),d=f,c=C,N=I;return o(),u(d,null,{default:r((()=>[g(n,{bgColor:"bg-white",isBack:!0},{backText:r((()=>[])),content:r((()=>[m("个人信息")])),_:1}),g(d,{class:"padding flex justify-start align-center"},{default:r((()=>[g(d,{class:"cu-avatar lg radius mr-15",style:_("background-image:url("+s.detail.avatar+")")},null,8,["style"]),g(d,{class:"im-flex im-justify-content-start im-columns"},{default:r((()=>[g(d,{class:"mb-5"},{default:r((()=>[m(b(s.detail.realname),1)])),_:1}),g(d,{class:"text-gray"},{default:r((()=>[m(b(s.detail.account),1)])),_:1})])),_:1})])),_:1}),g(d,{class:"cu-list menu"},{default:r((()=>[2==s.globalConfig.sysInfo.runMode&&s.detail.friend&&s.userInfo.user_id!=s.detail.user_id?(o(),u(d,{key:0,class:"cu-item",onClick:i.setNickname},{default:r((()=>[g(d,{class:"content"},{default:r((()=>[g(c,{class:"cuIcon-edit text-green"}),g(c,null,{default:r((()=>[m("备注")])),_:1})])),_:1}),g(d,{class:"action"},{default:r((()=>[g(c,{class:"text-grey text-sm"},{default:r((()=>[m(b(s.detail.friend.nickname||"未设置"),1)])),_:1}),g(c,{class:"text-grey text-sm ml-5 cuIcon-write"})])),_:1})])),_:1},8,["onClick"])):h("",!0),g(d,{class:"cu-item"},{default:r((()=>[g(d,{class:"content"},{default:r((()=>[g(c,{class:"cuIcon-mail text-green"}),g(c,null,{default:r((()=>[m("邮箱")])),_:1})])),_:1}),g(d,{class:"action"},{default:r((()=>[g(c,{class:"text-grey text-sm"},{default:r((()=>[m(b(s.detail.email??"raingad@foxmail.com"),1)])),_:1})])),_:1})])),_:1}),g(d,{class:"cu-item"},{default:r((()=>[g(d,{class:"content"},{default:r((()=>[g(c,{class:"cuIcon-safe text-green"}),g(c,null,{default:r((()=>[m("性别")])),_:1})])),_:1}),g(d,{class:"action"},{default:r((()=>[g(c,{class:"text-grey text-sm"},{default:r((()=>[m(b(i.sex(s.detail.sex)),1)])),_:1})])),_:1})])),_:1}),parseInt(s.globalConfig.sysInfo.ipregion)?(o(),u(d,{key:1,class:"cu-item"},{default:r((()=>[g(d,{class:"content"},{default:r((()=>[g(c,{class:"cuIcon-location text-green"}),g(c,null,{default:r((()=>[m("IP")])),_:1})])),_:1}),g(d,{class:"action"},{default:r((()=>[s.detail.last_login_ip?(o(),u(c,{key:0,class:"text-grey text-sm"},{default:r((()=>[m(b(s.detail.last_login_ip||"未知")+" ("+b(s.detail.location||"未知")+")",1)])),_:1})):(o(),u(c,{key:1,class:"text-grey text-sm"},{default:r((()=>[m("未知")])),_:1}))])),_:1})])),_:1})):h("",!0)])),_:1}),s.userInfo.user_id!=s.detail.user_id?(o(),x(k,{key:0},[1==s.globalConfig.sysInfo.runMode||s.detail.friend?(o(),u(d,{key:0,class:"padding flex flex-direction"},{default:r((()=>[g(N,{class:"cu-btn bg-green mt-10 lg",onClick:t[0]||(t[0]=e=>i.sendMsg(s.detail))},{default:r((()=>[m("发消息")])),_:1}),i.validatePhone?(o(),u(N,{key:0,class:"cu-btn bg-blue mt-10 lg",onClick:t[1]||(t[1]=e=>i.callPhone())},{default:r((()=>[m("打电话")])),_:1})):h("",!0),parseInt(s.globalConfig.chatInfo.webrtc)?(o(),u(N,{key:1,class:"cu-btn bg-grey mt-10 lg",onClick:t[2]||(t[2]=e=>s.modelName="callRtc")},{default:r((()=>[m("音视频通话")])),_:1})):h("",!0),2==s.globalConfig.sysInfo.runMode?(o(),u(N,{key:2,class:"cu-btn bg-red mt-10 lg",onClick:t[3]||(t[3]=e=>i.delFriend())},{default:r((()=>[m("删除好友")])),_:1})):h("",!0)])),_:1})):h("",!0),2!=s.globalConfig.sysInfo.runMode||s.detail.friend?h("",!0):(o(),u(d,{key:1,class:"padding flex flex-direction"},{default:r((()=>[g(N,{class:"cu-btn bg-green lg",onClick:t[4]||(t[4]=e=>i.addFriend())},{default:r((()=>[m("加好友")])),_:1})])),_:1}))],64)):h("",!0),g(d,{class:p(["cu-modal bottom-modal","callRtc"==s.modelName?"show":""]),onClick:t[8]||(t[8]=e=>s.modelName="")},{default:r((()=>[g(d,{class:"cu-dialog"},{default:r((()=>[g(d,{class:"manage-content"},{default:r((()=>[g(d,{class:"cu-list menu bg-white"},{default:r((()=>[g(d,{class:"cu-item",onClick:t[5]||(t[5]=e=>i.calling(0))},{default:r((()=>[g(d,{class:"content padding-tb-sm"},{default:r((()=>[g(c,{class:"cuIcon-dianhua"}),g(c,null,{default:r((()=>[m("语音通话")])),_:1})])),_:1})])),_:1}),g(d,{class:"cu-item",onClick:t[6]||(t[6]=e=>i.calling(1))},{default:r((()=>[g(d,{class:"content padding-tb-sm"},{default:r((()=>[g(c,{class:"cuIcon-record"}),g(c,null,{default:r((()=>[m("视频通话")])),_:1})])),_:1})])),_:1}),g(d,{class:"parting-line-5"}),g(d,{class:"cu-item",onClick:t[7]||(t[7]=e=>s.modelName="")},{default:r((()=>[g(d,{class:"content padding-tb-sm"},{default:r((()=>[g(c,{class:"c-red"},{default:r((()=>[m("取消")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])])),_:1})}]]);export{w as default};