邀请模块优化
This commit is contained in:
@@ -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>
|
||||||
@@ -55,19 +55,15 @@
|
|||||||
users: [],
|
users: [],
|
||||||
isOwner: false,
|
isOwner: false,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
|
canInvite:false,// 是否可以开启邀请
|
||||||
adminUid: 0,
|
adminUid: 0,
|
||||||
members: 0,
|
members: 0,
|
||||||
actionShow: false,
|
actionShow: false,
|
||||||
actionMap: [],
|
actionMap: [],
|
||||||
actionTitle: '',
|
actionTitle: '',
|
||||||
currentUser: {},
|
currentUser: {},
|
||||||
<<<<<<< HEAD
|
|
||||||
avatarSize: 45,
|
avatarSize: 45,
|
||||||
labelSize: 14,
|
labelSize: 14,
|
||||||
=======
|
|
||||||
avatarSize: 84,
|
|
||||||
labelSize: 14,
|
|
||||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
|
||||||
iconSize: 14
|
iconSize: 14
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -78,21 +74,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
<<<<<<< HEAD
|
|
||||||
created() {
|
created() {
|
||||||
this.avatarSize = utils.rpx2px(90)
|
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)
|
||||||
=======
|
|
||||||
created() {
|
|
||||||
this.avatarSize = utils.rpx2px(84)
|
|
||||||
this.labelSize = utils.rpx2px(24)
|
|
||||||
this.iconSize = utils.rpx2px(26)
|
|
||||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
|
||||||
},
|
},
|
||||||
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)
|
||||||
@@ -106,6 +96,7 @@
|
|||||||
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() {
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -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;
|
||||||
|
|||||||
@@ -182,9 +182,10 @@
|
|||||||
|
|
||||||
.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;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@@ -193,6 +194,7 @@
|
|||||||
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;
|
||||||
|
|||||||
@@ -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,8 +5,7 @@
|
|||||||
</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" />
|
||||||
@@ -108,7 +107,7 @@
|
|||||||
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);
|
||||||
@@ -341,18 +343,19 @@
|
|||||||
.cells {
|
.cells {
|
||||||
margin-top: $padding;
|
margin-top: $padding;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
.announcement-label{
|
|
||||||
|
.announcement-label {
|
||||||
font-size: $title-size-m + 2;
|
font-size: $title-size-m + 2;
|
||||||
padding-top: 10rpx;
|
padding-top: 10rpx;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 620rpx;
|
width: 620rpx;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow: ellipsis;
|
||||||
display:-webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-box-orient:vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp:3;
|
-webkit-line-clamp: 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
})
|
})
|
||||||
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))
|
||||||
})
|
})
|
||||||
@@ -122,6 +123,15 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
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 => {
|
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
|
|||||||
@@ -138,8 +138,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
.no-lists {
|
.no-lists {
|
||||||
padding-top: $padding * 5;
|
padding-top: $padding * 5;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -154,6 +152,4 @@
|
|||||||
padding-top: $padding;
|
padding-top: $padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
>>>>>>> d8b90f97d110aed79b35d385dbc0eeb481ef4eab
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -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 != ''">
|
||||||
@@ -234,6 +234,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
goSetting(){
|
||||||
|
if (this.isLogin()) {
|
||||||
|
this.$Router.push({ name: 'Setting' })
|
||||||
|
}
|
||||||
|
},
|
||||||
// 检查登录
|
// 检查登录
|
||||||
isLogin() {
|
isLogin() {
|
||||||
if (this.$store.state.token === '') {
|
if (this.$store.state.token === '') {
|
||||||
|
|||||||
Reference in New Issue
Block a user