完成墨册SAAS加好友新需求移动端
This commit is contained in:
parent
98aa8e8fdb
commit
64f76df2ef
@ -26,3 +26,22 @@ export const ServeQueryFriendsList = (data) => {
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除好友(单向好友)
|
||||
export const ServeDeleteFriend = (data) => {
|
||||
return request({
|
||||
url: '/api/v1/contact/friend/delete',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//添加我的好友时候的搜索接口
|
||||
export const ServeFriendSearch = (data) => {
|
||||
return request({
|
||||
url: '/api/v1/contact/friend/search',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
}
|
@ -83,7 +83,7 @@ export const ServeTalkRecords = (data) => {
|
||||
// 获取转发会话记录详情列表服务接口
|
||||
export const ServeGetForwardRecords = (data) => {
|
||||
return request({
|
||||
url: '/api/v1/talk/records/forward',
|
||||
url: '/api/v1/talk/records/forward/v2',
|
||||
method: 'GET',
|
||||
data,
|
||||
})
|
||||
|
@ -4,7 +4,7 @@ import qs from 'qs'
|
||||
// ES搜索聊天记录-主页搜索什么都有
|
||||
export const ServeSeachQueryAll = (data) => {
|
||||
return request({
|
||||
url: '/api/v1/elasticsearch/query-all',
|
||||
url: '/api/v1/elasticsearch/query-all/v2',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
@ -13,7 +13,7 @@ export const ServeSeachQueryAll = (data) => {
|
||||
// ES搜索用户数据
|
||||
export const ServeQueryUser = (data) => {
|
||||
return request({
|
||||
url: '/api/v1/elasticsearch/query-user',
|
||||
url: '/api/v1/elasticsearch/query-user/v2',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
|
@ -24,7 +24,7 @@ console.log(props.extra.records)
|
||||
const onClick = () => {
|
||||
// isShowRecord.value = true
|
||||
uni.navigateTo({
|
||||
url: '/pages/forwardRecord/index?msgId=' + props.data.msg_id
|
||||
url: '/pages/forwardRecord/index?msgId=' + props.data.msg_id + '&created_at=' + props.data?.created_at
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
@ -201,6 +201,14 @@
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/addressBook/addFriend/index",
|
||||
"type": "page",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
396
src/pages/addressBook/addFriend/index.vue
Normal file
396
src/pages/addressBook/addFriend/index.vue
Normal file
@ -0,0 +1,396 @@
|
||||
<template>
|
||||
<div class="add-friend-page">
|
||||
<zPaging ref="zPaging" :show-scrollbar="false" @scrolltolower="doLoadMore">
|
||||
<template #top>
|
||||
<div :class="'top_bg'">
|
||||
<customNavbar
|
||||
:class="'index_top_navbar'"
|
||||
:title="$t('addFriend.pageTitle')"
|
||||
></customNavbar>
|
||||
<div class="pl-[32rpx] pr-[32rpx] pt-[32rpx] pb-[32rpx]">
|
||||
<customInput
|
||||
:searchText="searchVal"
|
||||
@inputSearchText="inputSearchText"
|
||||
></customInput>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="add-friend">
|
||||
<div class="add-friend-list" v-if="state.friendsList.length > 0">
|
||||
<div
|
||||
class="members-list-each"
|
||||
v-for="(item, index) in state.friendsList"
|
||||
:key="index"
|
||||
@click="toUserDetail(item)"
|
||||
>
|
||||
<div class="members-info">
|
||||
<avatarModule
|
||||
:mode="1"
|
||||
:avatar="item.avatar"
|
||||
:groupType="0"
|
||||
:userName="item.nickname"
|
||||
:customStyle="{ width: '72rpx', height: '72rpx' }"
|
||||
:customTextStyle="{
|
||||
fontSize: '32rpx',
|
||||
fontWeight: 'bold',
|
||||
color: '#fff',
|
||||
lineHeight: '44rpx',
|
||||
}"
|
||||
></avatarModule>
|
||||
<div class="members-info-area">
|
||||
<div
|
||||
class="members-info-basic"
|
||||
:style="{ padding: item.company_name ? 0 : '0 0 24rpx' }"
|
||||
>
|
||||
<span class="members-name">
|
||||
{{ item.nickname }}
|
||||
</span>
|
||||
<span class="members-jobNum">
|
||||
{{ item.job_num }}
|
||||
</span>
|
||||
<!-- <span class="members-company">{{ item.company_name }}</span> -->
|
||||
</div>
|
||||
<div class="members-positions-area">
|
||||
<tm-popover position="bc">
|
||||
<tm-scrolly :refresher="false" :height="84">
|
||||
<div class="members-positions">
|
||||
<div
|
||||
class="members-positions-each"
|
||||
v-for="(postionItem,
|
||||
positionIndex) in item.user_position"
|
||||
:key="positionIndex"
|
||||
>
|
||||
{{ postionItem.position_name }}
|
||||
</div>
|
||||
</div>
|
||||
</tm-scrolly>
|
||||
<template v-slot:label>
|
||||
<tm-scrolly
|
||||
:refresher="false"
|
||||
:height="
|
||||
item.user_position.length >= 4
|
||||
? 180
|
||||
: item.user_position.length === 3
|
||||
? 140
|
||||
: item.user_position.length === 2
|
||||
? 100
|
||||
: item.user_position.length === 1
|
||||
? 60
|
||||
: 0
|
||||
"
|
||||
>
|
||||
<div class="members-positions-popover-box">
|
||||
<div
|
||||
class="members-positions-popover"
|
||||
v-for="(postionItem,
|
||||
positionIndex) in item.user_position"
|
||||
:key="positionIndex"
|
||||
>
|
||||
{{ postionItem.position_name }}
|
||||
</div>
|
||||
</div>
|
||||
</tm-scrolly>
|
||||
</template>
|
||||
</tm-popover>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="company-infos" v-if="item.company_name">
|
||||
<div class="company-each">
|
||||
<span>{{ item.company_name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="addressBook-noData" v-if="state.friendsList.length === 0">
|
||||
<img src="@/static/image/search/search-no-data.png" />
|
||||
<span>
|
||||
{{
|
||||
searchVal
|
||||
? $t('addFriend.message.notFindData')
|
||||
: $t('search.hint')
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</zPaging>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import customInput from '@/components/custom-input/custom-input.vue'
|
||||
import zPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
|
||||
import avatarModule from '@/components/avatar-module/index.vue'
|
||||
import { ServeFriendSearch } from '@/api/addressBook/index'
|
||||
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { t } = useI18n()
|
||||
|
||||
const searchVal = ref('')
|
||||
|
||||
const state = reactive({
|
||||
friendsListPage: 1, //当前查询的可添加好友列表分页
|
||||
friendsListPageSize: 10, //可添加好友列表单页数量
|
||||
friendsList: [], //可添加好友列表
|
||||
hasMoreFriends: true, //是否还有更多可添加好友数据
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getFriendsList()
|
||||
})
|
||||
|
||||
//输入搜索内容
|
||||
const inputSearchText = (e) => {
|
||||
searchVal.value = e
|
||||
}
|
||||
|
||||
//搜索可添加好友(精确搜索)
|
||||
const getFriendsList = () => {
|
||||
let params = {
|
||||
name: searchVal.value,
|
||||
}
|
||||
ServeFriendSearch(params)
|
||||
.then((res) => {
|
||||
console.error(res)
|
||||
if (res?.code === 200) {
|
||||
if (state.friendsListPage === 1) {
|
||||
state.friendsList = res.data?.user_list || []
|
||||
} else {
|
||||
state.friendsList = state.friendsList.concat(
|
||||
res.data?.user_list || [],
|
||||
)
|
||||
}
|
||||
if (state.friendsList.length < res.data?.count) {
|
||||
state.hasMoreFriends = true
|
||||
} else {
|
||||
state.hasMoreFriends = false
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
|
||||
//点击进入用户详情页面
|
||||
const toUserDetail = (userInfo) => {
|
||||
uni.navigateTo({
|
||||
url:
|
||||
'/pages/dialog/dialogDetail/userDetail??erpUserId=' +
|
||||
userInfo.erp_user_id,
|
||||
})
|
||||
}
|
||||
|
||||
//加载更多数据
|
||||
const doLoadMore = (e) => {
|
||||
state.friendsListPage += 1
|
||||
getFriendsList()
|
||||
}
|
||||
|
||||
watch(
|
||||
() => searchVal.value,
|
||||
(newVal) => {
|
||||
state.friendsListPage = 1
|
||||
getFriendsList()
|
||||
},
|
||||
)
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
::v-deep .zp-paging-container-content {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
::v-deep .index_top_navbar .tmicon-angle-left {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
::v-deep .index_top_navbar .text-weight-b {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
::v-deep .index_top_navbar .statusHeightTop > .noNvueBorder:first-child {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.top_bg {
|
||||
background: url('@/static/image/mine/page_top.png') no-repeat;
|
||||
background-size: cover;
|
||||
background-position: bottom center;
|
||||
}
|
||||
|
||||
:deep(.animateAll_tabs_tmui) {
|
||||
width: 120rpx !important;
|
||||
height: 10rpx !important;
|
||||
}
|
||||
|
||||
.add-friend-page {
|
||||
.add-friend {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: url('@/static/image/clockIn/z3280@3x.png');
|
||||
background-size: cover;
|
||||
background-position: bottom center;
|
||||
background-attachment: fixed;
|
||||
width: 100%;
|
||||
|
||||
.add-friend-list {
|
||||
margin: 30rpx 24rpx;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
gap: 30rpx 0;
|
||||
|
||||
.members-list-each {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.swipe-action {
|
||||
width: 100%;
|
||||
overflow: visible !important;
|
||||
|
||||
:deep(.wd-swipe-action__right) {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #cf3050;
|
||||
padding: 0 48rpx;
|
||||
border-radius: 0 8rpx 8rpx 0;
|
||||
span {
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.members-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
gap: 16rpx;
|
||||
padding: 24rpx 24rpx 0;
|
||||
|
||||
.members-info-area {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
gap: 16rpx;
|
||||
|
||||
.members-info-basic {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
|
||||
.members-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
width: 150rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.members-jobNum {
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
word-break: break-all;
|
||||
margin: 10rpx 0 0;
|
||||
}
|
||||
|
||||
.members-company {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.members-positions-area {
|
||||
.members-positions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
gap: 10rpx;
|
||||
padding: 4rpx 0 0;
|
||||
max-height: 84rpx;
|
||||
overflow: hidden;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
|
||||
.members-positions-each {
|
||||
background-color: #eee9f8;
|
||||
line-height: 1;
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
color: #46299d;
|
||||
}
|
||||
}
|
||||
.members-positions-popover-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10rpx 0;
|
||||
|
||||
.members-positions-popover {
|
||||
background-color: #eee9f8;
|
||||
line-height: 1;
|
||||
font-size: 24rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
color: #46299d;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.company-infos {
|
||||
margin: 0 0 0 88rpx;
|
||||
padding: 0 0 24rpx 24rpx;
|
||||
.company-each {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.addressBook-noData {
|
||||
margin: 30rpx 24rpx;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
gap: 30rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
width: 500rpx;
|
||||
}
|
||||
span {
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -46,7 +46,10 @@
|
||||
<div class="address-book-tabs-panes-list">
|
||||
<div
|
||||
class="tabs-panes-each address-book-company"
|
||||
v-if="state.addressBookActiveTab === 'company'"
|
||||
v-if="
|
||||
state.addressBookActiveTab === 'company' &&
|
||||
state.myContractList.length > 0
|
||||
"
|
||||
>
|
||||
<div class="address-book-company-name">
|
||||
<span>{{ state.myCompany }}</span>
|
||||
@ -72,7 +75,7 @@
|
||||
}"
|
||||
></avatarModule>
|
||||
<div class="members-info-area">
|
||||
<div class="members-info-basic">
|
||||
<div class="members-info-basic" style="padding: 0 0 24rpx;">
|
||||
<span class="members-name">
|
||||
{{ item.nickname }}
|
||||
</span>
|
||||
@ -129,7 +132,10 @@
|
||||
</div>
|
||||
<div
|
||||
class="tabs-panes-each address-book-friends"
|
||||
v-if="state.addressBookActiveTab === 'friends'"
|
||||
v-if="
|
||||
state.addressBookActiveTab === 'friends' &&
|
||||
state.myFriendsList.length > 0
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="members-list-each"
|
||||
@ -137,62 +143,43 @@
|
||||
:key="index"
|
||||
@click="toUserDetail(item)"
|
||||
>
|
||||
<div class="members-info">
|
||||
<avatarModule
|
||||
:mode="1"
|
||||
:avatar="item.avatar"
|
||||
:groupType="0"
|
||||
:userName="item.nickname"
|
||||
:customStyle="{ width: '72rpx', height: '72rpx' }"
|
||||
:customTextStyle="{
|
||||
fontSize: '32rpx',
|
||||
fontWeight: 'bold',
|
||||
color: '#fff',
|
||||
lineHeight: '44rpx',
|
||||
}"
|
||||
></avatarModule>
|
||||
<div class="members-info-area">
|
||||
<div class="members-info-basic">
|
||||
<span class="members-name">
|
||||
{{ item.nickname }}
|
||||
</span>
|
||||
<span class="members-jobNum">
|
||||
{{ item.job_num }}
|
||||
</span>
|
||||
<!-- <span class="members-company">{{ item.company_name }}</span> -->
|
||||
</div>
|
||||
<div class="members-positions-area">
|
||||
<tm-popover position="bc">
|
||||
<tm-scrolly :refresher="false" :height="84">
|
||||
<div class="members-positions">
|
||||
<div
|
||||
class="members-positions-each"
|
||||
v-for="(postionItem,
|
||||
positionIndex) in item.user_position"
|
||||
:key="positionIndex"
|
||||
>
|
||||
{{ postionItem.position_name }}
|
||||
</div>
|
||||
</div>
|
||||
</tm-scrolly>
|
||||
<template v-slot:label>
|
||||
<tm-scrolly
|
||||
:refresher="false"
|
||||
:height="
|
||||
item.user_position.length >= 4
|
||||
? 180
|
||||
: item.user_position.length === 3
|
||||
? 140
|
||||
: item.user_position.length === 2
|
||||
? 100
|
||||
: item.user_position.length === 1
|
||||
? 60
|
||||
: 0
|
||||
"
|
||||
>
|
||||
<div class="members-positions-popover-box">
|
||||
<wd-swipe-action
|
||||
class="swipe-action"
|
||||
@click="showDeleteModal(item, index)"
|
||||
>
|
||||
<div class="members-info">
|
||||
<avatarModule
|
||||
:mode="1"
|
||||
:avatar="item.avatar"
|
||||
:groupType="0"
|
||||
:userName="item.nickname"
|
||||
:customStyle="{ width: '72rpx', height: '72rpx' }"
|
||||
:customTextStyle="{
|
||||
fontSize: '32rpx',
|
||||
fontWeight: 'bold',
|
||||
color: '#fff',
|
||||
lineHeight: '44rpx',
|
||||
}"
|
||||
></avatarModule>
|
||||
<div class="members-info-area">
|
||||
<div
|
||||
class="members-info-basic"
|
||||
:style="{ padding: item.company_name ? 0 : '0 0 24rpx' }"
|
||||
>
|
||||
<span class="members-name">
|
||||
{{ item.nickname }}
|
||||
</span>
|
||||
<span class="members-jobNum">
|
||||
{{ item.job_num }}
|
||||
</span>
|
||||
<!-- <span class="members-company">{{ item.company_name }}</span> -->
|
||||
</div>
|
||||
<div class="members-positions-area">
|
||||
<tm-popover position="bc">
|
||||
<tm-scrolly :refresher="false" :height="84">
|
||||
<div class="members-positions">
|
||||
<div
|
||||
class="members-positions-popover"
|
||||
class="members-positions-each"
|
||||
v-for="(postionItem,
|
||||
positionIndex) in item.user_position"
|
||||
:key="positionIndex"
|
||||
@ -201,21 +188,60 @@
|
||||
</div>
|
||||
</div>
|
||||
</tm-scrolly>
|
||||
</template>
|
||||
</tm-popover>
|
||||
<template v-slot:label>
|
||||
<tm-scrolly
|
||||
:refresher="false"
|
||||
:height="
|
||||
item.user_position.length >= 4
|
||||
? 180
|
||||
: item.user_position.length === 3
|
||||
? 140
|
||||
: item.user_position.length === 2
|
||||
? 100
|
||||
: item.user_position.length === 1
|
||||
? 60
|
||||
: 0
|
||||
"
|
||||
>
|
||||
<div class="members-positions-popover-box">
|
||||
<div
|
||||
class="members-positions-popover"
|
||||
v-for="(postionItem,
|
||||
positionIndex) in item.user_position"
|
||||
:key="positionIndex"
|
||||
>
|
||||
{{ postionItem.position_name }}
|
||||
</div>
|
||||
</div>
|
||||
</tm-scrolly>
|
||||
</template>
|
||||
</tm-popover>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="company-infos" v-if="item.company_name">
|
||||
<div class="company-each">
|
||||
<span>{{ item.company_name }}</span>
|
||||
<div class="company-infos" v-if="item.company_name">
|
||||
<div class="company-each">
|
||||
<span>{{ item.company_name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right>
|
||||
<div
|
||||
v-for="(swipeActionItem,
|
||||
swipeActionIndex) in state.swipeAction"
|
||||
:key="swipeActionIndex"
|
||||
>
|
||||
<span>{{ swipeActionItem.text }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</wd-swipe-action>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="tabs-panes-each address-book-groups"
|
||||
v-if="state.addressBookActiveTab === 'groups'"
|
||||
v-if="
|
||||
state.addressBookActiveTab === 'groups' &&
|
||||
state.myGroupsList.length > 0
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="groups-list-each"
|
||||
@ -252,8 +278,47 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="addressBook-noData"
|
||||
v-if="
|
||||
!state.isLoadingData &&
|
||||
((state.addressBookActiveTab === 'company' &&
|
||||
state.myContractList.length === 0) ||
|
||||
(state.addressBookActiveTab === 'friends' &&
|
||||
state.myFriendsList.length === 0) ||
|
||||
(state.addressBookActiveTab === 'groups' &&
|
||||
state.myGroupsList.length === 0))
|
||||
"
|
||||
>
|
||||
<img src="@/static/image/search/search-no-data.png" />
|
||||
<span>
|
||||
{{
|
||||
searchVal
|
||||
? $t('addFriend.message.notFindData')
|
||||
: $t('search.hint')
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<tm-modal
|
||||
class="friendDeleteModal"
|
||||
ref="friendDeleteModalRef"
|
||||
:mask="true"
|
||||
:okText="$t('ok')"
|
||||
okColor="#46299d"
|
||||
cancelColor="#999"
|
||||
@ok="doDeleteFriend"
|
||||
@cancel="hideDeleteModal"
|
||||
:teleport="false"
|
||||
titleStyle="font-size: 40rpx;font-weight: 600;line-height: 1;"
|
||||
:height="300"
|
||||
:round="4"
|
||||
>
|
||||
<div class="friendDeleteModal-content">
|
||||
<span>{{ $t('addressBook.message.doOrNotDeleteFriend') }}</span>
|
||||
</div>
|
||||
</tm-modal>
|
||||
</zPaging>
|
||||
</div>
|
||||
</template>
|
||||
@ -269,13 +334,17 @@ import { ServeUserGroupChatList, ServeCreateTalkList } from '@/api/chat/index'
|
||||
import { ServeGetSessionId } from '@/api/search/index'
|
||||
import { formatTalkItem } from '@/utils/talk'
|
||||
import { useDialogueStore, useTalkStore } from '@/store'
|
||||
import { ServeQueryFriendsList } from '@/api/addressBook/index'
|
||||
import {
|
||||
ServeQueryFriendsList,
|
||||
ServeDeleteFriend,
|
||||
} from '@/api/addressBook/index'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { t } = useI18n()
|
||||
|
||||
const navshow = ref(false)
|
||||
const searchVal = ref('')
|
||||
const friendDeleteModalRef = ref(null)
|
||||
|
||||
const state = reactive({
|
||||
addressBookTabs: [], //tab页
|
||||
@ -293,6 +362,8 @@ const state = reactive({
|
||||
myGroupsList: [], //我的群组列表
|
||||
hasMoreGroups: true, //是否还有更多我的群组数据
|
||||
myCompany: '', //当前登录人公司别
|
||||
swipeAction: [], //左滑操作栏按钮组
|
||||
isLoadingData: true, //是否正在加载数据
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
@ -312,6 +383,11 @@ const goWebHome = () => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
state.swipeAction = [
|
||||
{
|
||||
text: t('addressBook.btns.delete'), //操作按钮的文本,
|
||||
},
|
||||
]
|
||||
state.addressBookTabs = [
|
||||
{
|
||||
key: 'company',
|
||||
@ -349,9 +425,11 @@ const getMyContractList = () => {
|
||||
name: searchVal.value,
|
||||
}
|
||||
console.error(params)
|
||||
state.isLoadingData = true
|
||||
ServeQueryFriendsList(params)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
state.isLoadingData = false
|
||||
if (res?.code === 200) {
|
||||
state.myCompany = res.data?.company_name
|
||||
if (state.myContractListPage === 1) {
|
||||
@ -368,7 +446,9 @@ const getMyContractList = () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch((err) => {
|
||||
state.isLoadingData = false
|
||||
})
|
||||
}
|
||||
|
||||
//获取“我的好友”列表
|
||||
@ -380,9 +460,11 @@ const getMyFriendsList = () => {
|
||||
name: searchVal.value,
|
||||
}
|
||||
console.error(params)
|
||||
state.isLoadingData = true
|
||||
ServeQueryFriendsList(params)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
state.isLoadingData = false
|
||||
if (res?.code === 200) {
|
||||
if (state.myFriendsListPage === 1) {
|
||||
state.myFriendsList = res.data?.user_list || []
|
||||
@ -398,7 +480,9 @@ const getMyFriendsList = () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch((err) => {
|
||||
state.isLoadingData = false
|
||||
})
|
||||
}
|
||||
|
||||
//点击进入用户详情页面
|
||||
@ -417,9 +501,11 @@ const getMyGroupsList = () => {
|
||||
page_size: state.myGroupsListPageSize,
|
||||
group_name: searchVal.value,
|
||||
}
|
||||
state.isLoadingData = true
|
||||
ServeUserGroupChatList(params)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
state.isLoadingData = false
|
||||
if (res?.code === 200) {
|
||||
if (state.myGroupsListPage === 1) {
|
||||
state.myGroupsList = res.data?.items || []
|
||||
@ -433,7 +519,9 @@ const getMyGroupsList = () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch((err) => {
|
||||
state.isLoadingData = false
|
||||
})
|
||||
}
|
||||
|
||||
//加载更多数据
|
||||
@ -496,6 +584,35 @@ const toGroupChat = async (groupInfo) => {
|
||||
})
|
||||
}
|
||||
|
||||
//显示删除好友确认框
|
||||
const showDeleteModal = (userInfo, friendIndex) => {
|
||||
friendDeleteModalRef.value.open({
|
||||
userInfo,
|
||||
friendIndex,
|
||||
})
|
||||
}
|
||||
|
||||
//关闭删除好友确认框
|
||||
const hideDeleteModal = () => {
|
||||
friendDeleteModalRef.value.close()
|
||||
}
|
||||
|
||||
//删除好友
|
||||
const doDeleteFriend = (args) => {
|
||||
console.log(args.userInfo, args.friendIndex)
|
||||
let params = {
|
||||
receiver_id: args.userInfo.id, //聊天的用户id
|
||||
talk_type: 1,
|
||||
}
|
||||
ServeDeleteFriend(params).then((res) => {
|
||||
console.log(res)
|
||||
if (res?.code === 200) {
|
||||
message.success(t('addressBook.message.deleteSuccess') + ' !')
|
||||
state.myFriendsList.splice(args.friendIndex, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 映射表-根据groupType设置对应值
|
||||
const groupTypeMapping = {
|
||||
0: {},
|
||||
@ -519,15 +636,12 @@ watch(
|
||||
(newVal) => {
|
||||
if (newVal === 'company') {
|
||||
state.myContractListPage = 1
|
||||
state.myContractList = []
|
||||
getMyContractList()
|
||||
} else if (newVal === 'friends') {
|
||||
state.myFriendsListPage = 1
|
||||
state.myFriendsList = []
|
||||
getMyFriendsList()
|
||||
} else if (newVal === 'groups') {
|
||||
state.myGroupsListPage = 1
|
||||
state.myGroupsList = []
|
||||
getMyGroupsList()
|
||||
}
|
||||
},
|
||||
@ -538,15 +652,12 @@ watch(
|
||||
(newVal) => {
|
||||
if (newVal === 'company') {
|
||||
state.myContractListPage = 1
|
||||
state.myContractList = []
|
||||
getMyContractList()
|
||||
} else if (state.addressBookActiveTab === 'friends') {
|
||||
state.myFriendsListPage = 1
|
||||
state.myFriendsList = []
|
||||
getMyFriendsList()
|
||||
} else if (state.addressBookActiveTab === 'groups') {
|
||||
state.myGroupsListPage = 1
|
||||
state.myGroupsList = []
|
||||
getMyGroupsList()
|
||||
}
|
||||
},
|
||||
@ -594,7 +705,11 @@ watch(
|
||||
width: 100%;
|
||||
|
||||
.address-book-tabs-panes-list {
|
||||
padding: 30rpx 24rpx;
|
||||
margin: 30rpx 24rpx;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tabs-panes-each {
|
||||
gap: 30rpx 0;
|
||||
@ -621,15 +736,36 @@ watch(
|
||||
justify-content: center;
|
||||
background-color: #fff;
|
||||
width: 100%;
|
||||
padding: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.swipe-action {
|
||||
width: 100%;
|
||||
overflow: visible !important;
|
||||
|
||||
:deep(.wd-swipe-action__right) {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #cf3050;
|
||||
padding: 0 48rpx;
|
||||
border-radius: 0 8rpx 8rpx 0;
|
||||
span {
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.members-info {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
gap: 16rpx;
|
||||
padding: 24rpx 24rpx 0;
|
||||
|
||||
.members-info-area {
|
||||
display: flex;
|
||||
@ -710,6 +846,7 @@ watch(
|
||||
}
|
||||
.company-infos {
|
||||
margin: 0 0 0 88rpx;
|
||||
padding: 0 0 24rpx 24rpx;
|
||||
.company-each {
|
||||
span {
|
||||
font-size: 24rpx;
|
||||
@ -772,6 +909,34 @@ watch(
|
||||
}
|
||||
}
|
||||
}
|
||||
.addressBook-noData {
|
||||
margin: 30rpx 24rpx;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
gap: 30rpx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
img {
|
||||
width: 500rpx;
|
||||
}
|
||||
span {
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.friendDeleteModal {
|
||||
.friendDeleteModal-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -692,7 +692,7 @@
|
||||
v-if="talkParams.type === 1 && !state.isFriendOrSameCompany"
|
||||
>
|
||||
<template #right>
|
||||
<div class="addFriendBtn">
|
||||
<div class="addFriendBtn" @click="doAddFriend">
|
||||
<span>{{ $t('addressBook.btns.add') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@ -766,7 +766,7 @@ import zu6053 from '@/static/image/chatList/zu6053@2x.png'
|
||||
import deepBubble from '@/components/deep-bubble/deep-bubble.vue'
|
||||
import { isRevoke } from './menu'
|
||||
import useConfirm from '@/components/x-confirm/useConfirm.js'
|
||||
import { ServeCheckFriend } from '@/api/addressBook/index'
|
||||
import { ServeCheckFriend, ServeAddFriend } from '@/api/addressBook/index'
|
||||
import {
|
||||
onLoad as uniOnload,
|
||||
onUnload as uniOnUnload,
|
||||
@ -2760,6 +2760,21 @@ const checkNeedAddFriend = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//主动加好友(单向好友)
|
||||
const doAddFriend = () => {
|
||||
let params = {
|
||||
receiver_id: talkParams.receiver_id, //聊天的用户id
|
||||
talk_type: 1,
|
||||
}
|
||||
ServeAddFriend(params).then((res) => {
|
||||
console.log(res)
|
||||
if (res?.code === 200) {
|
||||
message.success(t('addressBook.message.addSuccess') + ' !')
|
||||
state.value.isFriendOrSameCompany = true
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.dialog-page {
|
||||
|
@ -6,10 +6,12 @@ import { MessageComponents } from '@/constant/message'
|
||||
import { ITalkRecord } from '@/types/chat'
|
||||
import WdLoading from "@/uni_modules/wot-design-uni/components/wd-loading/wd-loading.vue";
|
||||
import { useInject } from '@/hooks'
|
||||
import { parseTime } from '@/utils/datetime'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const msgId = ref(null)
|
||||
const createdAt = ref(null)
|
||||
const { showUserInfoModal } = useInject()
|
||||
const isShow = ref(true)
|
||||
const items = ref<ITalkRecord[]>([])
|
||||
@ -21,7 +23,8 @@ const onMaskClick = () => {
|
||||
|
||||
const onLoadData = () => {
|
||||
ServeGetForwardRecords({
|
||||
msg_id: msgId.value
|
||||
msg_id: msgId.value,
|
||||
biz_date: createdAt.value
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
items.value = res.data.items || []
|
||||
@ -41,6 +44,7 @@ onMounted(() => {
|
||||
const page = pages[pages.length - 1]
|
||||
const options = page.$page.options
|
||||
msgId.value = options.msgId
|
||||
createdAt.value = parseTime(new Date((options.created_at as any)), '{y}{m}')
|
||||
console.log(msgId.value,'msgId.value');
|
||||
|
||||
onLoadData()
|
||||
|
@ -87,7 +87,7 @@
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
<div
|
||||
@click="toAddressBookPage"
|
||||
@click="toAddFriendPage"
|
||||
class="flex items-center pl-[22rpx] py-[32rpx]"
|
||||
>
|
||||
<div class="mr-[26rpx] flex items-center">
|
||||
@ -235,6 +235,13 @@ const toSearchPage = () => {
|
||||
})
|
||||
}
|
||||
|
||||
//点击跳转到添加好友页面
|
||||
const toAddFriendPage = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/addressBook/addFriend/index',
|
||||
})
|
||||
}
|
||||
|
||||
//点击跳转到通讯录页面
|
||||
const toAddressBookPage = () => {
|
||||
// 旧版本-按组织架构树的通讯录
|
||||
|
@ -193,12 +193,12 @@ onMounted(() => {
|
||||
const inputSearchText = (e) => {
|
||||
if (e.trim() != state.searchText.trim()) {
|
||||
state.pageNum = 1
|
||||
state.searchResult = null // 清空搜索结果
|
||||
state.searchResult = null // 清空搜索结果
|
||||
emits('lastIdChange', 0, 0, 0)
|
||||
}
|
||||
state.searchText = e.trim()
|
||||
if (!e.trim()) {
|
||||
state.searchResult = null // 清空搜索结果
|
||||
state.searchResult = null // 清空搜索结果
|
||||
emits('lastIdChange', 0, 0, 0)
|
||||
}
|
||||
zPaging.value?.reload()
|
||||
@ -291,7 +291,9 @@ const queryAllSearch = (pageNum, searchResultPageSize) => {
|
||||
zPaging.value?.complete([])
|
||||
} else {
|
||||
// 加载更多且为空,保持原列表不变
|
||||
zPaging.value?.complete(state.searchResult ? [state.searchResult] : [])
|
||||
zPaging.value?.complete(
|
||||
state.searchResult ? [state.searchResult] : [],
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if (props.isPagination) {
|
||||
@ -303,7 +305,8 @@ const queryAllSearch = (pageNum, searchResultPageSize) => {
|
||||
if (
|
||||
paginationKey &&
|
||||
Array.isArray(
|
||||
(state?.searchResult && state?.searchResult[paginationKey]) || [],
|
||||
(state?.searchResult && state?.searchResult[paginationKey]) ||
|
||||
[],
|
||||
)
|
||||
) {
|
||||
data[paginationKey] = state.searchResult[paginationKey].concat(
|
||||
@ -328,8 +331,58 @@ const queryAllSearch = (pageNum, searchResultPageSize) => {
|
||||
} else if (state?.first_talk_record_infos?.talk_type === 2) {
|
||||
total = data.group_record_count
|
||||
}
|
||||
let noMoreSearchResultRecord = true
|
||||
if (
|
||||
Object.keys(data).includes('talk_record_infos') &&
|
||||
state.searchResult['talk_record_infos']?.length > 0
|
||||
) {
|
||||
//搜聊天记录详情
|
||||
if (state.searchResult['talk_record_infos']?.length < total) {
|
||||
noMoreSearchResultRecord = false
|
||||
}
|
||||
}
|
||||
zPaging.value?.completeByNoMore([data], noMoreSearchResultRecord)
|
||||
} else {
|
||||
let noMoreSearchResultUser = true
|
||||
let noMoreSearchResultGroup = true
|
||||
let noMoreSearchResultGeneral = true
|
||||
if (
|
||||
Object.keys(data).includes('user_infos') &&
|
||||
state.searchResult['user_infos']?.length > 0
|
||||
) {
|
||||
//搜人
|
||||
if (state.searchResult['user_infos']?.length < total) {
|
||||
noMoreSearchResultUser = false
|
||||
}
|
||||
}
|
||||
if (
|
||||
Object.keys(data).includes(
|
||||
'group_member_infos' || 'group_infos',
|
||||
) &&
|
||||
state.searchResult['combinedGroup']?.length > 0
|
||||
) {
|
||||
//搜群
|
||||
if (state.searchResult['combinedGroup']?.length < total) {
|
||||
noMoreSearchResultGroup = false
|
||||
}
|
||||
}
|
||||
if (
|
||||
Object.keys(data).includes('general_infos') &&
|
||||
state.searchResult['general_infos']?.length > 0
|
||||
) {
|
||||
//搜聊天记录
|
||||
if (state.searchResult['general_infos']?.length < total) {
|
||||
noMoreSearchResultGeneral = false
|
||||
}
|
||||
}
|
||||
// zPaging.value?.completeByTotal([data], total)
|
||||
zPaging.value?.completeByNoMore(
|
||||
[data],
|
||||
noMoreSearchResultUser &&
|
||||
noMoreSearchResultGroup &&
|
||||
noMoreSearchResultGeneral,
|
||||
)
|
||||
}
|
||||
zPaging.value?.completeByTotal([data], total)
|
||||
} else {
|
||||
state.searchResult = data
|
||||
zPaging.value?.complete([data])
|
||||
@ -368,7 +421,7 @@ const cancelSearch = () => {
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/index'
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -203,11 +203,20 @@
|
||||
"btns": {
|
||||
"enterGroup": "进入群聊",
|
||||
"addFriend": "添加好友",
|
||||
"add": "添加"
|
||||
"add": "添加",
|
||||
"delete": "删除"
|
||||
},
|
||||
"message": {
|
||||
"addSuccess": "添加成功",
|
||||
"notFriendsOrSameCompany": "对方还不是您的好友,请添加到通讯录中吧!"
|
||||
"notFriendsOrSameCompany": "对方还不是您的好友,请添加到通讯录中吧!",
|
||||
"deleteSuccess": "删除成功",
|
||||
"doOrNotDeleteFriend": "是否删除该好友"
|
||||
}
|
||||
},
|
||||
"addFriend": {
|
||||
"pageTitle": "添加好友",
|
||||
"message": {
|
||||
"notFindData": "没有找到哦~"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user