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.
1 line
2.3 KiB
1 line
2.3 KiB
import{A as e,Bt as t,D as n,O as r,Q as i,S as a,W as o,lt as s,x as c}from"./@css-render-YsNuQTaE.js";import{E as l,H as u,K as d,nt as f,ot as p,st as m}from"./naive-ui-DIGPL69-.js";import{a as h,r as g}from"./sidebar-CIS7wt6Z.js";var _={class:`whisper-wrap`},v={class:`whisper-line`},y={class:`whisper-line send-wrap`},b=g(e({__name:`whisper`,props:{show:{type:Boolean,default:!1},user:{}},emits:[`success`],setup(e,{emit:g}){let b=e,x=s(``),S=s(!1),C=g,w=()=>{C(`success`)},T=()=>{S.value=!0,h.v1.user.post.whisper({user_id:b.user.id,content:x.value}).then(e=>{window.$message.success(`发送成功`),S.value=!1,x.value=``,w()}).catch(e=>{S.value=!1})};return(s,h)=>{let g=l,b=d,C=m,E=p,D=f,O=u;return o(),a(O,{show:e.show,"onUpdate:show":w,class:`whisper-card`,preset:`card`,size:`small`,title:`私信`,"mask-closable":!1,bordered:!1,style:{width:`360px`}},{default:i(()=>[c(`div`,_,[r(C,{"show-icon":!1},{default:i(()=>[h[1]||=n(` 即将发送私信给: `,-1),r(b,{style:{"max-width":`100%`}},{default:i(()=>[r(g,{type:`success`},{default:i(()=>[n(t(e.user.nickname)+`@`+t(e.user.username),1)]),_:1})]),_:1})]),_:1}),c(`div`,v,[r(E,{type:`textarea`,placeholder:`请输入私信内容(请勿发送不和谐内容,否则将会被封号)`,autosize:{minRows:5,maxRows:10},value:x.value,"onUpdate:value":h[0]||=e=>x.value=e,maxlength:`200`,"show-count":``},null,8,[`value`])]),c(`div`,y,[r(D,{strong:``,secondary:``,type:`primary`,loading:S.value,onClick:T},{default:i(()=>[...h[2]||=[n(` 发送 `,-1)]]),_:1},8,[`loading`])])])]),_:1},8,[`show`])}}}),[[`__scopeId`,`data-v-fe2d3f1a`]]),x=class{static followAction(e,t,n,r){return new Promise((i,a)=>{e.success({title:`提示`,content:`确定`+(r?`取消关注 @`:`关注 @`)+n+` 吗?`,positiveText:`确定`,negativeText:`取消`,onPositiveClick:()=>{r?h.v1.user.post.unfollow({user_id:t}).then(e=>{window.$message.success(`操作成功`),i(!1)}).catch(e=>{a(e)}):h.v1.user.post.follow({user_id:t}).then(e=>{window.$message.success(`关注成功`),i(!0)}).catch(e=>{a(e)})}})})}static useWhisper(){let e=s(!1),t=s({id:0,avatar:``,username:``,nickname:``,is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1});return{showWhisper:e,whisperReceiver:t,onSendWhisper:n=>{t.value=n,e.value=!0},whisperSuccess:()=>{e.value=!1}}}};export{b as n,x as t}; |