This commit is contained in:
2022-02-18 17:45:52 +08:00
parent a290ad8df8
commit ae7b9ead46
3 changed files with 29 additions and 25 deletions

View File

@@ -85,18 +85,18 @@
},
// 新朋友
toPending() {
if (this.pendingCount > 0) {
// if (this.pendingCount > 0) {
uni.navigateTo({
url: '/pages/im/friends/pending'
});
} else {
uni.showToast({
title: ` 暂无好友申请 ~ `,
icon: "none",
mask: true,
duration: 3000
})
}
// } else {
// uni.showToast({
// title: ` 暂无好友申请 ~ `,
// icon: "none",
// mask: true,
// duration: 3000
// })
// }
}
},
onNavigationBarButtonTap(e) {

View File

@@ -1,7 +1,7 @@
<template>
<view class="container">
<view class="members u-border-bottom">
<group-user-list :targetId="targetId" :count="14" />
<group-user-list ref="userList" :targetId="targetId" :count="14" />
</view>
<u-cell-group class="cells" :border="false" >
@@ -94,11 +94,15 @@
})
this.initData()
uni.$on('groupAnnouncementCreated', this.initData)
uni.$on('groupInvitedUser', this.updateUserList)
},
onUnload() {
uni.$off('groupAnnouncementCreated')
},
methods: {
updateUserList() {
this.$refs.userList.initUsers()
},
initData() {
getGroupInfo(this.targetId).then(res => {
console.log(res,'群信息。。。。。')

View File

@@ -13,12 +13,12 @@
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
@click="addContact(friendItem.targetId)">
<u-checkbox :name="friendItem.targetId" shape="circle" activeColor="#34ce98"
style="margin-right: 20rpx;" :disabled="canSelect(friendItem.targetId)" />
style="margin-right: 20rpx;" :disabled="canSelect(friendItem.targetId)"
:checked="canSelect(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">Hash:{{ friendItem.address }}</view> -->
</view>
</view>
</u-index-item>
@@ -78,19 +78,14 @@
this.friends = this.orignalFriends.map((list, index) => {
const resList = list.filter(item => item.name.indexOf(val) > 0)
if (resList.length > 0) {
this.indexs.filter((t, i) => i == index)
this.indexs = this.orignalIndexs.map((t, i) => {})
} else {
return;
}
// if (resList.length > 0) {
// ix = this.orignalIndexs.map((t, i) => {
// if (i == index) {
// return t
// }
// }).filter(Boolean)
// }
return resList
})
this.friends = this.friends.filter(n => n)
console.log( this.indexs);
} else {
this.friends = this.orignalFriends
this.indexs = this.orignalIndexs
@@ -116,11 +111,16 @@
// 点击名字新增或删除选中数据
addContact(targetId) {
const index = this.checkboxValue.findIndex(item => item == targetId)
if (index === -1) {
this.checkboxValue.push(targetId)
if (utils.inArray(targetId, this.selectValue)) {
} else {
this.checkboxValue.splice(index, 1)
if (index === -1) {
this.checkboxValue.push(targetId)
} else {
this.checkboxValue.splice(index, 1)
}
}
},
onInvite() {
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
@@ -130,6 +130,7 @@
animationType: 'pop-out',
animationDuration: 200
});
uni.$emit('groupInvitedUser')
}).catch(err => {
uni.showToast({
icon: 'none',
@@ -137,7 +138,6 @@
})
})
}
}
};
</script>