优化
This commit is contained in:
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"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);
|
||||
7
unpackage/dist/build/mp-weixin/pages/index/chat/chat.json
vendored
Normal file
7
unpackage/dist/build/mp-weixin/pages/index/chat/chat.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "聊天页",
|
||||
"usingComponents": {
|
||||
"textmessage": "./messageComponent/textmessage",
|
||||
"invitation-components": "./moreMessageComponents/InvitationComponents"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="chat data-v-cb106494"><view class="bg data-v-cb106494" bindtap="{{a}}"><image class="bgImg data-v-cb106494" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png" mode="scaleToFill"/></view><view class="Return data-v-cb106494" bindtap="{{b}}"><image class="ReturnImg data-v-cb106494" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/Return.png" mode="scaleToFill"/></view><view class="title data-v-cb106494" bindtap="{{d}}">{{c}}</view><view class="content data-v-cb106494" bindtap="{{i}}"><scroll-view show-scrollbar="false" scroll-y="true" class="scroll data-v-cb106494" refresher-enabled="true" refresher-threshold="40" bindrefresherrefresh="{{f}}" lower-threshold="100" bindscrolltolower="{{g}}" refresher-triggered="{{h}}"><view wx:for="{{e}}" wx:for-item="item" class="chat-card data-v-cb106494"><view class="chat-avatar data-v-cb106494"><textmessage wx:if="{{item.b}}" class="data-v-cb106494" u-i="{{item.a}}" bind:__l="__l" u-p="{{item.b}}"></textmessage></view></view></scroll-view></view><view class="inputComponent data-v-cb106494" style="{{'bottom:' + r}}"><view class="inputcomponent data-v-cb106494"><block wx:if="{{r0}}"><textarea bindinput="{{j}}" auto-height class="input data-v-cb106494" maxlength="{{500}}" cursor-spacing="20" bindfocus="{{k}}" bindblur="{{l}}" adjust-position="{{false}}" value="{{m}}"></textarea></block></view><view class="sendComponent data-v-cb106494"><image wx:if="{{n}}" class="MoreImg data-v-cb106494" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/chat_add.png" mode="scaleToFill" bindtap="{{o}}"/><button wx:if="{{p}}" class="send data-v-cb106494" bindtap="{{q}}">发送</button></view></view><view class="MoreComponent data-v-cb106494" style="{{'bottom:' + t}}"><view class="Morecontent data-v-cb106494"><view wx:for="{{s}}" wx:for-item="item" wx:key="d" class="MoreList data-v-cb106494"><view class="MoreItem data-v-cb106494" bindtap="{{item.c}}"><image class="Moreicon data-v-cb106494" src="{{item.a}}" mode="scaleToFill"/><text class="MoreName data-v-cb106494">{{item.b}}</text></view></view></view></view><view class="popUpInvitation data-v-cb106494" bindtap="{{y}}" style="{{'top:' + z}}"><view class="popUpInvitationContent data-v-cb106494" catchtap="{{w}}" style="{{'bottom:' + x}}"><invitation-components wx:if="{{v}}" class="data-v-cb106494" u-i="cb106494-1" bind:__l="__l"></invitation-components></view></view></view>
|
||||
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/chat.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.bg.data-v-cb106494{position:fixed;left:0;right:0;bottom:0;top:0;z-index:-1}.bgImg.data-v-cb106494{width:100%;height:100%}.Return.data-v-cb106494{position:fixed;left:35rpx;top:120rpx;width:46rpx;height:46rpx;z-index:1}.title.data-v-cb106494{position:fixed;top:120rpx;left:325rpx;font-size:34rpx;color:#100e0f;font-weight:700;z-index:1}.ReturnImg.data-v-cb106494{width:100%;height:100%}.content.data-v-cb106494{position:absolute;top:200rpx;left:0rpx;right:0rpx;bottom:0rpx}.scroll.data-v-cb106494{width:96%;height:90%;padding:0% 2%}.inputComponent.data-v-cb106494{position:absolute;left:0;right:0;height:auto;background-color:#f0f0f0;padding:2% 2% 5%;display:flex;align-items:flex-end;transition:bottom .1s ease}.chat-card.data-v-cb106494{width:100%;height:auto;margin-bottom:20rpx;background-color:#fff;padding:10rpx}.chat-avatar.data-v-cb106494{width:100%;height:auto}.inputcomponent.data-v-cb106494{width:570rpx;height:auto}.input.data-v-cb106494{width:95%;background-color:#fff;min-height:60rpx;max-height:200rpx;border-radius:10rpx;padding:10rpx;overflow-wrap:break-word;margin-left:30rpx}.sendComponent.data-v-cb106494{margin-left:40rpx}.send.data-v-cb106494{width:100rpx;height:75rpx;background-color:#539c00;border-radius:10rpx;color:#fff;font-size:20rpx;text-align:center;line-height:75rpx}.MoreImg.data-v-cb106494{margin-left:20rpx;height:80rpx;width:80rpx;margin-bottom:-10rpx;border-radius:50rpx}.MoreComponent.data-v-cb106494{position:fixed;left:0;right:0;height:650rpx;transition:bottom .1s ease;background-color:#fff}.Morecontent.data-v-cb106494{width:100%;height:100%;display:flex;align-content:baseline;flex-wrap:wrap}.MoreList.data-v-cb106494{width:150rpx;height:150rpx;background-color:#f1f1f1;border-radius:20rpx;margin:18.75rpx}.MoreItem.data-v-cb106494{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.Moreicon.data-v-cb106494{width:80rpx;height:80rpx}.popUpInvitation.data-v-cb106494{position:fixed;left:0;right:0;bottom:0;transition:top .1s ease}.popUpInvitationContent.data-v-cb106494{position:absolute;left:0;right:0;height:1000rpx;transition:bottom .1s ease;background-color:#fff;border-top-left-radius:40rpx;border-top-right-radius:40rpx}
|
||||
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),t={data:()=>({}),onLoad(){},props:{messagetext:{type:String,default:""}},methods:{}};const o=e._export_sfc(t,[["render",function(t,o,s,n,r,a){return{a:e.t(s.messagetext)}}],["__scopeId","data-v-437ff93d"]]);wx.createComponent(o);
|
||||
4
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.json
vendored
Normal file
4
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.wxml
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="messagetext data-v-437ff93d">{{a}}</view>
|
||||
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.wxss
vendored
Normal file
1
unpackage/dist/build/mp-weixin/pages/index/chat/messageComponent/textmessage.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.messagetext.data-v-437ff93d{font-size:16px;color:#333}
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";const e=require("../../../../common/vendor.js"),o={data:()=>({}),onLoad(){},methods:{}};const t=e._export_sfc(o,[["render",function(e,o,t,n,r,c){return{}}],["__scopeId","data-v-6c2d9d27"]]);wx.createComponent(t);
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="chat-more-message-invitation data-v-6c2d9d27"></view>
|
||||
@@ -0,0 +1 @@
|
||||
.chat-more-message-invitation.data-v-6c2d9d27{width:100%;height:100%;border-radius:40rpx}
|
||||
@@ -1 +1 @@
|
||||
"use strict";const e=require("../../common/vendor.js"),t={data:()=>({title:"Hello"}),onLoad(){},methods:{}};const o=e._export_sfc(t,[["render",function(e,t,o,r,n,c){return{}}],["__scopeId","data-v-3e144f28"]]);wx.createPage(o);
|
||||
"use strict";const o=require("../../common/vendor.js"),t=require("../../components/TimeFormatting.js"),a=require("../../components/goEasyTool/tool.js"),e={data:()=>({Conversationobj:{}}),onLoad(){a.getConversationList(this.$goeasy).then((o=>{console.log(o),this.Conversationobj=o})),this.$goeasy.im.on(GoEasy.IM_EVENT.CONVERSATIONS_UPDATED,onConversationsUpdated)},methods:{onConversationsUpdated(o){this.Conversationobj=o},TimeFormatting:t.TimeFormatting,goChat(t,a,e){o.wx$1.navigateTo({url:`/pages/index/chat/chat?userId=${t}&nickname=${a}&avatar=${e}`})}},components:{tabBar:()=>"../../components/tabBar/tabBar.js"}};if(!Array){(o.resolveComponent("uni-swipe-action-item")+o.resolveComponent("uni-swipe-action")+o.resolveComponent("tabBar"))()}Math||((()=>"../../uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item.js")+(()=>"../../uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action.js")+(()=>"../../components/tabBar/tabBar.js"))();const n=o._export_sfc(e,[["render",function(t,a,e,n,s,i){return{a:o.f(s.Conversationobj.conversations,((t,a,e)=>({a:t.data.avatar,b:o.t(t.unread),c:o.t(t.data.nickname),d:o.t(i.TimeFormatting(t.lastMessage.timestamp)),e:o.t(t.lastMessage.payload.text),f:o.o((o=>i.goChat(t.userId,t.data.nickname,t.data.avatar)),t.userId),g:"383cd827-1-"+e+",383cd827-0-"+e,h:"383cd827-0-"+e,i:t.userId}))),b:o.p({tabIndex:3,Unread:s.Conversationobj.unreadTotal})}}],["__scopeId","data-v-383cd827"]]);wx.createPage(n);
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{
|
||||
"navigationBarTitleText": "聊天",
|
||||
"usingComponents": {}
|
||||
"navigationBarTitleText": "聊天列表",
|
||||
"usingComponents": {
|
||||
"tab-bar": "../../components/tabBar/tabBar",
|
||||
"uni-swipe-action-item": "../../uni_modules/uni-swipe-action/components/uni-swipe-action-item/uni-swipe-action-item",
|
||||
"uni-swipe-action": "../../uni_modules/uni-swipe-action/components/uni-swipe-action/uni-swipe-action"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="forum data-v-383cd827"><view class="bg data-v-383cd827"><image class="bgImg data-v-383cd827" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png" mode="scaleToFill"/></view><view class="title data-v-383cd827">消息</view></view><view class="content data-v-383cd827"><scroll-view show-scrollbar="false" scroll-y="true" class="scroll data-v-383cd827"><view wx:for="{{a}}" wx:for-item="item" wx:key="i" class="card data-v-383cd827"><uni-swipe-action class="data-v-383cd827" u-s="{{['d']}}" u-i="{{item.h}}" bind:__l="__l"><uni-swipe-action-item class="data-v-383cd827" u-s="{{['right','d']}}" u-i="{{item.g}}" bind:__l="__l"><view class="cardContent data-v-383cd827" bindtap="{{item.f}}"><image class="cardImg data-v-383cd827" src="{{item.a}}" mode="scaleToFill"/><view class="cardUnread data-v-383cd827">{{item.b}}</view><view class="cardnameandtimeandNews data-v-383cd827"><view class="cardnameandtime data-v-383cd827"><view class="cardname data-v-383cd827">{{item.c}}</view><view class="cardtime data-v-383cd827">{{item.d}}</view></view><view class="cardNews data-v-383cd827">{{item.e}}</view></view></view><view class="rightPosition data-v-383cd827" slot="right"><view class="topPosition data-v-383cd827">置顶</view><view class="Delete data-v-383cd827">删除</view></view></uni-swipe-action-item></uni-swipe-action></view></scroll-view></view><view class="tabBar data-v-383cd827"><tab-bar wx:if="{{b}}" class="data-v-383cd827" u-i="383cd827-2" bind:__l="__l" u-p="{{b}}"></tab-bar></view>
|
||||
@@ -0,0 +1 @@
|
||||
.bg.data-v-383cd827{position:fixed;top:0;left:0;right:0;bottom:0;z-index:-1}.bgImg.data-v-383cd827{width:100%;height:100%}.title.data-v-383cd827{position:absolute;top:120rpx;left:335rpx;font-size:34rpx;color:#100e0f;font-weight:700}.content.data-v-383cd827{position:absolute;top:200rpx;left:0rpx;right:0rpx;bottom:100rpx}.scroll.data-v-383cd827{width:90%;height:100%;padding:0% 5%}.card.data-v-383cd827{width:100%;height:150rpx;background-color:#fff;border-radius:20rpx;margin-top:20rpx}.cardContent.data-v-383cd827{height:150rpx;width:100%;display:flex;align-items:center}.cardImg.data-v-383cd827{height:110rpx;width:110rpx;border-radius:20rpx;margin-left:20rpx}.cardUnread.data-v-383cd827{width:30rpx;height:30rpx;border-radius:15rpx;font-size:18rpx;color:#fff;background-color:#f53123;text-align:center;line-height:30rpx;margin-top:-100rpx;margin-left:-15rpx}.cardnameandtimeandNews.data-v-383cd827{width:500rpx;height:110rpx;margin-left:20rpx;display:flex;flex-direction:column;justify-content:space-between}.cardnameandtime.data-v-383cd827{width:100%;display:flex;justify-content:space-between}.cardNews.data-v-383cd827{width:500rpx;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:10rpx;font-size:28rpx;color:#333}.cardname.data-v-383cd827{font-size:30rpx;color:#100e0f;font-weight:700}.cardtime.data-v-383cd827{font-size:24rpx;color:#999}.rightPosition.data-v-383cd827{height:150rpx;width:300rpx;display:flex}.topPosition.data-v-383cd827{height:150rpx;width:150rpx;background-color:#f5a623;text-align:center;line-height:150rpx}.Delete.data-v-383cd827{height:150rpx;width:150rpx;background-color:#f54323;text-align:center;line-height:150rpx;border-top-right-radius:20rpx;border-bottom-right-radius:20rpx}
|
||||
|
||||
Reference in New Issue
Block a user