邀请模块优化
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</view>
|
||||
<view class="name">{{ item.name }}</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"
|
||||
color="#c7c7c7" />
|
||||
<view class="name">邀请好友</view>
|
||||
@@ -54,20 +54,16 @@
|
||||
return {
|
||||
users: [],
|
||||
isOwner: false,
|
||||
isAdmin: false,
|
||||
isAdmin: false,
|
||||
canInvite:false,// 是否可以开启邀请
|
||||
adminUid: 0,
|
||||
members: 0,
|
||||
actionShow: false,
|
||||
actionMap: [],
|
||||
actionTitle: '',
|
||||
currentUser: {},
|
||||
<<<<<<< HEAD
|
||||
avatarSize: 45,
|
||||
labelSize: 14,
|
||||
=======
|
||||
avatarSize: 84,
|
||||
labelSize: 14,
|
||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
||||
iconSize: 14
|
||||
}
|
||||
},
|
||||
@@ -78,21 +74,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
created() {
|
||||
this.avatarSize = utils.rpx2px(90)
|
||||
this.labelSize = utils.rpx2px(24)
|
||||
this.iconSize = utils.rpx2px(26)
|
||||
=======
|
||||
created() {
|
||||
this.avatarSize = utils.rpx2px(84)
|
||||
this.labelSize = utils.rpx2px(24)
|
||||
this.iconSize = utils.rpx2px(26)
|
||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
||||
},
|
||||
mounted() {
|
||||
this.initGroupInfo()
|
||||
getGroupUsers(this.targetId, this.count).then(res => {
|
||||
getGroupUsers(this.targetId, this.count).then(res => {
|
||||
console.log("res..",res)
|
||||
this.users = res
|
||||
res.map(item => {
|
||||
this.$store.dispatch('updateContact', item)
|
||||
@@ -105,7 +95,8 @@
|
||||
this.isOwner = res.is_owner
|
||||
this.isAdmin = res.is_admin
|
||||
this.adminUid = res.user_id
|
||||
this.members = res.members
|
||||
this.members = res.members
|
||||
this.canInvite = res.can_invite
|
||||
})
|
||||
},
|
||||
initUsers() {
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
</view>
|
||||
<block v-if="friends.length > 0">
|
||||
<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"
|
||||
style="padding:10rpx 30rpx" />
|
||||
<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"
|
||||
@@ -37,8 +37,8 @@
|
||||
getFriendsLetter
|
||||
} from '@/apis/interfaces/im';
|
||||
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 {
|
||||
data() {
|
||||
return {
|
||||
@@ -87,9 +87,9 @@
|
||||
// 新朋友
|
||||
toPending() {
|
||||
// if (this.pendingCount > 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/pending'
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: '/pages/im/friends/pending'
|
||||
});
|
||||
// } else {
|
||||
// uni.showToast({
|
||||
// title: ` 暂无好友申请 ~ `,
|
||||
@@ -114,6 +114,12 @@
|
||||
height: 70vh;
|
||||
}
|
||||
|
||||
.anchor {
|
||||
background-color: #f9f9f9 !important;
|
||||
padding: 10rpx 30rpx;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
// 好友列表
|
||||
.friend-flex {
|
||||
position: relative;
|
||||
@@ -127,6 +133,8 @@
|
||||
box-shadow: 0 0 20rpx rgba($color: $main-color, $alpha: 0.2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
margin-left: $padding;
|
||||
|
||||
@@ -182,8 +182,9 @@
|
||||
|
||||
.item {
|
||||
background-color: #fff;
|
||||
padding: $padding $padding + 10;
|
||||
border-bottom: $padding solid #f9f9f9;
|
||||
padding: $padding $padding + 10 10rpx $padding + 10;
|
||||
border-bottom: $padding solid #f9f9f9;
|
||||
|
||||
|
||||
.user {
|
||||
display: flex;
|
||||
@@ -192,7 +193,8 @@
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray-m;
|
||||
color: $text-gray-m;
|
||||
padding: 10rpx;
|
||||
|
||||
.name {
|
||||
padding-left: 10rpx;
|
||||
@@ -207,12 +209,14 @@
|
||||
font-size: $title-size;
|
||||
color: $text-color;
|
||||
max-width: 100%;
|
||||
margin-bottom: $padding;
|
||||
margin-bottom: 10rpx;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
overflow: hidden;
|
||||
line-height: 1.5;
|
||||
line-height: 1.5;
|
||||
border-bottom: solid 1rpx #F9F9F9;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
span {
|
||||
color: #fff;
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
font-size: $title-size;
|
||||
color: $text-gray;
|
||||
background-color: #fff;
|
||||
padding: 10rpx $padding $padding $padding;
|
||||
padding: 10rpx $padding 20rpx $padding;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
</view>
|
||||
|
||||
<u-cell-group class="cells" :border="false">
|
||||
<u-cell :border="false" class="u-border-bottom" isLink title="群公告"
|
||||
@click="toAnnouncement" >
|
||||
<view slot="label" class="announcement-label "> {{announcement}} </view>
|
||||
<u-cell :border="false" class="u-border-bottom" isLink title="群公告" @click="toAnnouncement">
|
||||
<view slot="label" class="announcement-label "> {{announcement}} </view>
|
||||
</u-cell>
|
||||
<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="群聊邀请确认"
|
||||
@@ -107,8 +106,8 @@
|
||||
})
|
||||
this.initData()
|
||||
uni.$on('groupAnnouncementCreated', this.initData)
|
||||
uni.$on('groupInvitedUser', this.updateUserList)
|
||||
uni.$on('updateAnnouncement',this.initData)
|
||||
uni.$on('groupInvitedUser', this.updateUserList)
|
||||
uni.$on('updateAnnouncement', this.initData)
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off('groupAnnouncementCreated')
|
||||
@@ -258,8 +257,11 @@
|
||||
}
|
||||
return item
|
||||
})
|
||||
this.initData()
|
||||
this.joinType = e.name
|
||||
this.$nextTick(() => {
|
||||
this.$refs.userList.initGroupInfo()
|
||||
this.initData()
|
||||
})
|
||||
this.showActions = false
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
@@ -340,19 +342,20 @@
|
||||
|
||||
.cells {
|
||||
margin-top: $padding;
|
||||
background-color: white;
|
||||
.announcement-label{
|
||||
font-size: $title-size-m + 2;
|
||||
padding-top: 10rpx;
|
||||
color: $text-gray-m;
|
||||
overflow: hidden;
|
||||
width: 620rpx;
|
||||
display: inline-block;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-box-orient:vertical;
|
||||
-webkit-line-clamp:3;
|
||||
background-color: white;
|
||||
|
||||
.announcement-label {
|
||||
font-size: $title-size-m + 2;
|
||||
padding-top: 10rpx;
|
||||
color: $text-gray-m;
|
||||
overflow: hidden;
|
||||
width: 620rpx;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@
|
||||
this.orignalIndexs = res.indexList
|
||||
})
|
||||
getGroupUsers(this.targetId).then(res => {
|
||||
res.map(res => {
|
||||
res.map(res => {
|
||||
console.log(res)
|
||||
this.checkboxValue.push(String(res.targetId))
|
||||
this.selectValue.push(String(res.targetId))
|
||||
})
|
||||
@@ -121,7 +122,16 @@
|
||||
}
|
||||
|
||||
},
|
||||
onInvite() {
|
||||
onInvite() {
|
||||
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).then(res => {
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
|
||||
@@ -138,8 +138,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
.no-lists {
|
||||
padding-top: $padding * 5;
|
||||
display: flex;
|
||||
@@ -154,6 +152,4 @@
|
||||
padding-top: $padding;
|
||||
}
|
||||
}
|
||||
=======
|
||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
||||
</style>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="info-box">
|
||||
<image src="@/static/user/user_back.png" mode="aspectFill" />
|
||||
<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" />
|
||||
<view class="user-content">
|
||||
<block v-if="$store.state.token != ''">
|
||||
@@ -233,6 +233,11 @@
|
||||
params
|
||||
});
|
||||
}
|
||||
},
|
||||
goSetting(){
|
||||
if (this.isLogin()) {
|
||||
this.$Router.push({ name: 'Setting' })
|
||||
}
|
||||
},
|
||||
// 检查登录
|
||||
isLogin() {
|
||||
|
||||
Reference in New Issue
Block a user