merge
This commit is contained in:
@@ -88,9 +88,9 @@ const searchFriend = (value) => {
|
|||||||
const pedingFriend = (recipient, message) => {
|
const pedingFriend = (recipient, message) => {
|
||||||
return request({
|
return request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: 'im/friends/' + recipient,
|
url: 'im/friends/' + recipient,
|
||||||
data: {
|
data: {
|
||||||
message
|
message
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ const getGroupBase = (groupId) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getGroupUsers = (groupId, limit) => {
|
const getGroupUsers = (groupId, limit) => {
|
||||||
limit = limit || 0
|
limit = limit || 0
|
||||||
return request({
|
return request({
|
||||||
url: 'im/groups/' + groupId + '/users?limit=' + limit
|
url: 'im/groups/' + groupId + '/users?limit=' + limit
|
||||||
@@ -141,9 +141,9 @@ const createGroupAnnouncement = (groupId, content) => {
|
|||||||
content: content
|
content: content
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 查看该公告详情
|
// 查看该公告详情
|
||||||
const getGroupAnnouncement = (groupId, announcementId) => {
|
const getGroupAnnouncement = (groupId, announcementId) => {
|
||||||
return request({
|
return request({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: 'im/groups/' + groupId + '/announcements/' + announcementId
|
url: 'im/groups/' + groupId + '/announcements/' + announcementId
|
||||||
@@ -155,12 +155,12 @@ const deleteGroupAnnouncement = (groupId, announcementId) => {
|
|||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: 'im/groups/' + groupId + '/announcements/' + announcementId
|
url: 'im/groups/' + groupId + '/announcements/' + announcementId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 置顶群公告
|
// 置顶群公告
|
||||||
const topGroupAnnouncement = (groupId, announcementId) => {
|
const topGroupAnnouncement = (groupId, announcementId) => {
|
||||||
return request({
|
return request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: 'im/groups/' + groupId + '/announcements/' + announcementId+'/top',
|
url: 'im/groups/' + groupId + '/announcements/' + announcementId + '/top',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,12 +241,13 @@ const removeGroupUser = (groupId, userId) => {
|
|||||||
/**
|
/**
|
||||||
* 邀请群成员
|
* 邀请群成员
|
||||||
*/
|
*/
|
||||||
const inviteGroupUser = (groupId, userIds) => {
|
const inviteGroupUser = (groupId, userIds, allowIds) => {
|
||||||
return request({
|
return request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: 'im/groups/' + groupId + '/invite',
|
url: 'im/groups/' + groupId + '/invite',
|
||||||
data: {
|
data: {
|
||||||
userIds
|
userIds: userIds,
|
||||||
|
allowIds: allowIds
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -280,16 +281,16 @@ const transferGroupOwner = (groupId, userId) => {
|
|||||||
url: 'im/groups/' + groupId + '/owner/' + userId
|
url: 'im/groups/' + groupId + '/owner/' + userId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 通过审核验证群成员
|
// 通过审核验证群成员
|
||||||
const groupMakeSure = (groupId,user) => {
|
const groupMakeSure = (groupId, user) => {
|
||||||
return request({
|
return request({
|
||||||
url:`im/groups/${groupId}/makesure/${user}`,
|
url: `im/groups/${groupId}/makesure/${user}`,
|
||||||
method:'POST'
|
method: 'POST'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@@ -310,16 +311,16 @@ export {
|
|||||||
getGroupInfo,
|
getGroupInfo,
|
||||||
getGroupBase,
|
getGroupBase,
|
||||||
getGroupUsers,
|
getGroupUsers,
|
||||||
getGroupAnnouncements,
|
getGroupAnnouncements,
|
||||||
getGroupAnnouncement,
|
getGroupAnnouncement,
|
||||||
createGroupAnnouncement,
|
createGroupAnnouncement,
|
||||||
deleteGroupAnnouncement,
|
deleteGroupAnnouncement,
|
||||||
topGroupAnnouncement,
|
topGroupAnnouncement,
|
||||||
searchGroup,
|
searchGroup,
|
||||||
joinGroupPre,
|
joinGroupPre,
|
||||||
joinGroup,
|
joinGroup,
|
||||||
quitGroup,
|
quitGroup,
|
||||||
dismissGroup,
|
dismissGroup,
|
||||||
inviteGroupUser,
|
inviteGroupUser,
|
||||||
removeGroupUser,
|
removeGroupUser,
|
||||||
setGroupAdmin,
|
setGroupAdmin,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="name">{{ item.name }}</view>
|
<view class="name">{{ item.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="user" v-if="isAdmin">
|
<view class="user" v-if="canInvite">
|
||||||
<u-avatar @click="inviteUser" :size="avatarSize" shape="square" icon="plus" bgColor="#f9f9f9"
|
<u-avatar @click="inviteUser" :size="avatarSize" shape="square" icon="plus" bgColor="#f9f9f9"
|
||||||
color="#c7c7c7" />
|
color="#c7c7c7" />
|
||||||
<view class="name">邀请好友</view>
|
<view class="name">邀请好友</view>
|
||||||
@@ -54,7 +54,8 @@
|
|||||||
return {
|
return {
|
||||||
users: [],
|
users: [],
|
||||||
isOwner: false,
|
isOwner: false,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
|
canInvite:false,// 是否可以开启邀请
|
||||||
adminUid: 0,
|
adminUid: 0,
|
||||||
members: 0,
|
members: 0,
|
||||||
actionShow: false,
|
actionShow: false,
|
||||||
@@ -63,6 +64,8 @@
|
|||||||
currentUser: {},
|
currentUser: {},
|
||||||
avatarSize: 45,
|
avatarSize: 45,
|
||||||
labelSize: 14,
|
labelSize: 14,
|
||||||
|
iconSize: 14
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -72,14 +75,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.avatarSize = utils.rpx2px(84)
|
this.avatarSize = utils.rpx2px(90)
|
||||||
this.labelSize = utils.rpx2px(24)
|
this.labelSize = utils.rpx2px(24)
|
||||||
this.iconSize = utils.rpx2px(26)
|
this.iconSize = utils.rpx2px(26)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initGroupInfo()
|
this.initGroupInfo()
|
||||||
getGroupUsers(this.targetId, this.count).then(res => {
|
getGroupUsers(this.targetId, this.count).then(res => {
|
||||||
|
console.log("res..",res)
|
||||||
this.users = res
|
this.users = res
|
||||||
res.map(item => {
|
res.map(item => {
|
||||||
this.$store.dispatch('updateContact', item)
|
this.$store.dispatch('updateContact', item)
|
||||||
@@ -92,7 +96,8 @@
|
|||||||
this.isOwner = res.is_owner
|
this.isOwner = res.is_owner
|
||||||
this.isAdmin = res.is_admin
|
this.isAdmin = res.is_admin
|
||||||
this.adminUid = res.user_id
|
this.adminUid = res.user_id
|
||||||
this.members = res.members
|
this.members = res.members
|
||||||
|
this.canInvite = res.can_invite
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initUsers() {
|
initUsers() {
|
||||||
|
|||||||
@@ -100,7 +100,8 @@
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.send--voice {
|
.send--voice {
|
||||||
.voice {
|
.voice {
|
||||||
|
display: flex;
|
||||||
background: $window-color;
|
background: $window-color;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
@@ -109,14 +110,14 @@
|
|||||||
width: 500rpx;
|
width: 500rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
|
display: flex;
|
||||||
background: rgba(0, 0, 0, .6);
|
background: rgba(0, 0, 0, .6);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
@@ -128,7 +129,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 88rpx;
|
width: 88rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
||||||
<view class="msg--voice">
|
<view class="msg--voice">
|
||||||
<view :class="['voice', isRemote ? 'left': 'right', {'onPlay': onPlay}]" :style="{width: width + 'rpx'}" @click="startPlay">
|
<view :class="['voice', isRemote ? 'left': 'right', {'onPlay': onPlay}]" :style="{width: width + 'rpx'}" @click="startPlay">
|
||||||
<image v-if="isRemote" class="icon" src="@/static/icon/audio_green.png" mode="widthFix"></image>
|
<image v-if="isRemote" class="icon" :class="{ 'videoFlicker' : onPlay && msgId == message.messageId }" src="@/static/icon/audio_green.png" mode="widthFix"></image>
|
||||||
<image v-else class="icon" src="@/static/icon/audio_white.png" mode="widthFix"></image>
|
<image v-else class="icon" :class="{ 'videoFlicker' : onPlay && msgId == message.messageId }" src="@/static/icon/audio_white.png" mode="widthFix"></image>
|
||||||
<text class="duration">{{ duration }}"</text>
|
<text class="duration">{{ duration }}"</text>
|
||||||
</view>
|
</view>
|
||||||
<u-badge isDot :show="message.content.local =='' && isRemote" />
|
<u-badge isDot :show="message.content.local =='' && isRemote" />
|
||||||
@@ -27,12 +27,13 @@
|
|||||||
isGroup: {
|
isGroup: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
onPlay: false,
|
onPlay: false,
|
||||||
innerAC: null,
|
innerAC: null,
|
||||||
|
msgId : null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -62,7 +63,12 @@
|
|||||||
this.stopPlay()
|
this.stopPlay()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
console.log(this.message.messageId)
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
// 播放语音消息
|
// 播放语音消息
|
||||||
startPlay() {
|
startPlay() {
|
||||||
@@ -91,15 +97,17 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
playVoice(path) {
|
playVoice(path) {
|
||||||
console.log('准备播放', this.message.content);
|
console.log('准备播放', this.message.content);
|
||||||
this.innerAC = uni.createInnerAudioContext()
|
this.innerAC = uni.createInnerAudioContext()
|
||||||
this.innerAC.src = path
|
this.innerAC.src = path
|
||||||
this.innerAC.autoplay = false
|
this.innerAC.autoplay = false
|
||||||
this.innerAC.onCanplay(res => {
|
this.msgId = this.message.messageId
|
||||||
|
this.innerAC.onCanplay(res => {
|
||||||
this.innerAC.play()
|
this.innerAC.play()
|
||||||
})
|
})
|
||||||
this.innerAC.onPlay(res => {
|
|
||||||
|
this.innerAC.onPlay(res => {
|
||||||
this.onPlay = true
|
this.onPlay = true
|
||||||
uni.$emit('onVoiceMessagePlay', this.message.messageId)
|
uni.$emit('onVoiceMessagePlay', this.message.messageId)
|
||||||
})
|
})
|
||||||
@@ -109,10 +117,11 @@
|
|||||||
this.innerAC.onStop(() => {
|
this.innerAC.onStop(() => {
|
||||||
this.onPlay = false
|
this.onPlay = false
|
||||||
this.innerAC.destroy()
|
this.innerAC.destroy()
|
||||||
this.innerAC = null
|
this.innerAC = null
|
||||||
|
this.msgId = null
|
||||||
uni.$emit('onVoiceMessageStop', this.message.messageId)
|
uni.$emit('onVoiceMessageStop', this.message.messageId)
|
||||||
})
|
})
|
||||||
this.innerAC.onError(err => {
|
this.innerAC.onError(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '语音播放失败'
|
title: '语音播放失败'
|
||||||
@@ -127,7 +136,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@keyframes playFlicker{
|
||||||
|
0%{
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50%{
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
|
100%{
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.videoFlicker{
|
||||||
|
animation: playFlicker 1s infinite;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.name {
|
.name {
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
</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="#ededed" height="20" size="12" color="#666"
|
<u-index-anchor :text="indexs[fkey]" bgColor="#f9f9f9" height="20" size="12" color="#666"
|
||||||
style="padding:10rpx 30rpx" />
|
class="anchor" />
|
||||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||||
@click="toFriend(friendItem.targetId)">
|
@click="toFriend(friendItem.targetId)">
|
||||||
<u-avatar class="avatar-img" size="40" shape="square"
|
<u-avatar class="avatar-img" size="40" shape="square"
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
getFriendsLetter
|
getFriendsLetter
|
||||||
} from '@/apis/interfaces/im';
|
} 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'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -87,9 +87,9 @@
|
|||||||
// 新朋友
|
// 新朋友
|
||||||
toPending() {
|
toPending() {
|
||||||
// if (this.pendingCount > 0) {
|
// if (this.pendingCount > 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/friends/pending'
|
url: '/pages/im/friends/pending'
|
||||||
});
|
});
|
||||||
// } else {
|
// } else {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: ` 暂无好友申请 ~ `,
|
// title: ` 暂无好友申请 ~ `,
|
||||||
@@ -114,6 +114,12 @@
|
|||||||
height: 70vh;
|
height: 70vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.anchor {
|
||||||
|
background-color: #f9f9f9 !important;
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
border-bottom: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
// 好友列表
|
// 好友列表
|
||||||
.friend-flex {
|
.friend-flex {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -127,6 +133,8 @@
|
|||||||
box-shadow: 0 0 20rpx rgba($color: $main-color, $alpha: 0.2);
|
box-shadow: 0 0 20rpx rgba($color: $main-color, $alpha: 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-left: $padding;
|
margin-left: $padding;
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
this.targetId = e.targetId
|
this.targetId = e.targetId
|
||||||
if (e.type) {
|
if (e.type) {
|
||||||
this.type = e.type
|
this.type = e.type
|
||||||
console.log(this.type)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (e.aId) {
|
if (e.aId) {
|
||||||
this.aId = e.aId
|
this.aId = e.aId
|
||||||
@@ -46,8 +44,6 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
disabled() {
|
disabled() {
|
||||||
|
|||||||
@@ -182,8 +182,9 @@
|
|||||||
|
|
||||||
.item {
|
.item {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: $padding $padding + 10;
|
padding: $padding $padding + 10 10rpx $padding + 10;
|
||||||
border-bottom: $padding solid #f9f9f9;
|
border-bottom: $padding solid #f9f9f9;
|
||||||
|
|
||||||
|
|
||||||
.user {
|
.user {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -192,7 +193,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: $title-size-m;
|
font-size: $title-size-m;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
|
padding: 10rpx;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
padding-left: 10rpx;
|
padding-left: 10rpx;
|
||||||
@@ -207,12 +209,14 @@
|
|||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-bottom: $padding;
|
margin-bottom: 10rpx;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
border-bottom: solid 1rpx #F9F9F9;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -144,6 +144,10 @@
|
|||||||
im.setNotifyBadge()
|
im.setNotifyBadge()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
// console.log(JSON.stringify(this.$refs))
|
||||||
|
this.$refs.voice.stopPlay()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
font-size: $title-size;
|
font-size: $title-size;
|
||||||
color: $text-gray;
|
color: $text-gray;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 10rpx $padding $padding $padding;
|
padding: 10rpx $padding 20rpx $padding;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-cell-group class="cells" :border="false">
|
<u-cell-group class="cells" :border="false">
|
||||||
<u-cell :border="false" class="u-border-bottom" isLink title="群公告"
|
<u-cell :border="false" class="u-border-bottom" isLink title="群公告" @click="toAnnouncement">
|
||||||
@click="toAnnouncement" >
|
<view slot="label" class="announcement-label "> {{announcement}} </view>
|
||||||
<view slot="label" class="announcement-label "> {{announcement}} </view>
|
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell :border="false" class="u-border-bottom" isLink title="二维码" @click="showGroupQrCode" />
|
<u-cell :border="false" class="u-border-bottom" isLink title="二维码" @click="showGroupQrCode" />
|
||||||
<u-cell :border="false" class="u-border-bottom" v-if="group.can_makesure" isLink title="群聊邀请确认"
|
<u-cell :border="false" class="u-border-bottom" v-if="group.can_makesure" isLink title="群聊邀请确认"
|
||||||
@@ -107,8 +106,8 @@
|
|||||||
})
|
})
|
||||||
this.initData()
|
this.initData()
|
||||||
uni.$on('groupAnnouncementCreated', this.initData)
|
uni.$on('groupAnnouncementCreated', this.initData)
|
||||||
uni.$on('groupInvitedUser', this.updateUserList)
|
uni.$on('groupInvitedUser', this.updateUserList)
|
||||||
uni.$on('updateAnnouncement',this.initData)
|
uni.$on('updateAnnouncement', this.initData)
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off('groupAnnouncementCreated')
|
uni.$off('groupAnnouncementCreated')
|
||||||
@@ -258,8 +257,11 @@
|
|||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
this.initData()
|
|
||||||
this.joinType = e.name
|
this.joinType = e.name
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.userList.initGroupInfo()
|
||||||
|
this.initData()
|
||||||
|
})
|
||||||
this.showActions = false
|
this.showActions = false
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -340,19 +342,20 @@
|
|||||||
|
|
||||||
.cells {
|
.cells {
|
||||||
margin-top: $padding;
|
margin-top: $padding;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
.announcement-label{
|
|
||||||
font-size: $title-size-m + 2;
|
.announcement-label {
|
||||||
padding-top: 10rpx;
|
font-size: $title-size-m + 2;
|
||||||
color: $text-gray-m;
|
padding-top: 10rpx;
|
||||||
overflow: hidden;
|
color: $text-gray-m;
|
||||||
width: 620rpx;
|
overflow: hidden;
|
||||||
display: inline-block;
|
width: 620rpx;
|
||||||
overflow:hidden;
|
display: inline-block;
|
||||||
text-overflow:ellipsis;
|
overflow: hidden;
|
||||||
display:-webkit-box;
|
text-overflow: ellipsis;
|
||||||
-webkit-box-orient:vertical;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp:3;
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||||
<u-checkbox-group v-if="friends.length > 0" v-model="checkboxValue" placement="column">
|
<u-checkbox-group v-if="friends.length > 0" v-model="checkboxValue" placement="column">
|
||||||
<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]" v-if="indexs[fkey]" bgColor="#ededed" height="20" size="12"
|
<u-index-anchor :text="indexs[fkey]" v-if="indexs[fkey]" bgColor="#f9f9f9f" height="20" size="12"
|
||||||
color="#666" style="padding:10rpx 30rpx" />
|
color="#666" style="border:none !important;padding: 10rpx 30rpx;background-color: #f9f9f9 !important;" />
|
||||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||||
@click="addContact(friendItem.targetId)">
|
@click="addContact(friendItem.targetId)">
|
||||||
<u-checkbox :name="friendItem.targetId" shape="circle" activeColor="#34ce98"
|
<u-checkbox :name="friendItem.targetId" shape="circle" activeColor="#34ce98"
|
||||||
@@ -101,7 +101,8 @@
|
|||||||
this.orignalIndexs = res.indexList
|
this.orignalIndexs = res.indexList
|
||||||
})
|
})
|
||||||
getGroupUsers(this.targetId).then(res => {
|
getGroupUsers(this.targetId).then(res => {
|
||||||
res.map(res => {
|
res.map(res => {
|
||||||
|
console.log(res)
|
||||||
this.checkboxValue.push(String(res.targetId))
|
this.checkboxValue.push(String(res.targetId))
|
||||||
this.selectValue.push(String(res.targetId))
|
this.selectValue.push(String(res.targetId))
|
||||||
})
|
})
|
||||||
@@ -121,8 +122,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onInvite() {
|
onInvite() {
|
||||||
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
|
console.log(this.checkboxValue,'userIds.....')
|
||||||
|
console.log(this.selectValue,'userIds.....')
|
||||||
|
let userIds = []
|
||||||
|
this.checkboxValue.filter(item=>{
|
||||||
|
if(!utils.inArray(item, this.selectValue)){
|
||||||
|
userIds.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// console.log(userIds)
|
||||||
|
inviteGroupUser(this.targetId, this.checkboxValue,userIds).then(res => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
animationType: 'pop-out',
|
animationType: 'pop-out',
|
||||||
|
|||||||
@@ -3,19 +3,19 @@
|
|||||||
<view class="reviewed">
|
<view class="reviewed">
|
||||||
<block v-if="pendings.length > 0">
|
<block v-if="pendings.length > 0">
|
||||||
<view class="reviewed-item" v-for="(item, index) in pendings" :key="index">
|
<view class="reviewed-item" v-for="(item, index) in pendings" :key="index">
|
||||||
<u-avatar class="avatar"
|
<u-avatar class="avatar"
|
||||||
:src="JSON.parse(item.latestMessage.extra).portraitUrl || require('@/static/user/cover.png')"
|
:src="JSON.parse(item.content.extra).portraitUrl || require('@/static/user/cover.png')"
|
||||||
shape="square" size="46" />
|
shape="square" size="46" />
|
||||||
<view style="flex:1;" v-if="item.latestMessage.operation == 'GroupPending'">
|
<view style="flex:1;" v-if="item.content.operation == 'GroupPending'">
|
||||||
<view class="nickname">{{ JSON.parse(item.latestMessage.extra).name }} 申请加入群聊</view>
|
<view class="nickname">{{ JSON.parse(item.content.extra).name }} 申请加入群聊</view>
|
||||||
<view> 申请原因:{{ item.latestMessage.message }}</view>
|
<view> 申请原因:{{ item.content.message }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="flex:1;" v-if="item.latestMessage.operation == 'GroupInvite'">
|
<view style="flex:1;" v-if="item.content.operation == 'GroupInvite'">
|
||||||
<view class="nickname">
|
<view class="nickname">
|
||||||
<text>{{ contact(item.latestMessage.sourceUserId )}}</text>想邀请<span>{{ JSON.parse(item.latestMessage.extra).name }}</span>加入群聊
|
<text>{{ contact(item.content.sourceUserId).name }}</text>想邀请<span>{{ JSON.parse(item.content.extra).name }}</span>加入群聊
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="sure" @click="sure(item.latestMessage.targetUserId,item.latestMessageId)"> 通过 </view>
|
<view class="sure" @click="sure(item.content.targetUserId,item.messageId)"> 通过 </view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
@@ -81,11 +81,26 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: err.message,
|
// title: err.message,
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
mask: true,
|
// mask: true,
|
||||||
duration: 2000
|
// duration: 2000
|
||||||
|
// })
|
||||||
|
RongIMLib.deleteMessagesByIds([latestMessageId], ({
|
||||||
|
code
|
||||||
|
}) => {
|
||||||
|
console.log('code', code)
|
||||||
|
if (code == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title:err.message,
|
||||||
|
icon: 'none',
|
||||||
|
mask: true,
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
this.getList()
|
||||||
|
uni.$emit('groupInvitedUser')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// 直接调用通过或拒绝的接口
|
// 直接调用通过或拒绝的接口
|
||||||
@@ -138,7 +153,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-lists {
|
.no-lists {
|
||||||
padding-top: $padding * 5;
|
padding-top: $padding * 5;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="info-box">
|
<view class="info-box">
|
||||||
<image src="@/static/user/user_back.png" mode="aspectFill" />
|
<image src="@/static/user/user_back.png" mode="aspectFill" />
|
||||||
<view class="user-flex">
|
<view class="user-flex">
|
||||||
<image class="cover" @click="$Router.push({ name: 'Setting' })"
|
<image class="cover" @click="goSetting"
|
||||||
:src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" />
|
:src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" />
|
||||||
<view class="user-content">
|
<view class="user-content">
|
||||||
<block v-if="$store.state.token != ''">
|
<block v-if="$store.state.token != ''">
|
||||||
@@ -233,6 +233,11 @@
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
goSetting(){
|
||||||
|
if (this.isLogin()) {
|
||||||
|
this.$Router.push({ name: 'Setting' })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 检查登录
|
// 检查登录
|
||||||
isLogin() {
|
isLogin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user