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