stash
This commit is contained in:
@@ -1,24 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="group--chat">
|
<view class="group--chat">
|
||||||
<scroll-view class="body" :show-scrollbar="false">
|
<sent-message-bar :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" />
|
||||||
<view class="cell" v-for="(item, index) in messages" :key="index">
|
<view class="body">
|
||||||
<view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }}</view>
|
<view class="scroll">
|
||||||
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
<view class="cell" v-for="(item, index) in messages" :key="index">
|
||||||
<u-avatar class="avatar" @click="toUser(item)" size="36" shape="square"
|
<view class="cell-system" v-if="item.senderUserId === '__system__'">{{ item.content.message }}
|
||||||
:src="contact(item.senderUserId).portraitUrl" />
|
</view>
|
||||||
<view class="msg">
|
<view v-else :class="['cell-item', item.messageDirection == 1 ? 'right' : 'left']">
|
||||||
<show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1"
|
<u-avatar class="avatar" @click="toUser(item)" size="36" shape="square"
|
||||||
:msg="item.content" :name="contact(item.senderUserId).name" />
|
:src="contact(item.senderUserId).portraitUrl" />
|
||||||
<show-image v-if="item.objectName === 'RC:ImgMsg'" :guest="item.messageDirection == 1"
|
<view class="msg">
|
||||||
:msg="item.content" :name="contact(item.senderUserId).name" />
|
<show-voice v-if="item.objectName === 'RC:HQVCMsg'" :guest="item.messageDirection == 1"
|
||||||
<show-text v-if="item.objectName === 'RC:TxtMsg'" :guest="item.messageDirection == 1"
|
:msg="item.content" :name="contact(item.senderUserId).name" />
|
||||||
:msg="item.content" :name="contact(item.senderUserId).name" />
|
<show-image v-if="item.objectName === 'RC:ImgMsg'" :guest="item.messageDirection == 1"
|
||||||
|
:msg="item.content" :name="contact(item.senderUserId).name" />
|
||||||
|
<show-text v-if="item.objectName === 'RC:TxtMsg'" :guest="item.messageDirection == 1"
|
||||||
|
:msg="item.content" :name="contact(item.senderUserId).name" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cell-footer" ref="chatBottom"></view>
|
</view>
|
||||||
</scroll-view>
|
|
||||||
<sent-message-bar :conversationType="conversationType" :targetId="targetId" @onSuccess="getNewMessage()" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -169,78 +171,70 @@
|
|||||||
background: $window-color;
|
background: $window-color;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column-reverse;
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
height: 0;
|
||||||
.cell {
|
|
||||||
padding: 10rpx 30rpx;
|
|
||||||
|
|
||||||
.cell-system {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cell-item {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
width: 690rpx;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: flex-start;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
|
|
||||||
&.left {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.right {
|
|
||||||
flex-direction: row-reverse;
|
|
||||||
|
|
||||||
.state {
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar {
|
|
||||||
width: 78rpx;
|
|
||||||
height: 78rpx;
|
|
||||||
background-color: white;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.msg {
|
|
||||||
margin: 0 20rpx;
|
|
||||||
|
|
||||||
.user {
|
|
||||||
font-size: 18rpx;
|
|
||||||
line-height: 40rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cell-footer {
|
|
||||||
height: 20rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
background: white;
|
|
||||||
padding: 20rpx 30rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-direction: column-reverse;
|
||||||
flex-direction: row;
|
|
||||||
|
|
||||||
.msg-type {
|
.scroll {
|
||||||
width: 70rpx;
|
display: flex;
|
||||||
height: 70rpx;
|
flex-direction: column-reverse;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
.icon {
|
.cell {
|
||||||
margin: 5rpx;
|
padding: 10rpx 30rpx;
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
.cell-system {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: $text-gray-m;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 690rpx;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
&.left {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.right {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
|
.state {
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 78rpx;
|
||||||
|
height: 78rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
|
||||||
|
.user {
|
||||||
|
font-size: 18rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-footer {
|
||||||
|
height: 20rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user