1 |
- import{az as R,d as E,r as c,x as W,b as F,o as p,C as G,A as D,B as y,k as P,a as t,c as f,a2 as b,f as S,a1 as K,D as Q,n as q,J as X,Y as Z,L as $,M as aa,__tla as ea}from"./index-6e0fa573.js";import{_ as ta,__tla as la}from"./ContentWrap.vue_vue_type_script_setup_true_lang-bed37a76.js";import{R as A,__tla as sa}from"./TabNews-cc75a8a3.js";import ra,{__tla as ca}from"./main-6814dcb6.js";import ua,{__tla as na}from"./MsgList-ddcaf999.js";import{g as oa,__tla as _a}from"./index-0972b859.js";import{u as ia,__tla as pa}from"./useMessage-7f978edc.js";import{_ as da}from"./_plugin-vue_export-helper-1b428a4d.js";let N,w,B,ma=Promise.all([(()=>{try{return ea}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return pa}catch{}})()]).then(async()=>{let h,z,x,j,M,T;w=u=>R.get({url:"/mp/message/page",params:u}),h=u=>($("data-v-d01ad444"),u=u(),aa(),u),z={key:0},x=[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))],T={class:"msg-send"},N=da(E({name:"WxMsg",__name:"main",props:{userId:{type:Number,required:!0}},setup(u){const J=ia(),k=u,d=c(-1),m=c(!1),I=c(!0),i=c([]),n=W({pageNo:1,pageSize:14,accountId:d}),_=W({nickname:"\u7528\u6237",avatar:"/assets/profile-61ae42a9.jpg",accountId:d}),V=c(!1),e=c({type:A.Text,accountId:-1,articles:[]}),C=c(null),s=c(null);F(async()=>{var l,r;const a=await oa(k.userId);_.nickname=((l=a.nickname)==null?void 0:l.length)>0?a.nickname:_.nickname,_.avatar=((r=_.avatar)==null?void 0:r.length)>0?a.avatar:_.avatar,d.value=a.accountId,e.value.accountId=a.accountId,Y()});const L=async()=>{var l;if(!t(e))return;e.value.type===A.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(r=>R.post({url:"/mp/message/send",data:r}))({userId:k.userId,...e.value});V.value=!1,i.value=[...i.value,a],await O(),(l=C.value)==null||l.clear()},U=()=>{n.pageNo++,H(n,null)},H=async(a,l=null)=>{var g;m.value=!0;let r=await w(Object.assign({pageNo:a.pageNo,pageSize:a.pageSize,userId:k.userId,accountId:a.accountId},l));const v=((g=s.value)==null?void 0:g.scrollHeight)??0,o=r.list.reverse();i.value=[...o,...i.value],m.value=!1,(o.length<n.pageSize||o.length===0)&&(I.value=!1),n.pageNo=a.pageNo,n.pageSize=a.pageSize,n.pageNo===1?await O():o.length!==0&&(await q(),v!==0&&s.value&&(s.value.scrollTop=s.value.scrollHeight-v-100))},Y=()=>{H(n)},O=async()=>{await q(),s.value&&(s.value.scrollTop=s.value.scrollHeight)};return(a,l)=>{const r=X,v=ta,o=Z;return p(),G(v,null,{default:D(()=>[y("div",{class:"msg-div",ref_key:"msgDivRef",ref:s},[P(y("div",null,null,512),[[o,t(m)]]),t(m)?b("",!0):(p(),f("div",z,[t(I)?(p(),f("div",{key:0,class:"el-table__empty-block",onClick:U},x)):b("",!0),t(I)?b("",!0):(p(),f("div",j,M))])),S(ua,{list:t(i),"account-id":t(d),user:t(_)},null,8,["list","account-id","user"])],512),P((p(),f("div",T,[S(t(ra),{ref_key:"replySelectRef",ref:C,modelValue:t(e),"onUpdate:modelValue":l[0]||(l[0]=g=>K(e)?e.value=g:null)},null,8,["modelValue"]),S(r,{type:"success",class:"send-but",onClick:L},{default:D(()=>[Q("\u53D1\u9001(S)")]),_:1})])),[[o,t(V)]])]),_:1})}}}),[["__scopeId","data-v-d01ad444"]]),B=Object.freeze(Object.defineProperty({__proto__:null,default:N},Symbol.toStringTag,{value:"Module"}))});export{N as W,ma as __tla,w as g,B as m};
|