mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
12 KiB
2 lines
12 KiB
1 year ago
|
import{d as K,c as $,r as _e,e as a,f as u,k as n,w as t,bf as o,j as y,y as R,A as d,x as p,Y as _,q as I,l as de,h as D,u as ne,F as te,H as v,b as pe}from"./@vue-a481fc63.js";import{u as me}from"./vuex-44de225f.js";import{u as ge,b as fe}from"./vue-router-e5a2430e.js";import{I as ve,N as ke,O as ye,P as he,u as we,f as be,_ as X,Q as $e}from"./index-5ca8b57f.js";import{K as ee,k as Ie,N as Se,O as Ce,Q as se,U as Me,r as A,s as qe,t as ze,X as T,Y as Oe,Z as U,_ as B,R as V}from"./@vicons-f0266f88.js";import{F as Re,j as m,o as Te,M as Ae,l as Fe,e as ae,P as oe,T as Ne,O as Pe,U as We,a as je,G as Ue,J as Be,Q as Ve,k as De,H as He}from"./naive-ui-eecf2ec3.js";import{_ as Le}from"./whisper-11b20d3d.js";import{_ as Qe}from"./main-nav.vue_vue_type_style_index_0_lang-148fe87d.js";import{W as Ye}from"./v3-infinite-loading-2c58ec2f.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-7c8d4b48.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";const Ee={class:"sender-wrap"},Ge={key:0,class:"nickname"},Je={key:0,class:"username"},Ke={key:1,class:"nickname"},Xe={key:0,class:"username"},Ze={key:2,class:"nickname"},xe={class:"timestamp"},es={class:"timestamp-txt"},ss={key:0,class:"brief-content"},ns={key:1,class:"whisper-content-wrap"},ts={key:2,class:"requesting-friend-wrap"},as={key:2,class:"status-info"},os={key:3,class:"status-info"},ls="https://assets.paopao.info/public/avatar/default/admin.png",rs=K({__name:"message-item",props:{message:{}},emits:["send-whisper","reload"],setup(H,{emit:h}){const c=H,g=ge(),l=me(),M=Re(),w=$(()=>l.state.desktopModelShow?"已发送":"私信已发送"),b=$(()=>l.state.desktopModelShow?"已接收":"私信已接收"),f=e=>()=>D(m,null,{default:()=>D(e)}),F=$(()=>{let e=[{label:"私信",key:"whisper",icon:f(A)}],s=c.message.type==4&&c.message.sender_user_id==l.state.userInfo.id?c.message.receiver_user:c.message.sender_user;return l.state.userInfo.id!=s.id&&(s.is_following?e.push({label:"取消关注",key:"unfollow",icon:f(qe)}):e.push({label:"关注",key:"follow",icon:f(ze)})),e}),q=e=>{let s=e.type==4&&e.sender_user_id==l.state.userInfo.id?e.receiver_user:e.sender_user;M.success({title:"提示",content:"确定"+(s.is_following?"取消关注":"关注")+"该用户吗?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{s.is_following?we({user_id:s.id}).then(k=>{window.$message.success("操作成功"),s.is_following=!1,setTimeout(()=>{h("reload")},50)}).catch(k=>{}):be({user_id:s.id}).then(k=>{window.$message.success("关注成功"),s.is_following=!0,setTimeout(()=>{h("reload")},50)}).catch(k=>{})}})},N=e=>{switch(e){case"whisper":const s=c.message;if(s.type!=99){let k=s.type==4&&s.sender_user_id==l.state.userInfo.id?s.receiver_user:s.sender_user;h("send-whisper",k)}break;case"follow":case"unfollow":q(c.message);break}},S=$(()=>c.message.type!==4||c.message.sender_user_id!==l.state.userInfo.id),i=$(()=>c.message.type==4&&c.message.receiver_user_id==l.state.userInfo.id),P=$(()=>c.message.type==4&&c.message.sender_user_id==l.state.userInfo.id),W=e=>{C(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?g.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},L=e=>{C(e),ke({user_id:e.sender_user_id}).then(s=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(s=>{console.log(s)})},Q=e=>{C(e),ye({user_id:e.sender_user_id}).then(s=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(s=>{console.log(s)})},C=e=>{c.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&he({id:e.id}).then(s=>{e.is_read=1}).catch(s=>{console.log(s)})};return(e,s)=>{const k=Te,r=_e("router-link"),j=Ae,Y=Fe,E=ae,G=oe,J=Ne,z=Pe;return a(),u("div",{cl
|