2 lines
3.0 KiB
JavaScript
2 lines
3.0 KiB
JavaScript
"use strict";const e=require("../../../common/vendor.js"),t=require("../../../components/goEasyTool/tool.js"),o={data:()=>({userId:"",nickname:"",triggered:!1,avatar:"",chatList:[],userinfo:{},ButtonStatus:!1,MoreStatus:!1,KeyboardHeight:0,content:"",MoreItemStatus:null,ioshide:0,popUpList:[{name:"邀请",icon:"https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chat_invite.png",type:"Invitation"}]}),onLoad(o){e.index.getStorage({key:"userinfo",success:e=>{this.userinfo=e}}),this.userId=o.userId,this.nickname=o.nickname,this.avatar=o.avatar,this.getIOSDeviceType(),t.getConversationMessages(this.$goeasy,userinfo.id,null).then((e=>{this.chatList=e})),this.$goeasy.im.on(GoEasy.IM_EVENT.PRIVATE_MESSAGE_RECEIVED,onPrivateMessageReceived)},methods:{onPrivateMessageReceived(e){this.chatList.push(e)},onSend(){""!=this.content&&(t.sendMessage(this.$goeasy,this.userId,this.content,this.avatar,this.nickname).then((e=>{console.log(e)})),this.content="",this.ButtonStatus=!1)},getIOSDeviceType(){const t=e.index.getSystemInfoSync().model;console.log("model:"+t),/iPhone X|iPhone11|iPhone12|iPhone13|iPhone14/i.test(t)&&(/iPhone X|iPhone XS|iPhone 11 Pro/i.test(t)?this.ioshide=88:/iPhone 12|iPhone 13|iPhone 14/i.test(t)&&(this.ioshide=94))},onMore(e){this.MoreStatus=e},onMoreItem(e){this.MoreItemStatus=e},onFocus(e){console.log(2*e.detail.height),this.KeyboardHeight=2*e.detail.height-this.ioshide},onBlur(e){this.KeyboardHeight=0},SendInput(e){""!=e.target.value?this.ButtonStatus=!0:this.ButtonStatus=!1},onBack(){e.wx$1.navigateBack({delta:1})}},components:{textmessage:()=>"./messageComponent/textmessage.js",InvitationComponents:()=>"./moreMessageComponents/InvitationComponents.js"}};if(!Array){(e.resolveComponent("textmessage")+e.resolveComponent("InvitationComponents"))()}const n=e._export_sfc(o,[["render",function(t,o,n,s,i,a){return e.e({a:e.o((e=>a.onMore(!1))),b:e.o(((...e)=>a.onBack&&a.onBack(...e))),c:e.t(i.nickname),d:e.o((e=>a.onMore(!1))),e:e.f(i.chatList,((t,o,n)=>({a:"cb106494-0-"+n,b:e.p({messagetext:t.payload.text})}))),f:e.o(((...e)=>t.onRefresherRefresh&&t.onRefresherRefresh(...e))),g:e.o(((...e)=>t.onScrollToLower&&t.onScrollToLower(...e))),h:i.triggered,i:e.o((e=>a.onMore(!1))),j:e.o([e=>i.content=e.detail.value,(...e)=>a.SendInput&&a.SendInput(...e)]),k:e.o(((...e)=>a.onFocus&&a.onFocus(...e))),l:e.o(((...e)=>a.onBlur&&a.onBlur(...e))),m:i.content,n:!i.ButtonStatus},i.ButtonStatus?{}:{o:e.o((e=>a.onMore(!i.MoreStatus)))},{p:i.ButtonStatus},i.ButtonStatus?{q:e.o(((...e)=>a.onSend&&a.onSend(...e)))}:{},{r:i.MoreStatus||0!=i.KeyboardHeight?i.MoreStatus?"650rpx":0!=i.KeyboardHeight?i.KeyboardHeight+"rpx":"0":"0",s:e.f(i.popUpList,((t,o,n)=>({a:t.icon,b:e.t(t.name),c:e.o((e=>a.onMoreItem(t.type)),o),d:o}))),t:i.MoreStatus||0!=i.KeyboardHeight?i.MoreStatus||0!=i.KeyboardHeight?"0":i.KeyboardHeight+"rpx":"-650rpx",v:"Invitation"==i.MoreItemStatus},(i.MoreItemStatus,{}),{w:e.o((()=>{})),x:null==i.MoreItemStatus?"-1000rpx":"0",y:e.o((e=>a.onMoreItem(null))),z:null==i.MoreItemStatus?"100vh":"0"})}],["__scopeId","data-v-cb106494"]]);wx.createPage(n);
|