fix bug#3888
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wwt 2025-03-17 15:43:10 +08:00
parent 16300b68bf
commit ad2b7d42e3
2 changed files with 10 additions and 5 deletions

View File

@ -12,9 +12,9 @@ const props = defineProps<{
const isShowRecord = ref(false)
const title = computed(() => {
return [...new Set(props.extra.records.map((v) => v.nickname))].join('')
return [...new Set(props.extra.records.map((v) => v.nickname))].join('')
})
console.log(props.extra.records)
const onClick = () => {
// isShowRecord.value = true
uni.navigateTo({
@ -24,7 +24,7 @@ const onClick = () => {
</script>
<template>
<section class="im-message-forward pointer" :class="{ left: data.float === 'left' }" @click="onClick">
<div class="title">{{ title }} 的会话记录</div>
<div class="title">{{ title }}<span v-if="props.extra.records.length > 2"></span>的会话记录</div>
<div class="list" v-for="(record, index) in extra.records" :key="index">
<p>
<span>{{ record.nickname }}: </span>

View File

@ -24,8 +24,13 @@ const onLoadData = () => {
}).then((res) => {
if (res.code == 200) {
items.value = res.data.items || []
title.value = [...new Set(items.value.map((v) => v.nickname))].join('、')
//
const uniqueNames = [...new Set(items.value.map(v => v.nickname))];
if (uniqueNames.length <= 2) {
title.value = uniqueNames.join('和');
} else {
title.value = uniqueNames.slice(0, 2).join('和') + '等';
}
}
})
}