...
This commit is contained in:
@@ -84,15 +84,10 @@
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
this.qrContent += e.targetId
|
||||
RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({
|
||||
status
|
||||
}) => {
|
||||
RongIMLib.getConversationNotificationStatus(this.conversationType, this.targetId, ({status}) => {
|
||||
this.status = !Boolean(status)
|
||||
})
|
||||
RongIMLib.getConversation(this.conversationType, this.targetId, ({
|
||||
code,
|
||||
conversation
|
||||
}) => {
|
||||
RongIMLib.getConversation(this.conversationType, this.targetId, ({code,conversation}) => {
|
||||
if (code == 0) {
|
||||
this.isTop = conversation.isTop
|
||||
}
|
||||
|
||||
@@ -1,33 +1,10 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||
<view class="invite">
|
||||
<view class="search">
|
||||
<u--input class="search-input" placeholder="搜索" border="none" prefixIcon="search" v-model="searchTxt"
|
||||
disabledColor="#Fff" prefixIconStyle="font-size: 22px;color: #909399" />
|
||||
</view>
|
||||
<block v-if="friends.length > 0">
|
||||
<u-checkbox-group v-model="checkboxValue" placement="column" @change="checkboxChange">
|
||||
<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" />
|
||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||
@click="selectFriend(friendItem.targetId)">
|
||||
<u-checkbox :customStyle="{marginBottom: '8px'}" :name="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>
|
||||
</u-checkbox-group>
|
||||
</block>
|
||||
<view class="no-lists" v-else>
|
||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||
:src="searchTxt=== '' ? require('@/static/imgs/no-friend.png') :require('@/static/imgs/no-search.png')"
|
||||
:lazy-load="true" />
|
||||
<span>{{searchTxt=== ''?'暂无好友列表~':'暂无搜索内容~'}}</span>
|
||||
</view> -->
|
||||
<button type="default" @click="onInvite">确定</button>
|
||||
<u-index-list :index-list="indexs" inactiveColor="#666" activeColor="#34CE98">
|
||||
<u-checkbox-group v-if="friends.length > 0" v-model="checkboxValue" placement="column">
|
||||
<u-index-item v-for="(item, fkey) in friends" :key="fkey">
|
||||
@@ -35,7 +12,8 @@
|
||||
style="padding:10rpx 30rpx" />
|
||||
<view v-for="(friendItem, index) in item" :key="index" class="friend-flex"
|
||||
@click="addContact(friendItem.targetId)">
|
||||
<u-checkbox :name="friendItem.targetId" shape="circle" />
|
||||
<u-checkbox :name="friendItem.targetId" shape="square" activeColor="#34ce98"
|
||||
style="margin-right: 20rpx;" />
|
||||
<u-avatar class="avatar-img" size="40" shape="square"
|
||||
:src="contact(friendItem.targetId).portraitUrl" />
|
||||
<view class="info">
|
||||
@@ -46,29 +24,36 @@
|
||||
</u-index-item>
|
||||
</u-checkbox-group>
|
||||
</u-index-list>
|
||||
<view class="bottom">
|
||||
<span class="onInvite" @click="onInvite">完成<span>{{`(${checkboxValue.length})` || ''}}</span></span>
|
||||
</view>
|
||||
</block>
|
||||
<view class="no-lists" v-else>
|
||||
<u-image class="cover" radius="4" width="400rpx" height="400rpx"
|
||||
:src="searchTxt=== '' ? require('@/static/imgs/no-friend.png') :require('@/static/imgs/no-search.png')"
|
||||
:lazy-load="true" />
|
||||
<span>{{searchTxt=== ''?'暂无好友列表~':'暂无搜索内容~'}}</span>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getFriendsLetter,
|
||||
inviteGroupUser
|
||||
|
||||
inviteGroupUser,
|
||||
getGroupUsers
|
||||
} from '@/apis/interfaces/im';
|
||||
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// indexs: [],
|
||||
// friends: [],
|
||||
// pendingCount: 0,
|
||||
// searchTxt: '',
|
||||
// checkboxValue: [],
|
||||
searchTxt: '',
|
||||
targetId: '',
|
||||
indexs: [],
|
||||
friends: [],
|
||||
checkboxValue: []
|
||||
checkboxValue: [],
|
||||
selectValue:[]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -78,19 +63,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
// onLoad() {
|
||||
// this.getFriendList()
|
||||
// this.checkNewFriendPending()
|
||||
// uni.$on('onContactNotification', this.checkNewFriendPending)
|
||||
// },
|
||||
// methods: {
|
||||
// // group事件
|
||||
// checkboxChange(n) {
|
||||
// console.log('change', n);
|
||||
// },
|
||||
// getFriendList() {
|
||||
// getFriendsLetter().then(res => {
|
||||
// console.log(res)
|
||||
onLoad(e) {
|
||||
this.targetId = e.targetId
|
||||
this.getFriendList()
|
||||
@@ -101,34 +73,30 @@
|
||||
this.indexs = res.indexList
|
||||
this.friends = res.itemArr
|
||||
})
|
||||
getGroupUsers(this.targetId).then(res => {
|
||||
res.map(res => {
|
||||
this.checkboxValue.push(res.targetId + "")
|
||||
this.selectValue.push(res.targetId+"")
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// selectFriend(targetId) {
|
||||
// console.log(targetId,typeof targetId)
|
||||
// let arr = this.checkboxValue
|
||||
// let index = arr.findIndex(item => item === targetId)
|
||||
// if(index>0){
|
||||
// console.log('选择了再次点击清除数据le')
|
||||
|
||||
// }else{
|
||||
// console.log('没有选择过,添加数据')
|
||||
|
||||
// }
|
||||
|
||||
// console.log(this.checkboxValue,index)
|
||||
// console.log('奥克兰打开',targetId)
|
||||
// },
|
||||
// 点击名字新增或删除选中数据
|
||||
addContact(targetId) {
|
||||
if (!this.checkboxValue.find(item => item == targetId)) {
|
||||
const index = this.checkboxValue.findIndex(item => item == targetId)
|
||||
if (index === -1) {
|
||||
this.checkboxValue.push(targetId)
|
||||
} else {
|
||||
const index = this.checkboxValue.findIndex(item => item == targetId)
|
||||
this.checkboxValue = this.checkboxValue.splice(index, 1)
|
||||
this.checkboxValue.splice(index, 1)
|
||||
}
|
||||
},
|
||||
onInvite() {
|
||||
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
|
||||
uni.navigateBack()
|
||||
console.log(res,'res')
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
animationType: 'pop-out',
|
||||
animationDuration: 200
|
||||
});
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@@ -198,9 +166,49 @@
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.invite {
|
||||
position: relative;
|
||||
padding: 100rpx 0;
|
||||
box-sizing: border-box;
|
||||
z-index: 0;
|
||||
|
||||
.bottom {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background-color: $window-color;
|
||||
z-index: 100;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
padding-right: 30rpx;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
.onInvite {
|
||||
background-color: $main-color;
|
||||
font-size: $title-size;
|
||||
display: inline-block;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
span {
|
||||
font-size: $title-size - 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
|
||||
.search-input {
|
||||
padding: 10rpx $padding;
|
||||
@@ -209,6 +217,9 @@
|
||||
|
||||
.searchTxt {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.no-lists {
|
||||
padding-top: $padding * 3;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<view class="reviewed-item">
|
||||
<u-avatar class="avatar" src="require('@/static/user/cover.png')" shape="square" size="36" />
|
||||
<view style="flex:1;">
|
||||
<view class="nickname"><span>{{`艾米的猫儿 `}}</span>想邀请<span>{{` 艾米的猫儿洛基艾米`}}</span>加入群聊</view>
|
||||
<view class="nickname"><span>{{`艾米的猫儿 `}}</span>想邀请<span>{{` 用户8066`}}</span>加入群聊</view>
|
||||
<view> 申请原因:{{`呵呵哒。。`}}</view>
|
||||
</view>
|
||||
<view class="sure" @click="sure(2)"> 去确认 </view>
|
||||
<view class="sure" @click="sure(2)"> 通过 </view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -60,6 +60,7 @@
|
||||
|
||||
span {
|
||||
color: $text-color;
|
||||
font-size: $title-size-m +1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user