2024-12-19 03:02:47 +00:00
|
|
|
|
<template>
|
|
|
|
|
<div>
|
2025-02-08 09:09:57 +00:00
|
|
|
|
<div
|
|
|
|
|
@click="cellClick"
|
|
|
|
|
:class="['chatItem', props.data.is_top === 1 ? 'isTop' : '']"
|
|
|
|
|
>
|
2024-12-19 03:02:47 +00:00
|
|
|
|
<div>
|
2025-02-08 09:09:57 +00:00
|
|
|
|
<tm-checkbox
|
|
|
|
|
v-if="props.isMultiSelect"
|
|
|
|
|
:round="10"
|
|
|
|
|
:modelValue="props.data.isCheck"
|
|
|
|
|
@update:modelValue="props.data.isCheck = !props.data.isCheck"
|
|
|
|
|
:size="32"
|
|
|
|
|
:color="props.data.isCheck ? '#46299D' : '#BABABA'"
|
|
|
|
|
class="pr-[4rpx]"
|
|
|
|
|
></tm-checkbox>
|
2024-12-19 03:02:47 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="avatarImg">
|
2025-02-08 09:09:57 +00:00
|
|
|
|
<avatarModule
|
|
|
|
|
:mode="2"
|
|
|
|
|
:avatar="props?.data?.avatar"
|
|
|
|
|
:groupType="props?.data?.group_type"
|
|
|
|
|
:customStyle="{ width: '96rpx', height: '96rpx' }"
|
|
|
|
|
></avatarModule>
|
2024-12-19 03:02:47 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="chatInfo">
|
|
|
|
|
<div class="chatInfo_1">
|
|
|
|
|
<div class="flex items-center">
|
2025-02-08 09:09:57 +00:00
|
|
|
|
<div
|
|
|
|
|
class="text-[#171717] text-[32rpx] font-medium leading-[44rpx]"
|
|
|
|
|
>
|
|
|
|
|
<span>{{ props.data.name }}</span>
|
2025-03-14 02:33:14 +00:00
|
|
|
|
<span v-if="props.data.talk_type === 2">({{ props.data.group_member_num }})</span>
|
2025-02-08 09:09:57 +00:00
|
|
|
|
</div>
|
2024-12-19 03:02:47 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-08 09:09:57 +00:00
|
|
|
|
<div
|
|
|
|
|
v-if="props.index !== talkStore.talkItems.length - 1"
|
|
|
|
|
class="divider"
|
|
|
|
|
></div>
|
2024-12-19 03:02:47 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
2025-02-08 09:09:57 +00:00
|
|
|
|
import avatarModule from '@/components/avatar-module/index.vue'
|
|
|
|
|
import { ref, reactive, defineProps, defineEmits } from 'vue'
|
|
|
|
|
import dayjs from 'dayjs'
|
2024-12-19 03:02:47 +00:00
|
|
|
|
import { beautifyTime } from '@/utils/datetime'
|
|
|
|
|
import { ServeClearTalkUnreadNum } from '@/api/chat'
|
|
|
|
|
import { useTalkStore, useDialogueStore } from '@/store'
|
|
|
|
|
import { useSessionMenu } from '@/hooks'
|
|
|
|
|
|
|
|
|
|
const talkStore = useTalkStore()
|
2025-02-08 09:09:57 +00:00
|
|
|
|
const { onToTopTalk } = useSessionMenu()
|
2024-12-19 03:02:47 +00:00
|
|
|
|
const dialogueStore = useDialogueStore()
|
|
|
|
|
const emit = defineEmits(['itemClick'])
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
data: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {},
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
index: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: -1,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
isMultiSelect: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
2025-02-08 09:09:57 +00:00
|
|
|
|
})
|
2024-12-19 03:02:47 +00:00
|
|
|
|
|
|
|
|
|
const cellClick = () => {
|
|
|
|
|
emit('itemClick', props.data)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.chatItem {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 154rpx;
|
2025-02-08 09:09:57 +00:00
|
|
|
|
padding: 24rpx 18rpx;
|
2024-12-19 03:02:47 +00:00
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
&.isTop {
|
2025-02-08 09:09:57 +00:00
|
|
|
|
background-color: #f3f3f3;
|
2024-12-19 03:02:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.avatarImg {
|
|
|
|
|
height: 96rpx;
|
|
|
|
|
width: 96rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chatInfo {
|
|
|
|
|
flex: 1;
|
2025-02-08 09:09:57 +00:00
|
|
|
|
margin-left: 16rpx;
|
2024-12-19 03:02:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chatInfo_1 {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chatInfo_2 {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 6rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chatInfo_2_1 {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #000000;
|
|
|
|
|
opacity: 40%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.companyTag {
|
|
|
|
|
width: 76rpx;
|
|
|
|
|
height: 38rpx;
|
2025-02-08 09:09:57 +00:00
|
|
|
|
border: 1px solid #7a58de;
|
2024-12-19 03:02:47 +00:00
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 6rpx;
|
2025-02-08 09:09:57 +00:00
|
|
|
|
color: #7a58de;
|
2024-12-19 03:02:47 +00:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
margin-left: 12rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.textEllipsis {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: 1;
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.divider {
|
|
|
|
|
background-color: rgba(243, 243, 243, 1);
|
|
|
|
|
height: 1rpx;
|
|
|
|
|
margin: 0 18rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|