From 572066de9ae3c8d2d9189503dbf3209ed4cf6ffc Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 28 Jan 2022 09:51:22 +0800 Subject: [PATCH] update --- pages/im/friends/info.vue | 238 +++++++++++++++++++------------------- utils/im/index.js | 2 +- 2 files changed, 118 insertions(+), 122 deletions(-) diff --git a/pages/im/friends/info.vue b/pages/im/friends/info.vue index c1f78b6..b9c505a 100644 --- a/pages/im/friends/info.vue +++ b/pages/im/friends/info.vue @@ -126,140 +126,136 @@ } }); }, - toPrivate() { - uni.redirectTo({ - url: '/pages/im/private/index?conversationType=1&targetId=' + this.targetId - }); - }, - setRemark() { - uni.showToast({ - title: '开发中', - icon: 'none' - }); - }, - deleteFriend() { - uni.showModal({ - title: '删除确认', - content: '确认删除后不可恢复', - success: e => { - if (e.confirm) { - deleteFriend(this.targetId).then(res => { - // 删除聊天记录 - RongIMLib.deleteMessages(1, this.targetId); - RongIMLib.removeConversation(1, this.targetId); - uni.showToast({ - icon: 'none', - title: '好友删除成功', - success() { - uni.switchTab({ - url: '/pages/im/index' - }); - } - }); - }); - } + methods: { + copyAddress() { + uni.setClipboardData({ + data: this.userInfo.address, + success: () => { + uni.showToast({ + icon: 'none', + title: '复制成功' }) - }, - toPrivate() { - uni.redirectTo({ - url: '/pages/im/private/index?conversationType=1&targetId=' + this.targetId - }) - }, - setRemark() { - uni.showToast({ - title: '开发中', - icon: 'none' - }) - }, - deleteFriend() { - uni.showModal({ - title: '删除确认', - content: '确认删除后不可恢复', - success: (e) => { - if (e.confirm) { - deleteFriend(this.targetId).then(res => { - // 删除聊天记录 - RongIMLib.deleteMessages(1, this.targetId) - RongIMLib.removeConversation(1, this.targetId) - uni.showToast({ - icon: 'none', - title: '好友删除成功', - success() { - uni.switchTab({ - url: '/pages/im/index' - }) - } - }) + } + }) + }, + toPrivate() { + uni.redirectTo({ + url: '/pages/im/private/index?conversationType=1&targetId=' + this.targetId + }); + }, + setRemark() { + uni.showToast({ + title: '开发中', + icon: 'none' + }); + }, + deleteFriend() { + uni.showModal({ + title: '删除确认', + content: '确认删除后不可恢复', + success: e => { + if (e.confirm) { + deleteFriend(this.targetId).then(res => { + // 删除聊天记录 + RongIMLib.deleteMessages(1, this.targetId); + RongIMLib.removeConversation(1, this.targetId); + uni.showToast({ + icon: 'none', + title: '好友删除成功', + success() { + uni.switchTab({ + url: '/pages/im/index' + }) + } }) - } + }) } - }) - }, - setStatus() { - RongIMLib.setConversationNotificationStatus(this.conversationType, this.targetId, this.status, ({ + } + }) + }, + toPrivate() { + uni.redirectTo({ + url: '/pages/im/private/index?conversationType=1&targetId=' + this.targetId + }) + }, + setRemark() { + uni.showToast({ + title: '开发中', + icon: 'none' + }) + }, + deleteFriend() { + uni.showModal({ + title: '删除确认', + content: '确认删除后不可恢复', + success: (e) => { + if (e.confirm) { + deleteFriend(this.targetId).then(res => { + // 删除聊天记录 + RongIMLib.deleteMessages(1, this.targetId) + RongIMLib.removeConversation(1, this.targetId) + uni.showToast({ + icon: 'none', + title: '好友删除成功', + success() { + uni.switchTab({ + url: '/pages/im/index' + }) + } + }) + }) + } + } + }) + }, + setStatus() { + RongIMLib.setConversationNotificationStatus(this.conversationType, this.targetId, this.status, + ({ status }) => { this.status = !Boolean(status) }) - }, - setTop() { - RongIMLib.setConversationToTop(this.conversationType, this.targetId, this.isTop, (res) => { - RongIMLib.getConversation(this.conversationType, this.targetId, ({ - conversation - }) => { - this.isTop = conversation.isTop - }) + }, + setTop() { + RongIMLib.setConversationToTop(this.conversationType, this.targetId, this.isTop, (res) => { + RongIMLib.getConversation(this.conversationType, this.targetId, ({ + conversation + }) => { + this.isTop = conversation.isTop }) - }, - // 申请好友 - toBeFriend() { - pedingFriend(this.targetId).then(res => { - uni.showToast({ - title: '申请成功', - icon: 'none' - }); - - }) - .catch(err => { - uni.showToast({ - icon: 'error', - title: err.message, - duration: 2000 - }) - }) - }, - singleCall(e) { - CallLib.startSingleCall(this.targetId, e.type, ''); - uni.redirectTo({ - url: '/pages/im/private/call', - success: (err) => { - console.log('跳转视频通话成功'); - }, - fail: (err) => { - console.log('跳转视频页失败', err); - } - }) -<<<<<<< HEAD }) }, - singleCall(e) { - CallLib.startSingleCall(this.targetId, e.type, ''); - uni.redirectTo({ - url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type, - success: (err) => { - console.log('跳转视频通话成功'); - }, - fail: (err) => { - console.log('跳转视频页失败', err); - } - }) + // 申请好友 + toBeFriend() { + pedingFriend(this.targetId).then(res => { + uni.showToast({ + title: '申请成功', + icon: 'none' + }); + + }) + .catch(err => { + uni.showToast({ + icon: 'error', + title: err.message, + duration: 2000 + }) + }) }, -======= - }, ->>>>>>> d3c351f58f900a4484c2811b73ef00ace4632e2b + singleCall(e) { + CallLib.startSingleCall(this.targetId, e.type, ''); + uni.redirectTo({ + url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type, + success: (err) => { + console.log('跳转视频通话成功'); + }, + fail: (err) => { + console.log('跳转视频页失败', err); + } + }) + } } } - };