diff --git a/.DS_Store b/.DS_Store index 66544f0..4a239b7 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/pages.json b/pages.json index 72c7d45..aa9dec8 100644 --- a/pages.json +++ b/pages.json @@ -356,14 +356,14 @@ "app-plus": { "titleNView": { "buttons": [{ - "float": "right", + "float": "left", "text": "\ue605", "fontSrc": "/static/iconfont.ttf", "color": "#000", "fontSize": "20px" }, { - "float": "left", + "float": "right", "text": "\ue606", "fontSrc": "/static/iconfont.ttf", "color": "#000", @@ -375,20 +375,57 @@ } }, { - "path": "pages/im/detail", + "path": "pages/im/private/index", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "单聊", "app-plus": { "titleNView": { "type": "default", "buttons": [{ "float": "right", - "fontSrc": "/static/uniicons.ttf", - "text": "\ue607" + "fontSrc": "/static/iconfont.ttf", + "text": "\ue607", + "fontSize": "20px" }] } } } + }, + { + "path": "pages/im/private/setting", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "pages/im/friends/index", + "style": { + "navigationBarTitleText": "我的好友" + } + }, + { + "path": "pages/im/friends/pending", + "style": { + "navigationBarTitleText": "新的朋友" + } + }, + { + "path": "pages/im/friends/info", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/im/friends/mine", + "style": { + "navigationBarTitleText": "我的资料" + } + }, + { + "path": "pages/im/group/index", + "style": { + "navigationBarTitleText": "我的群聊" + } }, { "path": "pages/wallet/add", diff --git a/pages/im/friends/index.vue b/pages/im/friends/index.vue index fabc223..d4cca29 100644 --- a/pages/im/friends/index.vue +++ b/pages/im/friends/index.vue @@ -1,14 +1,139 @@ - diff --git a/pages/im/friends/info.vue b/pages/im/friends/info.vue index 48d48ea..f9d78a3 100644 --- a/pages/im/friends/info.vue +++ b/pages/im/friends/info.vue @@ -1,8 +1,21 @@ - - + + - - diff --git a/pages/im/friends/mine.vue b/pages/im/friends/mine.vue index 48d48ea..079e797 100644 --- a/pages/im/friends/mine.vue +++ b/pages/im/friends/mine.vue @@ -1,4 +1,7 @@ + + diff --git a/pages/im/group/index.vue b/pages/im/group/index.vue new file mode 100644 index 0000000..047b2fb --- /dev/null +++ b/pages/im/group/index.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/pages/im/index.vue b/pages/im/index.vue index c0e94ed..93f4792 100644 --- a/pages/im/index.vue +++ b/pages/im/index.vue @@ -20,7 +20,7 @@
- + 去登录
@@ -48,9 +48,11 @@ } }, onLoad() { - getImToken().then(res => { + getImToken().then(res => { im.syncFriends() - im.connect(res.token, res.userInfo) + im.connect(res.token, res.userInfo) + + this.getConversationList() }) }, onShow() { @@ -61,7 +63,14 @@ this.isShown = false }, onNavigationBarButtonTap(e) { - if (e.index == 0) { + if (e.index == 0) {} + if (e.index == 1) { + uni.navigateTo({ + url: '/pages/im/friends/index', + fail: (err) => { + console.log(err); + } + }) } }, watch: { @@ -96,7 +105,7 @@ // 进入聊天的详情页面,清理未读消息数量 toDetail(item) { uni.navigateTo({ - url: '/pages/im/detail?targetId=' + item.targetId + + url: '/pages/im/private/index?targetId=' + item.targetId + '&conversationType=' + item.conversationType }) } @@ -128,7 +137,8 @@ .name { display: flex; - justify-content: space-between; + justify-content: space-between; + font-size: $uni-font-size-base; .time { font-size: $uni-font-size-sm; @@ -137,7 +147,8 @@ } .u-line-1 { - color: $u-info; + color: $u-info; + font-size: $uni-font-size-sm; } } } diff --git a/pages/im/detail.vue b/pages/im/private/index.vue similarity index 93% rename from pages/im/detail.vue rename to pages/im/private/index.vue index 4b04d38..6cb5d5b 100644 --- a/pages/im/detail.vue +++ b/pages/im/private/index.vue @@ -76,18 +76,18 @@ }) RongIMLib.clearMessagesUnreadStatus(this.conversationType, this.targetId, new Date().getTime()) - im.setNotifyBadge() + im.setNotifyBadge() RongIMLib.sendReadReceiptMessage(this.conversationType, this.targetId, new Date().getTime()) this.getMessageList() - + // 监听消息回执 RongIMLib.addReadReceiptReceivedListener((result) => { - const res = result.data.message - if (res.targetId == this.targetId) { - this.getMessageList() - } - }) + const res = result.data.message + if (res.targetId == this.targetId) { + this.getMessageList() + } + }) }, onUnload() { RongIMLib.clearReadReceiptReceivedListener() @@ -97,6 +97,14 @@ return this.inputTxt.length > 0 } }, + onNavigationBarButtonTap(e) { + if (e.index == 0) { + uni.navigateTo({ + url: '/pages/im/private/setting?targetId=' + this.targetId + + '&conversationType=' + this.conversationType + }) + } + }, watch: { '$store.getters.newMessage': function(msg) { if (msg.targetId == this.targetId) { @@ -183,7 +191,7 @@ $footer-height: 55px; .scroll { - height: calc(100vh - 55px); + height: calc(100vh - 55px); width: 100vw; padding: 0 $uni-spacing-col-lg; } @@ -245,7 +253,7 @@ .msg { font-size: $uni-font-size-base; margin: $uni-spacing-col-base; - padding: $uni-spacing-col-lg; + padding: $uni-spacing-col-base; word-wrap: break-word; width: 60%; border-radius: $uni-border-radius-base; diff --git a/pages/im/private/setting.vue b/pages/im/private/setting.vue new file mode 100644 index 0000000..89d97db --- /dev/null +++ b/pages/im/private/setting.vue @@ -0,0 +1,68 @@ + + + + +