申请加好友认证信息优化,好友列表无好友状态处理
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
},
|
||||
methods: {
|
||||
resolve() {
|
||||
resolveFriend(this.message.sourceUserId).then(res => {
|
||||
resolveFriend(this.message.sourceUserId).then(res => {
|
||||
this.clearMessages()
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
|
||||
@@ -2,40 +2,33 @@
|
||||
<view>
|
||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||
<view class="friend-flex" @click="toPending">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_01.png')"></u-avatar>
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_01.png')" />
|
||||
<u-badge max="99" absolute :offset="[23, 20]" :value="pendingCount" />
|
||||
<view class="info">新的朋友</view>
|
||||
</view>
|
||||
<view class="friend-flex" @click="toGroup">
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_00.png')"></u-avatar>
|
||||
<u-avatar class="cover" size="40" shape="square" :src="require('@/static/im/im_00.png')" />
|
||||
<view class="info">我的群聊</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-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666"
|
||||
class="anchor" />
|
||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||
@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 class="address">地址:{{ friendItem.address }}</view> -->
|
||||
</view>
|
||||
<u-index-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666" class="anchor" />
|
||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex" @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>
|
||||
</u-index-item>
|
||||
</block>
|
||||
<block v-else>
|
||||
<u-empty class="pages-null" mode="data" text="暂无好友" />
|
||||
</block>
|
||||
<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" />
|
||||
<span>暂无好友列表~</span>
|
||||
</view>
|
||||
</u-index-list>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<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 im from '@/utils/im/index.js'
|
||||
|
||||
@@ -54,16 +47,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.getFriendList()
|
||||
this.checkNewFriendPending()
|
||||
uni.$on('onContactNotification', this.checkNewFriendPending)
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off("onContactNotification")
|
||||
},
|
||||
methods: {
|
||||
getFriendList() {
|
||||
getFriendsLetter().then(res => {
|
||||
getFriendsLetter().then(res => {
|
||||
console.log(res)
|
||||
this.indexs = res.indexList
|
||||
this.friends = res.itemArr
|
||||
this.friends = res.itemArr
|
||||
})
|
||||
},
|
||||
checkNewFriendPending() {
|
||||
@@ -86,18 +83,9 @@
|
||||
},
|
||||
// 新朋友
|
||||
toPending() {
|
||||
// if (this.pendingCount > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/pending'
|
||||
});
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: ` 暂无好友申请 ~ `,
|
||||
// icon: "none",
|
||||
// mask: true,
|
||||
// duration: 3000
|
||||
// })
|
||||
// }
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
@@ -171,5 +159,19 @@
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
background-color: #fff;
|
||||
}
|
||||
.no-lists {
|
||||
padding-top: $padding * 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray-m;
|
||||
|
||||
span {
|
||||
padding-top: $padding;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
pedingFriend(this.targetId, 'message').then(res => {
|
||||
pedingFriend(this.targetId, '').then(res => {
|
||||
uni.showToast({
|
||||
title: ` 申请成功,等待审核 `,
|
||||
icon: 'none',
|
||||
|
||||
@@ -33,13 +33,14 @@
|
||||
bg: '#fff'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.getPendingList()
|
||||
uni.$on('onContactNotification', this.getPendingList)
|
||||
},
|
||||
methods: {
|
||||
getPendingList() {
|
||||
im.getPendingList((pendings) => {
|
||||
console.log(pendings,'res......')
|
||||
if (pendings.length > 0) {
|
||||
this.bg = '#f9f9f9'
|
||||
} else {
|
||||
|
||||
BIN
static/.DS_Store
vendored
BIN
static/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user