diff --git a/pages.json b/pages.json
index 9d8aede..a5b52d1 100644
--- a/pages.json
+++ b/pages.json
@@ -373,19 +373,6 @@
{
"path": "pages/im/private/chat",
"style": {
- "navigationBarBackgroundColor":"#FFFFFF",
- "disableScroll": false,
- "app-plus": {
- "titleNView": {
- "type": "default",
- "buttons": [{
- "float": "right",
- "fontSrc": "/static/iconfont.ttf",
- "text": "\ue607",
- "fontSize": "20px"
- }]
- }
- }
}
},
{
@@ -464,7 +451,7 @@
{
"path": "pages/im/group/chat",
"name": "imGroupChat",
- "style": {
+ "style": {
"navigationBarTitleText": "群聊",
"app-plus": {
"titleNView": {
diff --git a/pages/im/components/connectionStatus.vue b/pages/im/components/connectionStatus.vue
index 3009e43..f15b684 100644
--- a/pages/im/components/connectionStatus.vue
+++ b/pages/im/components/connectionStatus.vue
@@ -1,67 +1,67 @@
-
-
-
-
-
-
-
diff --git a/pages/im/components/conversationList.vue b/pages/im/components/conversationList.vue
index bf3cab8..4858aa6 100644
--- a/pages/im/components/conversationList.vue
+++ b/pages/im/components/conversationList.vue
@@ -1,10 +1,9 @@
-
-
@@ -131,6 +130,10 @@
&.is-top {
background: $window-color;
+ }
+
+ &.is-active {
+ background: #F8FAFF;
}
}
diff --git a/pages/im/components/groupUserList.vue b/pages/im/components/groupUserList.vue
index 12543e9..4cdfacb 100644
--- a/pages/im/components/groupUserList.vue
+++ b/pages/im/components/groupUserList.vue
@@ -61,8 +61,13 @@
actionMap: [],
actionTitle: '',
currentUser: {},
+<<<<<<< HEAD
avatarSize: 45,
labelSize: 14,
+=======
+ avatarSize: 84,
+ labelSize: 14,
+>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
iconSize: 14
}
},
@@ -73,10 +78,17 @@
}
}
},
+<<<<<<< HEAD
created() {
this.avatarSize = utils.rpx2px(90)
this.labelSize = utils.rpx2px(24)
this.iconSize = utils.rpx2px(26)
+=======
+ created() {
+ this.avatarSize = utils.rpx2px(84)
+ this.labelSize = utils.rpx2px(24)
+ this.iconSize = utils.rpx2px(26)
+>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
},
mounted() {
this.initGroupInfo()
@@ -273,8 +285,8 @@
.avatar {
border-radius: 0 8rpx 0 0;
position: relative;
- width: 90rpx;
- height: 90rpx;
+ width: 84rpx;
+ height: 84rpx;
overflow: hidden;
.admin {
diff --git a/pages/im/components/messageCell.vue b/pages/im/components/messageCell.vue
index 23ace13..df717cb 100644
--- a/pages/im/components/messageCell.vue
+++ b/pages/im/components/messageCell.vue
@@ -2,7 +2,7 @@
-
+
-
+
@@ -76,13 +76,7 @@
onHide() {
uni.$off('onReceiveMessage')
},
- methods: {
- onDemo(){
- console.log('1111')
- uni.navigateTo({
- url: '/pages/im/chatDemo'
- })
- },
+ methods: {
checkNewFriendPending() {
im.getPendingList((pendings) => {
this.hasNewFriends = pendings.length
diff --git a/pages/im/private/call.nvue b/pages/im/private/call.nvue
index 2a564a9..85b5eba 100644
--- a/pages/im/private/call.nvue
+++ b/pages/im/private/call.nvue
@@ -75,18 +75,19 @@
// 关闭扬声器
volumeOff: false,
// 通话时长
- duration: 0
+ duration: 0,
+ interval: null
}
},
onLoad(e) {
this.avatarSize = utils.rpx2px(200)
this.targetId = e.targetId
this.mediaType = e.mediaType
- this.isCall = Boolean(e.isCall)
+ this.isCall = Boolean(e.isCall)
// 进入页面开启外呼
if (this.isCall) {
CallLib.startSingleCall(this.targetId, this.mediaType, '');
- if (this.mediaType == '1') {
+ if (this.mediaType == 1) {
const session = CallLib.getCurrentCallSession()
setTimeout(() => {
CallLib.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false)
@@ -107,7 +108,6 @@
this.bigVideoStyle = {
width: this.windowWidth + 'px',
height: this.windowHeight + 'px',
- // backgroundImage: `url("${this.contact(this.targetId).portraitUrl}")`
}
this.movableAreaStyle = {
width: this.windowWidth + 'px',
@@ -131,8 +131,8 @@
}
},
methods: {
- afterHangup() {
- const conversationType = IMLib.ConversationType.PRIVATE // 会话类型
+ afterHangup() {
+ clearInterval(this.interval)
const targetId = this.targetId
const sentStatus = 30
const messageContent = {
@@ -144,19 +144,12 @@
duration: this.duration
})
}
- const sentTime = 0 // 消息的发送时间
- IMLib.insertOutgoingMessage(conversationType, targetId, sentStatus, messageContent, sentTime,
- ({
- code,
- message
- }) => {
- console.log(code);
- // 插入消息成功
- if (code === 0) {
- console.log(message)
- }
- }
- )
+ const sentTime = 0
+ if (this.isCall) {
+ IMLib.insertOutgoingMessage(1, targetId, sentStatus, messageContent, sentTime)
+ } else {
+ IMLib.insertIncomingMessage(1, targetId, targetId, sentStatus, messageContent, sentTime)
+ }
uni.$emit('onReceiveMessage', {
targetId: this.targetId
})
@@ -180,34 +173,37 @@
// 设置链接状态
this.connected = true
// 视频通话,才开摄像头
- if (this.mediaType == '1') {
+ if (this.mediaType == 1) {
const session = CallLib.getCurrentCallSession()
setTimeout(() => {
CallLib.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0, false)
CallLib.setVideoView(session.mine.userId, this.$refs.smallVideoView.ref, 0, true)
}, 200)
- }
+ }
+ this.interval = setInterval(() => {
+ this.duration++
+ }, 1000)
},
// 切换主屏显示人
changeMine() {
- if (this.isCall) {
- const session = CallLib.getCurrentCallSession()
- setTimeout(() => {
- CallLib.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0, false)
- CallLib.setVideoView(session.mine.userId, this.$refs.smallVideoView.ref, 0, true)
- }, 200)
- } else {
- const session = CallLib.getCurrentCallSession()
- setTimeout(() => {
- CallLib.setVideoView(session.targetId, this.$refs.smallVideoView.ref, 0, true)
- CallLib.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false)
- }, 200)
- }
- this.isCall = !this.isCall
+ // if (this.isCall) {
+ // const session = CallLib.getCurrentCallSession()
+ // setTimeout(() => {
+ // CallLib.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0, false)
+ // CallLib.setVideoView(session.mine.userId, this.$refs.smallVideoView.ref, 0, true)
+ // }, 200)
+ // } else {
+ // const session = CallLib.getCurrentCallSession()
+ // setTimeout(() => {
+ // CallLib.setVideoView(session.targetId, this.$refs.smallVideoView.ref, 0, true)
+ // CallLib.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false)
+ // }, 200)
+ // }
+ // this.isCall = !this.isCall
},
hangup() {
- this.afterHangup()
CallLib.hangup()
+ this.afterHangup()
this.stopRing()
setTimeout(() => {
diff --git a/pages/im/private/chat.vue b/pages/im/private/chat.vue
index 66118e3..d9c6bef 100644
--- a/pages/im/private/chat.vue
+++ b/pages/im/private/chat.vue
@@ -7,7 +7,7 @@
{{ item.sentTime|timeCustomCN }}
-
@@ -37,7 +37,9 @@
import showImage from '../components/showImage'
import showText from '../components/showText'
import showCall from '../components/showCall'
- import sentMessageBar from '../components/sentMessageBar'
+ import sentMessageBar from '../components/sentMessageBar'
+ import utils from '@/utils/index.js'
+
export default {
components: {
sentMessageBar,
@@ -47,7 +49,8 @@
showCall
},
data() {
- return {
+ return {
+ avatarRpx: 84,
targetId: '',
messages: [],
conversationType: 1,
@@ -58,7 +61,10 @@
}
}
},
- computed: {
+ computed: {
+ avatarSize() {
+ return utils.rpx2px(this.avatarRpx)
+ },
latestMessage() {
if (this.messages.length) {
return this.messages[0]
@@ -95,7 +101,7 @@
}
})
// 监听收到新消息,判断是否是当前会话,更新会话内容
- uni.$on('onReceiveMessage', (msg) => {
+ uni.$on('onReceiveMessage', (msg) => {
if (msg.targetId == this.targetId) {
this.getNewMessage()
}
@@ -179,7 +185,8 @@
.time {
text-align: center;
font-size: 24rpx;
- color: #666;
+ color: #666;
+ margin-bottom: 10rpx;
}
.cell-item {