This commit is contained in:
2022-02-08 14:24:23 +08:00
12 changed files with 125 additions and 42 deletions

View File

@@ -1,6 +1,15 @@
<template>
<view class="sent--text">
<input class="input" type="text" @focus="focus" @blur="blur" v-model="inputTxt" confirm-type="send" @confirm="sent" cursor-spacing="10" />
<input
class="input"
type="text"
@focus="focus"
@blur="blur"
v-model="inputTxt"
confirm-type="send"
@confirm="sent"
cursor-spacing="10"
/>
<!-- <button class="button" size="mini" :disabled="disabled" @click="sent">发送</button> -->
</view>
</template>
@@ -71,7 +80,7 @@
.input {
background: #F3F6FB;
height: 70rpx;
width: 460rpx;
width: 500rpx;
border-radius: 10rpx;
margin-right: 15rpx;
padding: 0 20rpx;

View File

@@ -102,7 +102,7 @@
line-height: 70rpx;
justify-content: center;
align-items: center;
width: 460rpx;
width: 500rpx;
border-radius: 10rpx;
margin-right: 15rpx;

View File

@@ -7,11 +7,11 @@
<view class="tabs">
<view class="item show">
私聊
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="5" />
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="privateUnread" />
</view>
<view class="item" @click="onNav('', {})">
群聊
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="10" />
<u-badge absolute max="99" shape="horn" :offset="[-7, -7]" :value="groupUnread" />
</view>
</view>
@@ -95,6 +95,8 @@
/* 弹窗定位样式 */
popStyle: "",
pickedItem: {},
privateUnread: 0,
groupUnread: 0,
hasNewFriends: true
}
},
@@ -120,6 +122,12 @@
uni.$on('onReceiveMessage', (msg) => {
console.log('收到消息,刷新列表');
this.getConversationList()
// todo ,不知道这个获取未读数量的,有没有办法能获取私聊的,还有群组的
// RongIMLib.getTotalUnreadCount(({
// count
// }) => {
// this.privateUnread = count
// })
})
this.isShown = true
},
@@ -203,7 +211,6 @@
const timestamp = 0
RongIMLib.getConversationList([RongIMLib.ConversationType.PRIVATE], count, timestamp, (res) => {
if (res.code === 0) {
console.log(res.conversations);
this.conversations = res.conversations
}
})
@@ -273,6 +280,7 @@
line-height: 60rpx;
.tabs {
.item {
position: relative;
margin-left: $margin;

View File

@@ -36,13 +36,12 @@
@success="getMessageList" />
<sent-text v-if="chatType === 1" :conversationType="conversationType" :targetId="targetId"
@success="getMessageList" />
<view class="msg-type" @click="showPopups = !showPopups">
<view class="msg-type msg-popups" @click="scrollBottom('msgPopups')">
<image class="icon" src="@/static/icon/popups-icon.png"></image>
</view>
</view>
<!-- 弹出层 -->
<sent-popups :show="showPopups" :conversationType="conversationType" :targetId="targetId"
@success="() => {showPopups = false, getMessageList()}"></sent-popups>
<sent-popups :show="showPopups" :conversationType="conversationType" :targetId="targetId" @success="() => {showPopups = false, getMessageList()}"></sent-popups>
</view>
</template>
@@ -148,10 +147,14 @@
})
},
// 滚动到底部
scrollBottom() {
scrollBottom(type) {
if(type === 'msgPopups'){
this.showPopups = !this.showPopups
}
setTimeout(() => {
let el = this.$refs.chatBottom
ChatList.scrollToElement(el, {
ChatList.scrollToElement(el, {
offset: 0,
animated: false
})
}, 50)
@@ -165,19 +168,14 @@
.chat {
background: $window-color;
flex: 1;
.body {
flex: 1;
.cell {
.body {
flex: 1;
.cell {
padding: 10rpx 30rpx;
.time {
justify-content: center;
align-items: center;
padding-bottom: 20rpx;
padding-bottom: 20rpx;
.text {
background: #fff;
font-size: 24rpx;
@@ -238,12 +236,10 @@
padding: 20rpx 30rpx;
display: flex;
justify-content: space-between;
flex-direction: row;
flex-direction: row;
.msg-type {
width: 70rpx;
height: 70rpx;
.icon {
margin: 5rpx;
width: 60rpx;