import{aA as H,d as E,r,x as O,b as F,o as p,C as G,A,B as y,k as P,a as t,c as f,a3 as I,f as w,a2 as K,D as Q,n as W,J as X,Z as Y,L as $,M as aa,_ as ea,__tla as ta}from"./index-286756b9.js";import{_ as la,__tla as sa}from"./ContentWrap-83998678.js";import{R as q,__tla as ca}from"./TabNews-aaea42ae.js";import ra,{__tla as ua}from"./main-a55ef504.js";import na,{__tla as oa}from"./MsgList-d4f566f5.js";import{g as ia,__tla as _a}from"./index-dcf59bf4.js";import{u as pa,__tla as ma}from"./useMessage-084b1e70.js";let S,x,B,va=Promise.all([(()=>{try{return ta}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return ma}catch{}})()]).then(async()=>{let h,z,N,j,M,R;x=u=>H.get({url:"/mp/message/page",params:u}),h=u=>($("data-v-bcccc5e5"),u=u(),aa(),u),z={key:0},N=[h(()=>y("span",{class:"el-table__empty-text"},"\u70B9\u51FB\u52A0\u8F7D\u66F4\u591A",-1))],j={key:1,class:"el-table__empty-block"},M=[h(()=>y("span",{class:"el-table__empty-text"},"\u6CA1\u6709\u66F4\u591A\u4E86",-1))],R={class:"msg-send"},S=ea(E({name:"WxMsg",__name:"main",props:{userId:{type:Number,required:!0}},setup(u){const J=pa(),b=u,m=r(-1),v=r(!1),k=r(!0),_=r([]),n=O({pageNo:1,pageSize:14,accountId:m}),i=O({nickname:"\u7528\u6237",avatar:"/assets/profile-61ae42a9.jpg",accountId:m}),T=r(!1),e=r({type:q.Text,accountId:-1,articles:[]}),V=r(null),s=r(null);F(async()=>{var l,c;const a=await ia(b.userId);i.nickname=((l=a.nickname)==null?void 0:l.length)>0?a.nickname:i.nickname,i.avatar=((c=i.avatar)==null?void 0:c.length)>0?a.avatar:i.avatar,m.value=a.accountId,e.value.accountId=a.accountId,Z()});const L=async()=>{var l;if(!t(e))return;e.value.type===q.News&&e.value.articles&&e.value.articles.length>1&&(e.value.articles=[e.value.articles[0]],J.success("\u56FE\u6587\u6D88\u606F\u6761\u6570\u9650\u5236\u5728 1 \u6761\u4EE5\u5185\uFF0C\u5DF2\u9ED8\u8BA4\u53D1\u9001\u7B2C\u4E00\u6761"));const a=await(c=>H.post({url:"/mp/message/send",data:c}))({userId:b.userId,...e.value});T.value=!1,_.value=[..._.value,a],await D(),(l=V.value)==null||l.clear()},U=()=>{n.pageNo++,C(n,null)},C=async(a,l=null)=>{var g;v.value=!0;let c=await x(Object.assign({pageNo:a.pageNo,pageSize:a.pageSize,userId:b.userId,accountId:a.accountId},l));const d=((g=s.value)==null?void 0:g.scrollHeight)??0,o=c.list.reverse();_.value=[...o,..._.value],v.value=!1,(o.length{C(n)},D=async()=>{await W(),s.value&&(s.value.scrollTop=s.value.scrollHeight)};return(a,l)=>{const c=X,d=la,o=Y;return p(),G(d,null,{default:A(()=>[y("div",{class:"msg-div",ref_key:"msgDivRef",ref:s},[P(y("div",null,null,512),[[o,t(v)]]),t(v)?I("",!0):(p(),f("div",z,[t(k)?(p(),f("div",{key:0,class:"el-table__empty-block",onClick:U},[...N])):I("",!0),t(k)?I("",!0):(p(),f("div",j,[...M]))])),w(na,{list:t(_),"account-id":t(m),user:t(i)},null,8,["list","account-id","user"])],512),P((p(),f("div",R,[w(t(ra),{ref_key:"replySelectRef",ref:V,modelValue:t(e),"onUpdate:modelValue":l[0]||(l[0]=g=>K(e)?e.value=g:null)},null,8,["modelValue"]),w(c,{type:"success",class:"send-but",onClick:L},{default:A(()=>[Q("\u53D1\u9001(S)")]),_:1})])),[[o,t(T)]])]),_:1})}}}),[["__scopeId","data-v-bcccc5e5"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/components/wx-msg/main.vue"]]),B=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}))});export{S as W,va as __tla,x as g,B as m};