This commit is contained in:
2022-02-18 17:08:45 +08:00
parent e957217635
commit 3a90894351

View File

@@ -1,8 +1,11 @@
<template>
<view class="group--chat">
<scroll-view class="body" :show-scrollbar="false">
<sent-message-bar :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" />
<view class="body">
<view class="scroll">
<view class="cell" v-for="(item, index) in messages" :key="index">
<view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }}</view>
<view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }}
</view>
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
<u-avatar class="avatar" @click="toUser(item)" size="36" shape="square"
:src="contact(item.senderUserId).portraitUrl" />
@@ -16,9 +19,8 @@
</view>
</view>
</view>
<view class="cell-footer" ref="chatBottom"></view>
</scroll-view>
<sent-message-bar :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" />
</view>
</view>
</view>
</template>
@@ -169,17 +171,27 @@
background: $window-color;
height: 100vh;
display: flex;
flex-direction: column;
flex-direction: column-reverse;
.body {
overflow: scroll;
flex: 1;
height: 0;
display: flex;
flex-direction: column-reverse;
.scroll {
display: flex;
flex-direction: column-reverse;
justify-content: flex-end;
.cell {
padding: 10rpx 30rpx;
.cell-system {
text-align: center;
font-size: 24rpx;
color: $text-gray-m;
}
.cell-item {
@@ -225,24 +237,6 @@
}
}
}
.footer {
background: white;
padding: 20rpx 30rpx;
display: flex;
justify-content: space-between;
flex-direction: row;
.msg-type {
width: 70rpx;
height: 70rpx;
.icon {
margin: 5rpx;
width: 60rpx;
height: 60rpx;
}
}
}
}
</style>