...
This commit is contained in:
@@ -36,7 +36,6 @@
|
|||||||
methods: {
|
methods: {
|
||||||
resolve() {
|
resolve() {
|
||||||
resolveFriend(this.message.sourceUserId).then(res => {
|
resolveFriend(this.message.sourceUserId).then(res => {
|
||||||
this.clearMessages()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '通过好友申请'
|
title: '通过好友申请'
|
||||||
@@ -47,6 +46,8 @@
|
|||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: err.message
|
title: err.message
|
||||||
})
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
this.clearMessages()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
reject() {
|
reject() {
|
||||||
@@ -70,9 +71,9 @@
|
|||||||
clearMessages() {
|
clearMessages() {
|
||||||
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
|
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
uni.$emit('onNewContactConversation', message)
|
uni.$emit('onNewContactConversation')
|
||||||
uni.$emit('onNewContactFriends', message)
|
uni.$emit('onNewContactFriends')
|
||||||
uni.$emit('onNewContactPendings', message)
|
uni.$emit('onNewContactPendings')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,10 +57,10 @@
|
|||||||
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
if (this.content.local && this.content.local.indexOf('///data/user/') < 0) {
|
||||||
this.showImage(this.content.local)
|
this.showImage(this.content.local)
|
||||||
} else {
|
} else {
|
||||||
|
this.showImage(this.content.remote)
|
||||||
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
RongIMLib.downloadMediaMessage(this.message.messageId, {
|
||||||
success: (path) => {
|
success: (path) => {
|
||||||
this.content.local = path
|
this.content.local = path
|
||||||
this.showImage(path)
|
|
||||||
},
|
},
|
||||||
error: (errorCode, messageId) => {
|
error: (errorCode, messageId) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|||||||
@@ -12,15 +12,21 @@
|
|||||||
</view>
|
</view>
|
||||||
<block v-if="friends.length > 0">
|
<block v-if="friends.length > 0">
|
||||||
<u-index-item v-for="(item, fkey) in friends" :key="fkey">
|
<u-index-item v-for="(item, fkey) in friends" :key="fkey">
|
||||||
<u-index-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666" class="anchor" />
|
<u-index-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666"
|
||||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex" @click="toFriend(friendItem.targetId)">
|
class="anchor" />
|
||||||
<u-avatar class="avatar-img" size="40" shape="square" :src="contact(friendItem.targetId).portraitUrl" />
|
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||||
<view class="info"> <view class="name">{{ contact(friendItem.targetId).name }}</view> </view>
|
@click="toFriend(friendItem.targetId)">
|
||||||
|
<u-avatar class="avatar-img" size="40" shape="square"
|
||||||
|
:src="contact(friendItem.targetId).portraitUrl" />
|
||||||
|
<view class="info">
|
||||||
|
<view class="name">{{ contact(friendItem.targetId).name }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-index-item>
|
</u-index-item>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src=" require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
|
:src=" require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
||||||
<span>暂无好友列表~</span>
|
<span>暂无好友列表~</span>
|
||||||
</view>
|
</view>
|
||||||
</u-index-list>
|
</u-index-list>
|
||||||
@@ -28,7 +34,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getFriendsLetter} from '@/apis/interfaces/im';
|
import {
|
||||||
|
getFriendsLetter
|
||||||
|
} from '@/apis/interfaces/im';
|
||||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
|
|
||||||
@@ -47,18 +55,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
uni.$on('onNewContactFriends', this.checkNewFriendPending)
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getFriendList()
|
this.getFriendList()
|
||||||
this.checkNewFriendPending()
|
this.checkNewFriendPending()
|
||||||
uni.$on('onContactNotification', this.checkNewFriendPending)
|
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off("onContactNotification")
|
uni.$off("onNewContactFriends")
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getFriendList() {
|
getFriendList() {
|
||||||
getFriendsLetter().then(res => {
|
getFriendsLetter().then(res => {
|
||||||
console.log(res)
|
|
||||||
this.indexs = res.indexList
|
this.indexs = res.indexList
|
||||||
this.friends = res.itemArr
|
this.friends = res.itemArr
|
||||||
})
|
})
|
||||||
@@ -70,10 +79,7 @@
|
|||||||
},
|
},
|
||||||
toGroup() {
|
toGroup() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/group/index',
|
url: '/pages/im/group/index'
|
||||||
fail(err) {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toFriend(targetId) {
|
toFriend(targetId) {
|
||||||
@@ -85,13 +91,13 @@
|
|||||||
toPending() {
|
toPending() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/friends/pending'
|
url: '/pages/im/friends/pending'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/friends/search'
|
url: '/pages/im/friends/search'
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -160,6 +166,7 @@
|
|||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-lists {
|
.no-lists {
|
||||||
padding-top: $padding * 3;
|
padding-top: $padding * 3;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="pending">
|
<view class="pending">
|
||||||
<u-sticky>
|
<u-sticky>
|
||||||
<view class="header-search" @click="$Router.push({ name: 'SearchFriend' })">
|
<view class="header-search" @click="$Router.push({ name: 'SearchFriend' })">
|
||||||
<u-search placeholder="输入手机号码搜索" height="74" searchIcon="search" inputAlign="center" bgColor="white"
|
<u-search placeholder="输入手机号码搜索" searchIcon="search" inputAlign="center" bgColor="white"
|
||||||
:disabled="true" :show-action="false" />
|
:disabled="true" :show-action="false" />
|
||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
|
|||||||
@@ -11,14 +11,16 @@
|
|||||||
<!-- 搜索 、 -->
|
<!-- 搜索 、 -->
|
||||||
<u-sticky>
|
<u-sticky>
|
||||||
<view class="header-search">
|
<view class="header-search">
|
||||||
<u-search placeholder="输入用户账号、手机号" height="74" searchIcon="search" @custom="search" v-model="searchValue" @search="search" bgColor="#f9f9f9" :focus="focused" />
|
<u-search placeholder="输入用户账号、手机号" searchIcon="search" @custom="search" v-model="searchValue"
|
||||||
|
@search="search" bgColor="#f9f9f9" :focus="focused" />
|
||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
<block v-if="searchResult.length > 0">
|
<block v-if="searchResult.length > 0">
|
||||||
<applyFriend :lists="searchResult" :isApply="true" @action="action" />
|
<applyFriend :lists="searchResult" :isApply="true" @action="action" />
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src="require('@/static/imgs/no-search.png')" :lazy-load="true" />
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
|
:src="require('@/static/imgs/no-search.png')" :lazy-load="true" />
|
||||||
<span>暂无匹配内容~</span>
|
<span>暂无匹配内容~</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -53,9 +53,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.initGroupInfo()
|
||||||
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.targetId = e.targetId
|
this.targetId = e.targetId
|
||||||
this.initGroupInfo()
|
|
||||||
// 获取历史消息列表
|
// 获取历史消息列表
|
||||||
this.getMessageList()
|
this.getMessageList()
|
||||||
// 监听新消息
|
// 监听新消息
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
<view v-for="(item, index) in groups" :key="index" class="friend-flex" @click="toGroup(item.targetId)">
|
<view v-for="(item, index) in groups" :key="index" class="friend-flex" @click="toGroup(item.targetId)">
|
||||||
<u-avatar size="36" shape="square" :src="item.portraitUrl !== ''?contact(item.targetId).portraitUrl :require('@/static/user/cover-s.png')" />
|
<u-avatar size="36" shape="square" :src="item.portraitUrl !== ''?contact(item.targetId).portraitUrl :require('@/static/user/cover-s.png')" />
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name">{{item.name}} <span class="total">共{{item.people_count}} 成员</span></view>
|
<view class="name">{{ item.name }} <span class="total">共{{ item.members }} 成员</span></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="group-count"> {{groups.length}}个群聊 </view>
|
<view class="group-count"> {{ groups.length }}个群聊 </view>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src="require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx" :src="require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<view class="no-lists" v-else>
|
<view class="no-lists" v-else>
|
||||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||||
:src="require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
:src="require('@/static/imgs/no-friend.png')" :lazy-load="true" />
|
||||||
<span> 暂无群聊申请数据~</span>
|
<span>暂无群聊申请数据</span>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -82,7 +82,6 @@
|
|||||||
uni.$emit('groupInvitedUser')
|
uni.$emit('groupInvitedUser')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: err.message,
|
// title: err.message,
|
||||||
|
|||||||
@@ -59,7 +59,11 @@
|
|||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
||||||
// 监听新的好友申请
|
// 监听新的好友申请
|
||||||
uni.$on('onNewContactConversation', this.checkNewFriendPending)
|
uni.$on('onNewContactConversation', () => {
|
||||||
|
console.log('更新好友申请数量');
|
||||||
|
// 更新好友申请数量
|
||||||
|
this.checkNewFriendPending()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// 好友申请数量
|
// 好友申请数量
|
||||||
|
|||||||
Reference in New Issue
Block a user