pages-message-chat.c280fb42.js 39 KB

1
  1. var t;import{_ as e,o as s,c as i,f as o,H as a,I as n,u as l,s as c,h as r,J as d,K as u,L as h,q as m,M as p,l as g,w as f,v as y,E as x,G as _,n as b,d as k,N as C,t as w,e as I,b as T,a as v,r as M,F as S,O as L,y as U,B as j,S as B,x as A,z as N,A as R,P as O,g as E,Q as $,j as F,$ as H,R as P,T as D,U as z,V as J,W as V,i as G}from"./index-01d5b8eb.js";import{u as Q,_ as q}from"./user-select.9a5cd963.js";import{r as W}from"./uni-app.es.37c693bd.js";import{e as K,_ as Y}from"./emoji.70cb7500.js";import{s as X}from"./status.9074c73e.js";const Z=e({data:()=>({isUserMedia:!1,stream:null,audio:null,recorder:null,chunks:[],startTime:0}),mounted(){if(-1===origin.indexOf("https")&&-1===origin.indexOf("localhost")&&-1===origin.indexOf("127.0.0.1"))throw this.$emit("error","100"),"请在 https 环境中使用本插件。";if(!navigator.mediaDevices||!window.MediaRecorder)throw this.$emit("error","101"),"当前浏览器不支持";this.getRecorderManager()},methods:{getRecorderManager(){this.audio=document.createElement("audio"),navigator.mediaDevices.getUserMedia({audio:!0}).then((t=>{this.isUserMedia=!0,t.getTracks().forEach((t=>{t.stop()}))})).catch((t=>{this.onErrorHandler(t)}))},start(){if(!this.isUserMedia)return console.log("设备不支持");navigator.mediaDevices.getUserMedia({audio:!0}).then((t=>{this.startTime=(new Date).getTime(),this.stream=t,this.recorder=new MediaRecorder(t),this.recorder.ondataavailable=this.getRecordingData,this.recorder.onstop=this.saveRecordingData,this.recorder.start()})).catch((t=>{this.onErrorHandler(t)}))},stop(){this.recorder.stop(),this.stream.getTracks().forEach((t=>{t.stop()}))},getRecordingData(t){this.chunks.push(t.data)},saveRecordingData(){const t=new Blob(this.chunks,{type:"audio/mpeg"}),e=URL.createObjectURL(t);this.chunks=[];let s=((new Date).getTime()-this.startTime).toString().split("");s.splice(s.length-2),s.splice(s.length-1,0,"."),s=parseFloat(s.join(""));const i={data:t,duration:s,localUrl:e};this.$emit("success",i)},onErrorHandler(t){if(console.log(t),"NotAllowedError"===t.name)throw this.$emit("error","201"),"用户拒绝了当前的浏览器实例的访问请求";if("NotReadableError"===t.name)throw this.$emit("error","101"),"当前浏览器不支持";throw this.$emit("error","500"),"调用失败,原因不详"}},destroyed(){this.stop()}},[["render",function(t,e,a,n,l,c){const r=o;return s(),i(r,{class:"recorder"})}]]);class tt extends class{constructor(t){this.messages={}}$fire(t,e={}){if(!this.messages[t])return;let s=this.messages[t].length;for(let i=0;i<s;i++)this.messages[t][i].call(this,{type:t,detail:e})}$on(t,e){this.messages[t]&&"function"==typeof e?this.messages[t].push(e):this.messages[t]=[e]}$off(t,e){if(this.messages[t]instanceof Array){let s=this.messages[t].length-1;for(;s>=0;s--)this.messages[t][s]===e&&this.messages[t].splice(s,1)}}}{constructor({context:e,maxCount:s}){super(),((t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)})(this,t,void 0),this.deftext="######################################################NBLSJ######################################################",this.ctx=e,this.maxCount=s,this.textCount=0,this.overstep=!1,this.timeoutArr=[],this.flagArr=[]}tool(t,e={}){return"function"==typeof this.ctx[t]&&this.ctx[t](e),this}ready(t){this.tool("setContents",{html:t})}format(t,e){return this.ctx.format(t,e),this}emoji(t){return this.tool("insertText",{text:t}),this}addLink({prefix:t="",suffix:e="",data:s={}}){this.tool("insertText",{text:this.deftext}).tool("blur").getContents().then((e=>{let i=e.delta.ops,o=[];for(let a=0;a<i.length;a++){let e=i[a];if(e.insert&&"object"!=typeof e.insert){if(e.insert.indexOf(this.deftext)>-1){e.attributes&&e.attributes.link&&delete e.attributes;let[n,l]=e.insert.split(this.deftext);if(o.push({...e,insert:n}),"object"!=typeof s||Array.isArray(s))s.forEach(((e,s)=>{let i={attributes:{link:`${e.user_id}`,textDecoration:"none",color:"#333",pointerEvents:"none"},insert:t+e.realname};o.push(i),o.push({insert:" "})}));else{let e={attributes:{link:`${s.user_id}`,textDecoration:"none",color:"#333",pointerEvents:"none"},insert:t+s.realname};o.push(e),o.push({insert:" "})}l&&o.push({...e,insert:l});let c=i.slice(a+1);o=[...o,...c];break}o.push(e)}else o.push(e)}this.ctx.setContents({delta:{ops:o},complete:()=>{this.format("fontFamily","inherit").input()}})})).catch((t=>a({title:"操作失败",icon:"error"})))}async getLink(){let{delta:{ops:t}}=await this.getContents(),e=[];return t.forEach((t=>{t.attributes&&t.attributes.link&&e.push(parseInt(t.attributes.link))})),e}addImage(t){const e=t=>(t.forEach((t=>{this.tool("insertImage",{src:t,alt:"IMAGE"}).tool("insertText",{text:"\n"})})),this.tool("scrollIntoView"),this);return t?e(t):n({count:9,sizeType:["original","compressed"],sourceType:["album","camera"],success:t=>e(t.tempFilePaths)})}async getImages(){let{delta:{ops:t}}=await this.getContents(),e=[];return t.forEach((t=>{t.attributes&&"IMAGE"===t.attributes.alt&&e.push(t.insert.image.replace(/data:image\/png;base64,/,""))})),e}async replaceImage(t){let e=await this.getContents(),s=JSON.stringify(e.delta.ops),i=e.delta.ops;for(let o of i)if("object"==typeof o.insert&&"image"in o.insert){let e=o.insert.image;o.insert.image=await t(e)}return s===JSON.stringify(i)?e:await this.tool("setContents",{delta:{ops:i}}).getContents()}getContents(){return new Promise(((t,e)=>{this.ctx.getContents({success:e=>{t(e)}})}))}upKeyboard(){return this.tool("blur").format("fontFamily","inherit"),this}eventLink(t){if(!t)return;let e=t.delta.ops||[];if(JSON.stringify(e).indexOf(this.deftext)>-1)return;let s=!1;for(let i=0,o=e.length;i<o;i++){let t=e[i];if(t.attributes&&t.attributes.link){let t=e[i+1].insert;if(t&&(0===t.indexOf("\\n")||0===t.indexOf(" ")))continue;e.splice(i,1,{insert:""}),s=!0;break}}s?(this.tool("blur"),this.ctx.setContents({delta:{ops:e},complete:()=>{this.input()}})):this.input(t)}eventTextLenght(t){return this.textCount=t.text.length-1,!!(this.maxCount&&this.textCount>this.maxCount)}async input(t){t||(t=await this.getContents()),t.text.indexOf(this.deftext)<0&&(this.overstep=this.eventTextLenght(t),t.overstep=this.overstep,this.$fire("edit:input",t))}statuschange({detail:t}){t.link?this.ctx.blur():this.debounce((()=>{this.$fire("edit:statuschange",t)}),100,!1)}focus({detail:t}){this.debounce((()=>{this.input(t)}),100,!1)}blur({detail:t}){this.debounce((()=>{this.$fire("edit:blur",t)}),100,!1)}debounce(t,e=500,s=!0,i="default"){if(this.timeoutArr[i]||(this.timeoutArr[i]=null),null!==this.timeoutArr[i]&&clearTimeout(this.timeoutArr[i]),s){var o=!this.timeoutArr[i];this.timeoutArr[i]=setTimeout((function(){this.timeoutArr[i]=null}),e),o&&"function"==typeof t&&t()}else this.timeoutArr[i]=setTimeout((function(){"function"==typeof t&&t()}),e)}queryParamsReverse(t){let e=t||"",s=new Object,i=e.split("?")[1];if(null!=i){let t=i.split("&");for(let e=0;e<t.length;e++)s[t[e].split("=")[0]]=t[e].split("=")[1]}return s}queryParams(t={},e=!0,s="brackets"){let i=JSON.parse(JSON.stringify(t)),o=e?"?":"",a=[];-1==["indices","brackets","repeat","comma"].indexOf(s)&&(s="brackets");for(let n in i){let t=i[n];if(!(["",void 0,null].indexOf(t)>=0))if(t.constructor===Array)switch(s){case"indices":for(let s=0;s<t.length;s++)a.push(n+"["+s+"]="+t[s]);break;case"brackets":default:t.forEach((t=>{a.push(n+"[]="+t)}));break;case"repeat":t.forEach((t=>{a.push(n+"="+t)}));break;case"comma":let e="";t.forEach((t=>{e+=(e?",":"")+t})),a.push(n+"="+e)}else a.push(n+"="+t)}return a.length?o+a.join("&"):""}}t=new WeakMap;const et=l(c),st=r(c);const it=e({name:"im-input",components:{MumuRecorder:Z,userSelect:Q},props:{boxStatus:{type:Number,default:0},contact:{type:Object,default:{}}},data:()=>({editorCtx:null,InputBottom:0,paddingB:0,footerHeight:50,boxHeight:300,uploading:!1,recShow:!1,inputMsg:"",recorderManager:null,recing:!1,recLength:1,recTimer:null,tmpVoice:"",isUseRecorder:!1,playItemIndex:-1,currentAudio:"",mainHeight:0,isCancel:!1,isH5:!1,isApp:!1,appBox:0,TabCur:0,scrollLeft:0,emojiList:[],currentEmojiList:[],isFocus:!1,globalConfig:st.globalConfig,readOnly:!1,edit:null,modelName:!1,isAt:!1}),watch:{boxStatus(t){this.appBox=0,this.InputBottom=0},appBox(t){0!=t||this.isFocus||(this.InputBottom=0)},InputBottom(t){this.$emit("setPad",t)}},created:function(){this.emojiList=K,this.currentEmojiList=K[0].children,d({success:t=>{let e=t.windowHeight;this.mainHeight=e}}),this.isH5=!0},methods:{msgItem(){return{id:this.$util.getUuid(),sendTime:(new Date).getTime(),status:"going",type:"text",content:"",is_read:0,is_group:0,file_id:0,file_cate:0,fileName:"",fileSize:0,extends:null}},at(){this.isAt=!0;let t=this.$refs.userSelect.selectUser;this.closeModel(),this.edit.addLink({prefix:"@",data:t}),setTimeout((()=>{this.getFocus()}),100)},closeModel(){this.modelName="",this.$refs.userSelect.selectUser=[],this.$refs.userSelect.changeUser=[]},setAtList(t){this.isAt=!0,this.closeModel(),this.edit.addLink({prefix:"@",data:t})},getFocus(){this.editorCtx.format("fontFamily","inherit"),this.isFocus=!0},chooseEmoji(t){this.readOnly=!0,setTimeout((()=>{this.editorCtx.insertImage({src:t.src,alt:t.title,width:18,height:18,nowrap:!0,extClass:"emoji-image",success:function(){},complete:()=>{this.readOnly=!1}})}),10)},tabSelect(t){this.TabCur=t.currentTarget.dataset.id,this.scrollLeft=60*(t.currentTarget.dataset.id-1),this.currentEmojiList=this.emojiList[this.TabCur].children},showAppBox(t){this.appBox==t?(this.appBox=0,this.InputBottom=0):(this.appBox=t,this.InputBottom=this.boxHeight,this.recShow=!1)},showRec:function(){this.InputBottom=0,this.appBox=0,1==this.recShow?this.recShow=!1:this.recShow=!0},sendVoiceMsg:function(){if(""==this.tmpVoice)return void a({title:"录制已取消",icon:"none"});let t={localUrl:this.tmpVoice,duration:this.recLength};this.handlerSuccess(t),this.tmpVoice="",this.recLength=0},sendTextMsg:function(){1!=this.appBox&&(this.isFocus=!0),this.editorCtx.getContents({success:t=>{let e=t.html;if("<p><br></p>"==e)return!1;this.edit.getLink().then((t=>{const s=Array.from(new Set(t));let i={type:"text",content:e,at:s};this.inputMsg="",this.editorCtx.clear(),this.getFocus(),setTimeout((()=>{this.isFocus=!0}),10),this.$emit("send",Object.assign(this.msgItem(),i),"")}))},fail:t=>{this.inputMsg="",this.editorCtx.clear(),this.editorCtx.format("fontFamily","inherit"),console.info("错误")}})},chooseImg(){let t={type:"image",status:"going"};n({count:9,sizeType:["compressed"],sourceType:["album","camera"],success:e=>{e.tempFiles.forEach((e=>{t.content=e.path,t.fileName=e.name,t.fileSize=e.size,this.$emit("send",Object.assign(this.msgItem(),t),e.path)}))}})},chooseVideo:function(){let t={type:"video",status:"going"};u({sourceType:["camera","album"],success:e=>{if(e.duration>60)return a({title:"视频长度不能超过60秒",icon:"error"});const s=e.tempFilePath;let i={duration:e.duration,width:e.width,height:e.height};t.fileName=e.name,t.fileSize=e.size,t.extends=i,t.content=s,this.$emit("send",Object.assign(this.msgItem(),t),s)}})},chooseFile:function(){let t=this;h({count:5,success:function(e){t.appendFile(e)}})},appendFile(t){t.tempFiles.forEach((t=>{let e=t.path,s={type:"file",status:"going",fileName:t.name,fileSize:t.size,content:e},i=t.type;-1!=i.indexOf("image/")&&(s.type="image"),-1!=i.indexOf("video/")&&(s.type="video"),this.$emit("send",Object.assign(this.msgItem(),s),e)}))},chooseProject:()=>a({title:"自己扩展呗~~"}),calling(t){if(!parseInt(this.globalConfig.chatInfo.webrtc))return a({title:"未开启音视频通话",icon:"none"});if(et.webrtcLock)return a({title:"其他终端正在通话中",icon:"none"});let e=this.$util.getUuid();m({url:"/pages/message/call?msg_id="+e+"&type="+t+"&status=1&id="+this.contact.id+"&name="+this.contact.displayName+"&avatar="+encodeURI(this.contact.avatar)})},changeMsgText(t){this.isAt&&(this.edit.eventLink(t.detail),setTimeout((()=>{this.getFocus()}),200));""==t.detail.text.replace(/\n/g,"")&&"<p><br></p>"==t.detail.html?this.inputMsg="":this.inputMsg=t.detail.html},onEditorReady(){p().in(this).select("#editor").context((t=>{this.edit=new tt({context:t.context,maxCount:300}),this.editorCtx=t.context})).exec()},InputFocus(t){this.isFocus=!0,this.appBox>0&&(this.appBox=0),this.InputBottom=0},InputBlur(t){this.appBox||this.isFocus||(this.InputBottom=0),setTimeout((()=>{this.isFocus=!1}),10)},startRecorder(){console.log("录音开始..."),this.$refs.recorderRef.start(),this.isUseRecorder=!0},endRecorder(){console.log("录音结束"),this.$refs.recorderRef.stop(),this.isUseRecorder=!1},cancelRecorder(){this.endRecorder(),this.isCancel=!0},moveRecorder(t){t.touches[0].clientY<this.mainHeight-80?this.isCancel=!0:this.isCancel=!1},handlerSuccess(t){if(this.checkRecorder(t.duration),this.isCancel)return this.isCancel=!1,console.log("录音已取消");let e={type:"voice",content:t.localUrl,fileName:this.$util.getUuid()+".mp3",extends:{duration:t.duration}};this.$emit("send",Object.assign(this.msgItem(),e))},checkRecorder(t){if(t<1||isNaN(t)||!t)return this.recLength=0,this.tmpVoice="",this.recing=!1,this.isCancel=!0,a({title:"录音时间太短",icon:"error"})},handlerError(t){switch(t){case"101":g({content:"当前浏览器版本较低,请更换浏览器使用,推荐在微信中打开。"});break;case"201":g({content:"麦克风权限被拒绝,请刷新页面后授权麦克风权限。"});break;default:console.log("录音功能受限,请知晓!")}}}},[["render",function(t,e,a,n,l,c){const r=o,d=L,u=W(U("mumu-recorder"),Z),h=j,m=B,p=N,g=A("user-select");return s(),i(r,{id:"more-oprate"},{default:f((()=>[y(r,{class:"im-footer bg-gray",style:T([{paddingBottom:l.paddingB+"px",bottom:l.InputBottom+"px"}])},{default:f((()=>[x(y(r,{class:b(["im-menus f-28",[l.recShow?"cuIcon-keyboard":"cuIcon-sound"]]),style:{"margin-bottom":"8rpx"},"hover-class":"tap",onClick:c.showRec},null,8,["class","onClick"]),[[_,!l.isFocus||!a.contact.is_group]]),x(y(r,{class:"im-menus f-24",style:{"margin-bottom":"13rpx"},onClick:e[0]||(e[0]=t=>l.modelName="userModel")},{default:f((()=>[k("@")])),_:1},512),[[_,l.isFocus&&a.contact.is_group]]),y(r,{class:"im-flex1 im-msgarea"},{default:f((()=>[x(y(d,{id:"editor",class:"solid-bottom bg-white im-input c-333","adjust-position":!1,maxlength:"300","cursor-spacing":"10",onFocus:c.InputFocus,onBlur:c.InputBlur,onInput:c.changeMsgText,onReady:c.onEditorReady,"read-only":l.readOnly},null,8,["onFocus","onBlur","onInput","onReady","read-only"]),[[_,0==l.recShow]]),x(y(r,{class:"toolBox"},{default:f((()=>[y(r,{class:b(["recorder",{active:l.isUseRecorder}]),onTouchstart:C(c.startRecorder,["prevent"]),onTouchend:C(c.endRecorder,["prevent"]),onTouchmove:C(c.moveRecorder,["prevent"]),onTouchcancel:c.cancelRecorder},{default:f((()=>[k(w(l.isUseRecorder?"松开结束":"按住说话"),1)])),_:1},8,["class","onTouchstart","onTouchend","onTouchmove","onTouchcancel"])])),_:1},512),[[_,1==l.recShow]])])),_:1}),l.isH5?(s(),i(u,{key:0,ref:"recorderRef",onSuccess:c.handlerSuccess,onError:c.handlerError},null,8,["onSuccess","onError"])):I("",!0),y(r,{class:"im-flex im-justify-content-start im-align-items-center",style:{"margin-bottom":"8rpx"}},{default:f((()=>[y(r,{class:"im-menus cuIcon-emoji f-28","hover-class":"tap",onClick:e[1]||(e[1]=t=>c.showAppBox(1))}),l.inputMsg?I("",!0):(s(),i(r,{key:0,class:"im-menus cuIcon-roundadd f-28 mr-10","hover-class":"tap",onClick:e[2]||(e[2]=t=>c.showAppBox(2))})),l.inputMsg?(s(),i(r,{key:1},{default:f((()=>[y(h,{class:"cu-btn bg-green shadow mr-10",onClick:c.sendTextMsg},{default:f((()=>[k("发送")])),_:1},8,["onClick"])])),_:1})):I("",!0)])),_:1}),1==l.appBox?(s(),i(r,{key:1,class:"im-flex im-columns im-emoji-box",style:T([{height:l.boxHeight+"px"}])},{default:f((()=>[y(m,{"scroll-x":"",class:"bg-gray nav im-emoji-header","scroll-with-animation":"","scroll-left":l.scrollLeft},{default:f((()=>[(s(!0),v(S,null,M(l.emojiList,((t,e)=>(s(),i(r,{class:b(["cu-item",e==l.TabCur?"text-green":""]),key:e,onClick:c.tabSelect,"data-id":e},{default:f((()=>[y(r,{class:b([[t.icon],"f-20"])},null,8,["class"])])),_:2},1032,["class","onClick","data-id"])))),128))])),_:1},8,["scroll-left"]),y(m,{"scroll-y":"",class:"bg-white im-emoji-body"},{default:f((()=>[y(r,{class:"im-flex im-wrap im-justify-content-start im-align-items-center pd-10"},{default:f((()=>[(s(!0),v(S,null,M(l.currentEmojiList,((t,e)=>(s(),i(r,{class:"im-emoji-item"},{default:f((()=>[y(p,{src:t.src,style:{width:"44rpx"},mode:"widthFix",onClick:e=>c.chooseEmoji(t)},null,8,["src","onClick"])])),_:2},1024)))),256))])),_:1})])),_:1})])),_:1},8,["style"])):I("",!0),2==l.appBox?(s(),i(r,{key:2,class:"im-flex im-app-box im-flex im-justify-content-start im-wrap im-align-content-start pd-20",style:T([{height:l.boxHeight+"px"}])},{default:f((()=>[y(r,{class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:c.chooseImg},{default:f((()=>[y(r,{class:"bg-white cuIcon-album f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("照片")])),_:1})])),_:1},8,["onClick"]),y(r,{class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:c.chooseVideo},{default:f((()=>[y(r,{class:"bg-white cuIcon-video f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("视频")])),_:1})])),_:1},8,["onClick"]),y(r,{class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:c.chooseFile},{default:f((()=>[y(r,{class:"bg-white cuIcon-file f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("文件")])),_:1})])),_:1},8,["onClick"]),!a.contact.is_group&&(l.isH5||l.isApp)&&parseInt(l.globalConfig.chatInfo.webrtc)?(s(),i(r,{key:0,class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:e[3]||(e[3]=t=>c.calling(0))},{default:f((()=>[y(r,{class:"bg-white cuIcon-dianhua f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("语音通话")])),_:1})])),_:1})):I("",!0),!a.contact.is_group&&(l.isH5||l.isApp)&&parseInt(l.globalConfig.chatInfo.webrtc)?(s(),i(r,{key:1,class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:e[4]||(e[4]=t=>c.calling(1))},{default:f((()=>[y(r,{class:"bg-white cuIcon-record f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("视频通话")])),_:1})])),_:1})):I("",!0),l.globalConfig.demon_mode?(s(),i(r,{key:2,class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:c.chooseProject},{default:f((()=>[y(r,{class:"bg-white cuIcon-apps f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("项目")])),_:1})])),_:1},8,["onClick"])):I("",!0),l.globalConfig.demon_mode?(s(),i(r,{key:3,class:"im-flex im-columns im-align-items-center mt-10 im-app-item",onClick:c.chooseProject},{default:f((()=>[y(r,{class:"bg-white cuIcon-friend f-24 radius-10 im-app-item-icon"}),y(r,{class:"mt-5"},{default:f((()=>[k("客户")])),_:1})])),_:1},8,["onClick"])):I("",!0)])),_:1},8,["style"])):I("",!0)])),_:1},8,["style"]),x(y(r,{class:"voice-model c-white radius-10 im-flex im-columns im-align-items-center pd-10"},{default:f((()=>[y(r,{class:b(["cuIcon-voicefill mt-15 mb-5 f-28",[l.isCancel?"c-red":""]])},null,8,["class"]),y(r,{class:b([l.isCancel?"c-red":""])},{default:f((()=>[k(w(l.isCancel?"松开取消":"正在录音..."),1)])),_:1},8,["class"])])),_:1},512),[[_,l.isUseRecorder]]),y(r,{class:b(["cu-modal bottom-modal","userModel"==l.modelName?"show":""]),onClick:e[8]||(e[8]=t=>c.closeModel())},{default:f((()=>[y(r,{class:"cu-dialog"},{default:f((()=>[y(r,{class:"cu-bar bg-white"},{default:f((()=>[y(r,{class:"action text-gray",onClick:e[5]||(e[5]=t=>c.closeModel())},{default:f((()=>[k("取消")])),_:1}),y(r,{class:"f-16"},{default:f((()=>[k("选择提醒的人")])),_:1}),y(r,{class:"action text-green",onClick:e[6]||(e[6]=t=>c.at())},{default:f((()=>[k("完成")])),_:1})])),_:1}),y(r,{class:"manage-content",style:{height:"500px"},onClick:e[7]||(e[7]=C((()=>{}),["stop"]))},{default:f((()=>[y(m,{style:{height:"500px"},"scroll-y":"true"},{default:f((()=>[a.contact.is_group?(s(),i(g,{key:0,type:4,contact_id:a.contact.id,ref:"userSelect",onSetData:c.setAtList},null,8,["contact_id","onSetData"])):I("",!0)])),_:1})])),_:1})])),_:1})])),_:1},8,["class"])])),_:1})}],["__scopeId","data-v-9a7bf0de"]]);const ot=e({name:"im-item",components:{},props:{item:{type:Object,default:function(){return{}}},index:{type:Number,default:0},isSelf:{type:Boolean,default:!1}},data:()=>({}),created:function(){},methods:{}},[["render",function(t,e,a,n,l,c){const r=o;return"diy"==a.item.type?(s(),i(r,{key:0,item:a.item,index:a.index,isSelf:a.isSelf},{default:f((()=>[k(" 自定义 ")])),_:1},8,["item","index","isSelf"])):(s(),i(r,{key:1},{default:f((()=>[k(" 暂不支持该消息类型 ")])),_:1}))}]]),at=R("userInfo"),nt=R("appSetting"),lt=l(c);const ct=e({name:"im-touch",props:{info:{type:Object,default:function(){return{}}},circleAvatar:{type:Boolean,default:!1},profile:{type:Boolean,default:!1}},data:()=>({toucheTimer:0,fingerRes:[],distance:0,taptimer:100,appSetting:nt}),methods:{openUserInfo(t){let e=lt.getContact(t.user_id);if(!this.profile&&!e)return a({title:"已开启用户隐私!",icon:"none"}),!1;t.id!=at.user_id&&m({url:"/pages/contacts/detail?id="+this.info.id})}}},[["render",function(t,e,a,n,l,c){const r=o;return s(),i(r,{class:b(["cu-avatar lg",l.appSetting.circleAvatar?"round":"radius"]),onClick:e[0]||(e[0]=t=>c.openUserInfo(a.info)),style:T([{backgroundImage:"url("+a.info.avatar+")"}])},null,8,["class","style"])}]]),rt=O(),dt=l(c),{newMessage:ut,msgList:ht,getContact:mt,appendMsg:pt,checkMsg:gt}=E(dt),ft=r(c);const yt=e({components:{imInput:it,imItem:ot,imUser:ct,statusPoint:X},data:()=>({user:ft.userInfo,contact:{},is_group:0,boxStatus:0,paddingT:0,video:"",videoUrl:"",InputBottom:0,player:null,playIndex:-1,emojiMap:[],fileExt:[],page:1,limit:20,moreData:!0,newMessage:ut,messageList:ht,newheight:0,scrollTop:0,loading:"more",loadLock:!1,scrollHeight:0,paddingB:0,contact_id:0,bottomHeight:50,globalConfig:ft.globalConfig,modelName:"",curMsg:"",isSending:!1,copyTxt:"文本",wsData:null,timer:null,lastTapDiffTime:0,isProfile:!1,islongPress:!1,listTouchStart:0,groupInfo:[],atMsgList:[],atCount:0}),computed:{scrollH:function(){let t=$(),e=750/t.windowWidth,s=F(100);this.bottomHeight=s;const i=this.getQuery();return setTimeout((()=>{i.select(".cu-header").boundingClientRect(),i.exec((t=>{this.paddingT=t[0].height}))}),10),parseInt((t.windowHeight-this.navBarHeight-this.paddingT)*e)}},watch:{newMessage(t){t.toContactId==this.contact.id&&t.fromUser.id!=this.user.user_id&&this.$api.msgApi.setMsgIsRead({toContactId:this.contact.id,is_group:this.contact.is_group,messages:t,fromUser:t.fromUser.id}),this.scrollToBottom()}},onLoad(t){let e=dt.getContact(t.id);1==e.is_group&&(e.role<3||"1"==e.setting.profile)&&(this.isProfile=!0),this.contact=e,this.contact_id=t.id,this.is_group=e.is_group,this.getMessageList(),1==e.is_group&&this.getGroupInfo();let s=dt.unread;e.unread>0&&(dt.updateContacts({id:t.id,unread:0}),dt.unread=s-e.unread),H("getPositonsOrder",(t=>{let e=t.data;switch(t.type){case"isRead":for(let t=0;e.length>t;t++){const s={id:e[t].id,is_read:1};this.updateMessage(s)}break;case"readAll":e.toContactId==this.contact.id&&0==this.is_group&&this.messageList.forEach((t=>{t.is_read=1}));break;case"isOnline":e.id==this.contact.id&&(this.contact.is_online=e.is_online);break;case"undoMessage":if(e.from_user==this.user.user_id&&1==e.isMobile&&(new Date).getTime()-e.sendTime<12e4)return!1;this.updateMessage(e);break;case"atMsgList":case"simple":case"group":case"webrtc":let s=P(),i={};s[s.length-1].route;let o=location.href;if(-1!==o.indexOf("pages/message/call"))return;if(i=this.$util.parseUrl(o),"atMsgList"==t.type)return void(e.toContactId==i.id&&(this.atMsgList=e.list,this.atCount=e.count));if("webrtc"==e.type){if(!["calling","hangup","otherOpt"].includes(e.extends.event))return!1;"calling"==e.extends.event&&(this.wsData=e);let t=parseInt(e.extends.code);if([902,903,904,905,906,907].includes(t)){let t=this.wsData||e;t.content=e.content,e=t}}let a=!1;if(1==e.is_group?e.toUser==i.id&&(a=!0):(e.toContactId==i.id||e.fromUser.id==this.user.user_id&&e.toUser==i.id)&&(a=!0),a){dt.checkMsg(e),dt.appendMsg(e);let t=dt.getContact(this.contact_id),s=t.is_at;e.at.includes(this.user.user_id)&&(dt.msgAt-=1,s=t.is_at-1),dt.updateContacts({id:i.id,unread:0,is_at:s})}this.scrollToBottom()}}))},onUnload(){dt.msgList=[],rt.stop()},onBackPress(t){return this.InputBottom=0,D({url:"/pages/index/index"}),!0},onShow(){this.socketIo.send({type:"ping"})},created:function(){let t=[];K.forEach((function(e){let s=e.children;s.length>0&&s.forEach((function(e){let s=e.name,i=e.src;t[s]=i}))})),this.emojiMap=t,rt.onPlay((()=>{console.log("play")})),rt.onEnded((()=>{rt.stop(),this.playIndex=-1})),rt.onError((t=>{console.log(t)}))},mounted(){H("socketStatus",(t=>{t&&(this.page=1,this.getMessageList())}))},methods:{at(t){0!=this.contact.is_group&&this.user.user_id!=t.id&&(t.user_id=t.id,this.$refs.imInput.setAtList(t))},closeAtModel(){this.modelName="";let t=dt.msgAt,e=this.atCount;this.$api.msgApi.readAtMsg({toContactId:this.contact_id}).then((s=>{0==s.code&&(dt.msgAt=t-e,dt.updateContacts({id:this.contact_id,is_at:0}),this.atCount=0)}))},getQuery:()=>p(),calling(t){this.$refs.imInput.calling(parseInt(t))},endTimer(){clearTimeout(this.timer),setTimeout((()=>{this.islongPress=!1}),200)},dblclick(t){const e=(new Date).getTime(),s=this.lastTapDiffTime;this.lastTapDiffTime=e;e-s<300&&(this.curMsg=t,this.modelName="copyModel")},getTime:()=>(new Date).getTime(),setPad(t){this.paddingB=t,this.scrollToBottom()},getGroupInfo(){this.$api.msgApi.groupInfo({group_id:this.contact_id}).then((t=>{this.groupInfo=t.data}))},updateMessage(t){let e=this.messageList;e.forEach(((s,i)=>{let o=e[i];s.id==t.id&&(e[i]=Object.assign(o,t))})),this.messageList=e},getScrollHeight(){const t=this.getQuery();setTimeout((()=>{t.select(".cu-chat").boundingClientRect(),t.exec((t=>{this.scrollHeight=t[0].height,this.scrollTop=t[0].height-this.newheight,this.loadLock=!1}))}),10)},scrollChat(t){this.newheight=t.detail.scrollHeight,t.detail.scrollTop<10&&0==this.loadLock&&(this.loadLock=!0,this.page++,this.moreData&&(this.loading="loading",setTimeout((()=>{this.getMessageList()}),1e3)))},getMessageList(){this.$api.msgApi.getMessageList({is_group:this.is_group,toContactId:this.contact.id,page:this.page,limit:this.limit}).then((t=>{1==this.page&&(dt.msgList=[]),t.data.slice().reverse().forEach((t=>{dt.msgList.unshift(t)})),this.loading="more",t.data.length<this.limit&&(this.moreData=!1,this.loading="noMore"),this.$nextTick((()=>{1==this.page?this.scrollToBottom():this.getScrollHeight()}))}))},moreOption(t,e){this.timer=setTimeout((()=>{this.curMsg=e,"text"==e.type?this.copyTxt="消息":"image"==e.type?this.copyTxt="图片链接":this.copyTxt="文件链接","move"!=this.islongPress&&(this.islongPress=!0,this.modelName="moreOpt")}),1500)},ListTouchMove(t){this.islongPress="move"},undoMsg(){let t=this.curMsg;this.modelName="",this.$api.msgApi.undoMessage({id:t.id}).then((e=>{const s={id:t.id,type:"event",is_undo:1,content:"你撤回了一条消息",oldContent:t.content,toContactId:t.toContactId};this.updateMessage(s)}))},copyMsg(){let t=this.curMsg.content.replace(/<[^>]+>/g,"");z({data:t,showToast:!0}),this.modelName="",this.curMsg={}},forwardMsg(){m({url:"/pages/index/userSelection?contact_id="+this.contact_id+"&type=3"})},reEdit(t){this.$refs.imInput.inputMsg=t,this.$refs.imInput.isFocus=!0},scrollToBottom(){const t=this.getQuery();setTimeout((()=>{t.select(".cu-chat").boundingClientRect(),t.exec((t=>{let e=999999;t[0]&&(e=t[0].height),this.scrollTop=e+3e3}))}),10)},openDetails(){m({url:"/pages/message/detail?id="+this.contact.id+"&is_group="+this.contact.is_group})},fileSize(t){return this.$util.getFileSize(t)},emojiToHtml(t){let e=this.emojiMap;return t.replace(/\[!(\w+)\]/gi,(function(t,s){var i=s;return e[i]?'<img class=\'mr-5\' style="width:18px;height:18px" emoji-name="'.concat(s,'" src="').concat(e[i],'" />'):"[!".concat(s,"]")}))},reSend(t){t.status="going",this.sendMessage(JSON.parse(JSON.stringify(t)),"")},sendMessage(t,e){if(!this.globalConfig.chatInfo.simpleChat&&0==this.is_group||!this.nospeak())return void a({title:"系统已关闭单聊,或者群已开启禁言,无法发送消息",icon:"none"});let s=this.user;s.id=s.user_id,t.fromUser=s,t.from_user=this.user.user_id,t.toContactId=this.contact.id,t.is_group=this.contact.is_group,this.messageList.push(t),this.scrollToBottom();if("text"==t.type)this.$api.msgApi.sendMessage(t).then((t=>{0==t.code?this.updateMessage(t.data):401==t.code&&(this.messageList.pop(),a({title:t.msg,icon:"none"}))})).catch((e=>{this.sendFailed(t)}));else if(["image","file","video","voice"].includes(t.type)){if(t.fileSize>1024e4)return a({title:"文件大小不能超过10M",icon:"error"});J({url:this.$api.msgApi.uploadUrl,filePath:t.content,name:"file",header:{Authorization:R("authToken")},formData:{message:JSON.stringify(t)},success:t=>{let e=JSON.parse(t.data);0==e.code?this.updateMessage(e.data):401==e.code&&(this.messageList.pop(),a({title:e.msg,icon:"none"}))},fail:e=>{this.sendFailed(t)}})}},sendFailed(t){t.status="failed",this.updateMessage(JSON.parse(JSON.stringify(t)))},handlePlay(t){m({url:"/pages/message/video?name="+t.fileName+"&src="+encodeURI(t.content),animationType:"slide-in-bottom"})},sendTime:function(t){return this.$util.timeFormat(t)},playVoice:function(t){var e=t.currentTarget.dataset.voice,s=t.currentTarget.dataset.index;if(-1==this.playIndex)return this.playNow(e,s);this.playIndex==s?(rt.stop(),this.playIndex=-1):(rt.stop(),this.playIndex=-1,this.playNow(e,s))},playNow:function(t,e){return this.playIndex=e,rt.autoplay=!0,rt.src=t,rt.play(),!0},preview(t){if(this.islongPress)return;let e=t.content.split(".").pop().toLowerCase();if(["mp3","wav","acc"].includes(e))return void m({url:"/pages/mine/webview?src="+encodeURIComponent(t.preview),animationType:"slide-in-bottom"});const s=document.createElement("a");s.style.display="none",s.href=t.download,s.setAttribute("download",t.fileName),s.setAttribute("target","_blank"),document.body.appendChild(s),s.click(),document.body.removeChild(s)},showImgs:function(t){for(var e=[],s=t.currentTarget.dataset.img,i=0;i<this.messageList.length;i++)"image"==this.messageList[i].type&&e.push(this.messageList[i].content);V({urls:e,current:s})},closeInput(t){this.boxStatus++},nospeak(){return!(1==this.is_group&&this.contact.setting.nospeak>0)||(1==this.contact.setting.nospeak&&2==this.contact.role||2==this.contact.setting.nospeak&&1==this.contact.role)}}},[["render",function(t,e,a,n,l,c){const r=A("statusPoint"),d=G,u=o,h=A("cu-custom"),m=W(U("uni-load-more"),q),p=A("im-user"),g=W(U("mp-html"),Y),x=N,_=A("imItem"),L=B,j=A("imInput");return s(),i(u,null,{default:f((()=>[y(h,{bgColor:"bg-white",isBack:!0,class:"cu-header"},{backText:f((()=>[])),content:f((()=>[y(u,{class:"im-flex im-justify-content-center im-align-items-center"},{default:f((()=>[0==l.is_group&&1==l.contact.is_online&&1==l.globalConfig.chatInfo.online?(s(),i(r,{key:0,type:"success"})):I("",!0),y(d,{class:"text-overflow"},{default:f((()=>[k(w(l.contact.displayName),1)])),_:1}),l.is_group?(s(),i(d,{key:1},{default:f((()=>[k("("+w(l.groupInfo.groupUserCount)+")",1)])),_:1})):I("",!0)])),_:1})])),right:f((()=>[y(u,{class:"cuIcon-more mr-10 f-16",onClick:c.openDetails},null,8,["onClick"])])),_:1}),y(L,{ref:"scrollView","scroll-y":"true","scroll-anchoring":!0,"scroll-top":l.scrollTop,onScroll:c.scrollChat,style:T({height:c.scrollH+"rpx",position:"fixed",bottom:l.bottomHeight+"px"})},{default:f((()=>[y(u,{class:"cu-chat",style:T({paddingBottom:l.paddingB+"px"}),onClick:c.closeInput,id:"more-oprate"},{default:f((()=>[y(m,{status:l.loading},null,8,["status"]),(s(!0),v(S,null,M(l.messageList,((t,e)=>(s(),v(S,{key:e},["event"==t.type?(s(),i(u,{key:0,class:"cu-info"},{default:f((()=>[k(w(t.content)+" ",1),1==t.is_undo&&c.getTime()-t.sendTime<12e4?(s(),i(d,{key:0,class:"c-primary",onClick:e=>c.reEdit(t.oldContent??"")},{default:f((()=>[k("重新编辑")])),_:2},1032,["onClick"])):I("",!0)])),_:2},1024)):(s(),i(u,{key:1,class:b(["cu-item",[t.fromUser.id==l.user.user_id?"im-rows-reverse self im-justify-content-start":""]])},{default:f((()=>[y(p,{info:t.fromUser,profile:l.isProfile,onLongpress:e=>c.at(t.fromUser)},null,8,["info","profile","onLongpress"]),y(u,{class:"main im-wrap",onTouchstart:e=>c.moreOption(e,t),onTouchmove:c.ListTouchMove,onTouchend:c.endTimer,onClick:e=>c.dblclick(t)},{default:f((()=>[t.fromUser.id!=l.user.user_id?(s(),i(u,{key:0,class:"f-12 c-666",style:{width:"100%","margin-bottom":"6rpx"}},{default:f((()=>[k(w(t.fromUser.realname),1)])),_:2},1024)):I("",!0),"text"==t.type?(s(),i(u,{key:1,class:b(["content shadow",[t.fromUser.id==l.user.user_id?"bg-light-green":""]])},{default:f((()=>[y(g,{"container-style":"overflow: hidden;display:inline;white-space: pre-wrap",content:c.emojiToHtml(t.content)},null,8,["content"])])),_:2},1032,["class"])):"image"==t.type?(s(),i(x,{key:2,src:t.content,class:"radius",mode:"heightFix",onClick:c.showImgs,"data-img":t.content},null,8,["src","onClick","data-img"])):"voice"==t.type?(s(),i(u,{key:3,class:b(["im-voice-msg im-flex im-rows im-nowrap im-align-items-center radius-20",[e==l.playIndex?"linear-green":"",t.fromUser.id==l.user.user_id?"im-rows-reverse":""]]),"data-voice":t.content,"data-index":e,onClick:c.playVoice,style:T({width:3*t.extends.duration+"px"})},{default:f((()=>[y(d,{class:b(["f-16 cuIcon-subscription rotate45",[e==l.playIndex?"c-white":"",t.fromUser.id==l.user.user_id?"rotate225":""]])},null,8,["class"]),y(d,{class:b(["im-voice-msg-text",[e==l.playIndex?"c-white":""]])},{default:f((()=>[k(w(t.extends.duration)+' "',1)])),_:2},1032,["class"])])),_:2},1032,["class","data-voice","data-index","onClick","style"])):"video"==t.type?(s(),i(u,{key:4},{default:f((()=>[y(u,{class:"course-video radius-10",onClick:e=>c.handlePlay(t)},{default:f((()=>[y(u,{class:"relative-shadow"},{default:f((()=>[y(u,{class:"cuIcon-video icon-center f-28 c-white"})])),_:1}),t.extends?(s(),i(x,{key:0,src:t.extends.poster,class:"",mode:"heightFix"},null,8,["src"])):I("",!0)])),_:2},1032,["onClick"])])),_:2},1024)):"file"==t.type?(s(),i(u,{key:5},{default:f((()=>[y(u,{class:"file-card bg-white radius-10 im-flex im-justify-content-start pd-10 im-align-items-center",onClick:C((e=>c.preview(t)),["stop"])},{default:f((()=>[y(x,{src:t.extUrl,style:{width:"64rpx",height:"80rpx"}},null,8,["src"]),y(u,{class:"im-flex im-columns ml-10"},{default:f((()=>[y(u,{class:"text-overflow file-name"},{default:f((()=>[k(w(t.fileName),1)])),_:2},1024),y(u,{class:"text-gray file-size f-12"},{default:f((()=>[k(w(c.fileSize(t.fileSize)),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])])),_:2},1024)):"webrtc"==t.type?(s(),i(u,{key:6,onClick:e=>c.calling(t.extends.type),class:b(["im-voice-msg im-flex im-rows im-nowrap im-align-items-center radius-20",[t.fromUser.id==l.user.user_id?"im-rows-reverse":""]])},{default:f((()=>[y(d,{class:b(["f-16",[1==t.extends.type?"cuIcon-record":"cuIcon-dianhua",t.fromUser.id==l.user.user_id?"rotate180":""]])},null,8,["class"]),y(d,{class:"im-voice-msg-text"},{default:f((()=>[k(w(t.content),1)])),_:2},1024)])),_:2},1032,["onClick","class"])):(s(),i(_,{key:7,item:t,index:e,isSelf:!0},null,8,["item","index"]))])),_:2},1032,["onTouchstart","onTouchmove","onTouchend","onClick"]),t.fromUser.id==l.user.user_id?(s(),i(u,{key:0,class:"mt-10 f-20"},{default:f((()=>["going"==t.status?(s(),i(u,{key:0,class:"cuIcon-icloading icon-spin c-999"})):I("",!0),"failed"==t.status?(s(),i(u,{key:1,class:"cuIcon-infofill c-red",onClick:e=>c.reSend(t)},null,8,["onClick"])):I("",!0)])),_:2},1024)):I("",!0),y(u,{class:"date"},{default:f((()=>[0==t.is_group&&t.fromUser.id==l.user.user_id?(s(),i(d,{key:0,class:b(t.is_read?"c-success":"c-gray")},{default:f((()=>[k(w(t.is_read?"已读":"未读"),1)])),_:2},1032,["class"])):I("",!0),k(" "+w(c.sendTime(t.sendTime)),1)])),_:2},1024)])),_:2},1032,["class"]))],64)))),128))])),_:1},8,["style","onClick"])])),_:1},8,["scroll-top","onScroll","style"]),y(u,{id:"im-input"},{default:f((()=>[y(j,{onSend:c.sendMessage,onSetPad:c.setPad,boxStatus:l.boxStatus,contact:l.contact,ref:"imInput"},null,8,["onSend","onSetPad","boxStatus","contact"])])),_:1}),y(u,{class:b(["cu-modal bottom-modal","moreOpt"==l.modelName?"show":""]),onClick:e[4]||(e[4]=t=>l.modelName="")},{default:f((()=>[y(u,{class:"cu-dialog"},{default:f((()=>[y(u,{class:"cu-list menu bg-white"},{default:f((()=>[c.getTime()-l.curMsg.sendTime<12e4&&l.curMsg.fromUser.id==l.user.user_id||l.contact.role<3?(s(),i(u,{key:0,class:"cu-item",onClick:e[0]||(e[0]=t=>c.undoMsg())},{default:f((()=>[y(u,{class:"content padding-tb-sm"},{default:f((()=>[y(d,{class:"cuIcon-repeal"}),y(d,null,{default:f((()=>[k("撤回消息")])),_:1})])),_:1})])),_:1})):I("",!0),y(u,{class:"cu-item",onClick:e[1]||(e[1]=t=>c.copyMsg())},{default:f((()=>[y(u,{class:"content padding-tb-sm"},{default:f((()=>[y(d,{class:"cuIcon-copy"}),y(d,null,{default:f((()=>[k("复制"+w(l.copyTxt),1)])),_:1})])),_:1})])),_:1}),"voice"!=l.curMsg.type?(s(),i(u,{key:1,class:"cu-item",onClick:e[2]||(e[2]=t=>c.forwardMsg())},{default:f((()=>[y(u,{class:"content padding-tb-sm"},{default:f((()=>[y(d,{class:"cuIcon-forward"}),y(d,null,{default:f((()=>[k("转发")])),_:1})])),_:1})])),_:1})):I("",!0),y(u,{class:"parting-line-5"}),y(u,{class:"cu-item",onClick:e[3]||(e[3]=t=>l.modelName="")},{default:f((()=>[y(u,{class:"content padding-tb-sm"},{default:f((()=>[y(d,{class:"c-red"},{default:f((()=>[k("取消")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["class"]),y(u,{class:b(["cu-modal bottom-modal","copyModel"==l.modelName?"show":""])},{default:f((()=>[y(u,{class:"cu-dialog"},{default:f((()=>[y(u,{class:"cu-bar bg-white"},{default:f((()=>[y(u,{class:"action text-gray",onClick:e[5]||(e[5]=t=>l.modelName="")},{default:f((()=>[k("取消")])),_:1}),y(u,{class:"action text-green",onClick:e[6]||(e[6]=t=>c.copyMsg())},{default:f((()=>[k("复制")])),_:1})])),_:1}),y(L,{"scroll-y":"true",style:T({height:c.scrollH+"rpx"})},{default:f((()=>[y(u,{class:"pd-20 text-container"},{default:f((()=>[y(g,{content:l.curMsg.content},null,8,["content"])])),_:1})])),_:1},8,["style"])])),_:1})])),_:1},8,["class"]),l.atCount?(s(),i(u,{key:0,class:"at-fixed-item",onClick:e[7]||(e[7]=t=>l.modelName="atModel")},{default:f((()=>[k(" 有"+w(l.atCount)+"人提到我 ",1)])),_:1})):I("",!0),y(u,{class:b(["cu-modal bottom-modal","atModel"==l.modelName?"show":""]),onClick:e[9]||(e[9]=t=>c.closeAtModel())},{default:f((()=>[y(u,{class:"cu-dialog"},{default:f((()=>[y(u,{class:"cu-bar bg-white"},{default:f((()=>[y(u,{class:"action"},{default:f((()=>[k("提到我的人")])),_:1}),y(u,{class:"action text-green"},{default:f((()=>[k("已读")])),_:1})])),_:1}),y(L,{"scroll-y":"true",style:T({height:c.scrollH+"rpx"}),onClick:e[8]||(e[8]=C((()=>{}),["stop"]))},{default:f((()=>[y(u,{class:"cu-chat",style:{"text-align":"left"}},{default:f((()=>[(s(!0),v(S,null,M(l.atMsgList,((e,o)=>(s(),i(u,{class:"cu-item",key:o,style:{"padding-bottom":"10rpx"}},{default:f((()=>[y(p,{info:e.fromUser,profile:l.isProfile,onLongpress:t=>c.at(e.fromUser)},null,8,["info","profile","onLongpress"]),y(u,{class:"main im-wrap",onClick:t=>c.dblclick(e)},{default:f((()=>[y(u,{class:"f-12 c-666",style:{width:"100%","margin-bottom":"6rpx"}},{default:f((()=>[k(w(e.fromUser.realname),1),y(d,{class:"text-gray"},{default:f((()=>[k(" - "+w(t.$util.date("Y-m-d H:i:s",e.sendTime)),1)])),_:2},1024)])),_:2},1024),"text"==e.type?(s(),i(u,{key:0,class:"content shadow"},{default:f((()=>[y(g,{"container-style":"overflow: hidden;display:inline;white-space: pre-wrap",content:c.emojiToHtml(e.content)},null,8,["content"])])),_:2},1024)):I("",!0)])),_:2},1032,["onClick"])])),_:2},1024)))),128))])),_:1})])),_:1},8,["style"])])),_:1})])),_:1},8,["class"])])),_:1})}],["__scopeId","data-v-b6075d8b"]]);export{yt as default};