This commit is contained in:
2022-02-18 17:22:07 +08:00
2 changed files with 90 additions and 78 deletions

View File

@@ -141,12 +141,13 @@
.sent--popups { .sent--popups {
background: white; background: white;
padding: 30rpx 15rpx; padding: 30rpx 15rpx;
display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
.item { .item {
width: 150rpx; width: 150rpx;
margin: 15rpx; margin: 15rpx;
text-align: center;
} }
.text { .text {

View File

@@ -1,11 +1,8 @@
<template> <template>
<view class="group--chat"> <view class="group--chat">
<sent-message-bar :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" /> <scroll-view class="body" :show-scrollbar="false">
<view class="body">
<view class="scroll">
<view class="cell" v-for="(item, index) in messages" :key="index"> <view class="cell" v-for="(item, index) in messages" :key="index">
<view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }} <view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }}</view>
</view>
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']"> <view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
<u-avatar class="avatar" @click="toUser(item)" size="36" shape="square" <u-avatar class="avatar" @click="toUser(item)" size="36" shape="square"
:src="contact(item.senderUserId).portraitUrl" /> :src="contact(item.senderUserId).portraitUrl" />
@@ -19,8 +16,9 @@
</view> </view>
</view> </view>
</view> </view>
</view> <view class="cell-footer" ref="chatBottom"></view>
</view> </scroll-view>
<sent-message-bar class="message-bar" :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" />
</view> </view>
</template> </template>
@@ -173,27 +171,15 @@
background: $window-color; background: $window-color;
height: 100vh; height: 100vh;
display: flex; display: flex;
flex-direction: column-reverse; flex-direction: column;
.body {
overflow: scroll; overflow: scroll;
.body {
flex: 1; flex: 1;
height: 0;
display: flex;
flex-direction: column-reverse;
.scroll {
display: flex;
flex-direction: column-reverse;
justify-content: flex-end;
.cell { .cell {
padding: 10rpx 30rpx; padding: 10rpx 30rpx;
.cell-system { .cell-system {
text-align: center; text-align: center;
font-size: 24rpx;
color: $text-gray-m;
} }
.cell-item { .cell-item {
@@ -239,6 +225,31 @@
} }
} }
} }
.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;
} }
} }
}
}
.message-bar{
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
</style> </style>