diff --git a/App.vue b/App.vue
index 185135f..6861729 100644
--- a/App.vue
+++ b/App.vue
@@ -5,7 +5,6 @@
export default {
onLaunch: function() {
im.initIm('lmxuhwaglu76d')
- return
//#ifdef APP-PLUS
// 获取系统版本号
getVersions({
diff --git a/components/im/imAUDIO.vue b/components/im/imAUDIO.vue
new file mode 100644
index 0000000..c820dab
--- /dev/null
+++ b/components/im/imAUDIO.vue
@@ -0,0 +1,20 @@
+
+
+ 语音消息
+
+
+
+
+
+
diff --git a/components/im/imIMG.vue b/components/im/imIMG.vue
new file mode 100644
index 0000000..3454b79
--- /dev/null
+++ b/components/im/imIMG.vue
@@ -0,0 +1,20 @@
+
+
+ 图片消息
+
+
+
+
+
+
diff --git a/components/im/imTXT.vue b/components/im/imTXT.vue
new file mode 100644
index 0000000..d3155be
--- /dev/null
+++ b/components/im/imTXT.vue
@@ -0,0 +1,20 @@
+
+
+ 文字消息
+
+
+
+
+
+
diff --git a/pages.json b/pages.json
index f322b7a..0b02e9b 100644
--- a/pages.json
+++ b/pages.json
@@ -573,6 +573,14 @@
"navigationBarBackgroundColor": "#34CE98",
"navigationBarTextStyle": "white"
}
+ },{
+ "path" : "pages/im/private/chat",
+ "style" : {
+ "disableScroll": true,
+ "navigationBarTitleText": "聊天",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor":"#F3F6FB"
+ }
}
],
"tabBar": {
diff --git a/pages/im/friends/group/index.vue b/pages/im/friends/group/index.vue
deleted file mode 100644
index 047b2fb..0000000
--- a/pages/im/friends/group/index.vue
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
- 会首页
-
-
-
-
-
-
diff --git a/pages/im/friends/info.vue b/pages/im/friends/info.vue
index 1f9b382..c1f78b6 100644
--- a/pages/im/friends/info.vue
+++ b/pages/im/friends/info.vue
@@ -55,7 +55,7 @@
视频通话
-
+
@@ -124,84 +124,122 @@
if (code == 0) {
this.isTop = conversation.isTop
}
- })
+ });
},
- 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'
- })
- }
+ },
+ 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
+ })
+ },
+ setStatus() {
+ RongIMLib.setConversationNotificationStatus(this.conversationType, this.targetId, this.status, ({
+ status
}) => {
- this.isTop = conversation.isTop
+ this.status = !Boolean(status)
})
- })
- },
- // 申请好友
- toBeFriend() {
- pedingFriend(this.targetId).then(res => {
- uni.showToast({
- title: '申请成功',
- icon: "none"
+ },
+ setTop() {
+ RongIMLib.setConversationToTop(this.conversationType, this.targetId, this.isTop, (res) => {
+ RongIMLib.getConversation(this.conversationType, this.targetId, ({
+ conversation
+ }) => {
+ this.isTop = conversation.isTop
+ })
})
- }).catch(err => {
- uni.showToast({
- icon: 'error',
- title: err.message,
- duration: 2000
+ },
+ // 申请好友
+ 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) {
@@ -216,7 +254,11 @@
}
})
},
+=======
+ },
+>>>>>>> d3c351f58f900a4484c2811b73ef00ace4632e2b
}
+ }
};
diff --git a/pages/im/index.vue b/pages/im/index.vue
index 961e989..81d01a4 100644
--- a/pages/im/index.vue
+++ b/pages/im/index.vue
@@ -56,7 +56,7 @@
{{item}}
-
+
@@ -74,10 +74,7 @@
import * as RongIMLib from "@/uni_modules/RongCloud-IMWrapper/js_sdk/index"
import im from '@/utils/im/index.js'
import userAuth from '@/public/userAuth'
- import {
- getImToken
- } from '@/apis/interfaces/im.js'
-
+ import { getImToken } from '@/apis/interfaces/im.js'
export default {
data() {
return {
diff --git a/pages/im/private/chat.nvue b/pages/im/private/chat.nvue
new file mode 100644
index 0000000..8bdedef
--- /dev/null
+++ b/pages/im/private/chat.nvue
@@ -0,0 +1,112 @@
+
+
+
+
+ {{toMsg || '-'}} / msg{{item}} - {{index}}
+
+
+
+
+
+
+
+
+