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
7.7 KiB
2 lines
7.7 KiB
1 year ago
|
import{d as V,c as N,r as L,e as t,f as r,k as s,w as a,bf as o,j as f,y as C,A as _,x as m,q as I,Y as i,l as Y,h as T,u as E,F as G,H as v,b as K}from"./@vue-a481fc63.js";import{u as J}from"./vuex-44de225f.js";import{u as X,b as Z}from"./vue-router-e5a2430e.js";import{H as x,N as ee,O as se,P as ne,_ as D,Q as te}from"./index-537a241d.js";import{N as U,k as ae,O as oe,Q as re,R as Q,U as ie,r as le}from"./@vicons-4ed09704.js";import{j as d,o as ue,M as _e,l as pe,e as ce,P as de,T as me,O as ge,U as ve,G as fe,R as ye,J as ke,H as he}from"./naive-ui-defd0b2d.js";import{_ as we}from"./whisper-7c8226c3.js";import{_ as $e}from"./main-nav.vue_vue_type_style_index_0_lang-832ff0ed.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.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 be={class:"sender-wrap"},Ce={key:0,class:"nickname"},Ie={class:"username"},Me={key:1,class:"nickname"},Se={class:"username"},ze={key:2,class:"nickname"},Oe={class:"timestamp"},Re={class:"timestamp-txt"},Ne={key:0,class:"brief-content"},qe={key:1,class:"whisper-content-wrap"},Fe={key:2,class:"requesting-friend-wrap"},Pe={key:2,class:"status-info"},Ae={key:3,class:"status-info"},We="https://assets.paopao.info/public/avatar/default/admin.png",je=V({__name:"message-item",props:{message:{}},emits:["send-whisper"],setup(q,{emit:y}){const p=q,c=X(),l=J(),k=e=>()=>T(d,null,{default:()=>T(e)}),h=N(()=>[{label:"私信",key:"whisper",icon:k(le)}]),w=e=>{switch(e){case"whisper":const n=p.message;if(n.type!=99){let $=n.type==4&&n.sender_user_id==l.state.userInfo.id?n.receiver_user:n.sender_user;y("send-whisper",$)}break}},g=N(()=>p.message.type!==4||p.message.sender_user_id!==l.state.userInfo.id),M=N(()=>p.message.type==4&&p.message.receiver_user_id==l.state.userInfo.id),S=N(()=>p.message.type==4&&p.message.sender_user_id==l.state.userInfo.id),F=e=>{u(e),(e.type===1||e.type===2||e.type===3)&&(e.post&&e.post.id>0?c.push({name:"post",query:{id:e.post_id}}):window.$message.error("该动态已被删除"))},z=e=>{u(e),ee({user_id:e.sender_user_id}).then(n=>{e.reply_id=2,window.$message.success("已同意添加好友")}).catch(n=>{console.log(n)})},P=e=>{u(e),se({user_id:e.sender_user_id}).then(n=>{e.reply_id=3,window.$message.success("已拒绝添加好友")}).catch(n=>{console.log(n)})},u=e=>{p.message.receiver_user_id==l.state.userInfo.id&&e.is_read===0&&ne({id:e.id}).then(n=>{e.is_read=1}).catch(n=>{console.log(n)})};return(e,n)=>{const $=ue,O=L("router-link"),b=_e,A=pe,W=ce,j=de,B=me,R=ge;return t(),r("div",{class:Y(["message-item",{unread:g.value&&e.message.is_read===0}]),onClick:n[5]||(n[5]=H=>u(e.message))},[s(R,{"content-indented":""},{avatar:a(()=>[s($,{round:"",size:30,src:e.message.type==4&&e.message.sender_user_id==o(l).state.userInfo.id?e.message.receiver_user.avatar:e.message.sender_user.id>0?e.message.sender_user.avatar:We},null,8,["src"])]),header:a(()=>[f("div",be,[e.message.type!=4&&e.message.sender_user.id>0||M.value?(t(),r("span",Ce,[s(O,{onClick:n[0]||(n[0]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.sender_user.username}}},{default:a(()=>[_(m(e.message.sender_user.nickname),1)]),_:1},8,["to"]),f("span",Ie," @"+m(e.message.sender_user.username),1)])):S.value?(t(),r("span",Me,[s(O,{onClick:n[1]||(n[1]=C(()=>{},["stop"])),class:"username-link",to:{name:"user",query:{s:e.message.receiver_user.username}}},{default:a(()=>[_(m(e.message.receiver_user.nickname),1)]),_:1},8,["to"]),f("span",Se," @"+m(e.message.receiver_user.username),1)])):(t(),r("span",ze," 系统 ")),e.message.type==4?(t(),I(b,{key:3,class:"top-tag",type:"success",size:"small",round:""},{default:a(()=>[_(" 私信 ")]),_:1})):i("",!0),S.value?(t(),I(b,{key:4,class:"
|