邀请好友,搜索算法
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="invite">
|
<view class="invite">
|
||||||
<view class="search">
|
<view class="search u-border-bottom">
|
||||||
<u--input class="search-input" placeholder="搜索" border="none" prefixIcon="search" v-model="searchTxt"
|
<u--input class="search-input" placeholder="搜索好友" border="none" prefixIcon="search" v-model="searchTxt"
|
||||||
disabledColor="#Fff" prefixIconStyle="font-size: 22px;color: #909399" @change="onSearch" />
|
disabledColor="#Fff" prefixIconStyle="font-size: 22px;color: #909399" @change="onSearch" />
|
||||||
</view>
|
</view>
|
||||||
<block v-if="friends.length > 0">
|
<block v-if="friends.length > 0">
|
||||||
@@ -74,18 +74,17 @@
|
|||||||
methods: {
|
methods: {
|
||||||
onSearch() {
|
onSearch() {
|
||||||
if (this.searchTxt) {
|
if (this.searchTxt) {
|
||||||
console.log(this.searchTxt)
|
|
||||||
this.friends = this.orignalFriends.map((list, index) => {
|
this.friends = this.orignalFriends.map((list, index) => {
|
||||||
const resList = list.filter(item => item.name.indexOf(this.searchTxt) > 0)
|
const resList = list.filter(item => {
|
||||||
if (resList.length > 0) {
|
return item.name.indexOf(this.searchTxt) >= 0
|
||||||
this.indexs = this.orignalIndexs.map((t, i) => {})
|
})
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return resList
|
return resList
|
||||||
})
|
})
|
||||||
this.friends = this.friends.filter(n => n)
|
this.indexs = this.orignalIndexs.map((t, i) => {
|
||||||
|
if (this.friends[i].length > 0) {
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.friends = this.orignalFriends
|
this.friends = this.orignalFriends
|
||||||
this.indexs = this.orignalIndexs
|
this.indexs = this.orignalIndexs
|
||||||
@@ -124,7 +123,6 @@
|
|||||||
},
|
},
|
||||||
onInvite() {
|
onInvite() {
|
||||||
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
|
inviteGroupUser(this.targetId, this.checkboxValue).then(res => {
|
||||||
console.log(res, 'res')
|
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1,
|
delta: 1,
|
||||||
animationType: 'pop-out',
|
animationType: 'pop-out',
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<!-- 群聊邀请确认列表页面 -->
|
<!-- 群聊邀请确认列表页面 -->
|
||||||
<template>
|
<template>
|
||||||
<<<<<<< HEAD
|
|
||||||
<view class="reviewed">
|
<view class="reviewed">
|
||||||
<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" :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" size="36" />
|
<u-avatar class="avatar" :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" size="36" />
|
||||||
@@ -106,88 +105,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
<view class="reviewed">
|
|
||||||
<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>{{` 用户8066`}}</span>加入群聊</view>
|
|
||||||
<view> 申请原因:{{`呵呵哒。。`}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="sure" @click="sure(2)"> 通过 </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import im from '@/utils/im/index.js'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
lists: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad(e) {
|
|
||||||
this.targetId = e.id
|
|
||||||
this.getGroupPendinglist()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getGroupPendinglist() {
|
|
||||||
im.getGroupPendinglist(this.targetId,(pendings) => {
|
|
||||||
console.log(pendings)
|
|
||||||
// this.pendings = pendings
|
|
||||||
})
|
|
||||||
},
|
|
||||||
sure(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/im/group/reviewedInfo?id=" + id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.reviewed {
|
|
||||||
.reviewed-item {
|
|
||||||
margin: $padding - 10;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: flex-start;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-bottom: solid 1rpx #f9f9f9;
|
|
||||||
font-size: $title-size-m - 2;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
color: $text-gray-m;
|
|
||||||
|
|
||||||
.avatar {
|
|
||||||
background-color: $main-color;
|
|
||||||
border-radius: 6rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nickname {
|
|
||||||
font-size: $title-size-m;
|
|
||||||
margin-bottom: 10rpx;
|
|
||||||
|
|
||||||
span {
|
|
||||||
color: $text-color;
|
|
||||||
font-size: $title-size-m +1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sure {
|
|
||||||
background-color: $main-color;
|
|
||||||
color: #Fff;
|
|
||||||
text-align: center;
|
|
||||||
font-size: $title-size-m;
|
|
||||||
padding: 6rpx 20rpx;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
>>>>>>> e99ef72050d54c27a6fe46e8063bb57fc903fac4
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user