This commit is contained in:
2026-09-24 14:58:23 +08:00
parent 6e8bb2e0a0
commit 0a1a312418
6 changed files with 63 additions and 31 deletions
+8 -6
View File
@@ -26,7 +26,7 @@
<view v-if="!list.length" class="empty">暂无消息发一条试试</view>
<view v-for="(m, i) in list" :key="m.id || i">
<view v-if="showTime(i)" class="chip-time">{{ timeOf(m) }}</view>
<view v-if="m.recalled" class="sys">{{ m.text || '已撤回一条消息' }}</view>
<view v-if="m.recalled || m.kind === 'system'" class="sys">{{ m.text || '已撤回一条消息' }}</view>
<view
v-else
class="row"
@@ -37,7 +37,7 @@
<view v-if="selecting" class="ck" :class="{ on: isPicked(m) }" />
<view v-if="!m.mine" class="av" @click.stop="openSender(m)">
<fy-file-mark v-if="isFiles" />
<image v-else-if="avatarOf(m)" :src="avatarOf(m)" mode="aspectFill" />
<image v-else-if="avatarOf(m)" class="face" :src="avatarOf(m)" mode="aspectFill" />
<text v-else>{{ initialOf(m) }}</text>
</view>
<view class="col" :class="{ mine: m.mine }">
@@ -61,7 +61,7 @@
<text v-if="m.mine" class="tm" :class="{ read: readDone(m) }" @click="showRead(m)">{{ readLabel(m) }}</text>
</view>
<view v-if="m.mine" class="av self">
<image v-if="myAvatar" :src="myAvatar" mode="aspectFill" />
<image v-if="myAvatar" class="face" :src="myAvatar" mode="aspectFill" />
<text v-else>{{ myInitial }}</text>
</view>
</view>
@@ -779,7 +779,9 @@ export default {
}
},
openSender(m) {
if (m.fromId) uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(m.fromId) })
const id = m && m.fromId
if (!id || !store.person(id)) return
uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(id) })
},
goMore() {
if (this.isGroup) uni.navigateTo({ url: '/pages/chat/group?sid=' + encodeURIComponent(this.sid) })
@@ -836,8 +838,8 @@ export default {
.col { max-width: 72%; display: flex; flex-direction: column; }
.col.mine { align-items: flex-end; }
.av { width: 76rpx; height: 76rpx; border-radius: 16rpx; background: #E8F1FF; color: #1677FF; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28rpx; font-weight: 650; }
.av.self { background: #1677FF; color: #fff; }
.av image { width: 76rpx; height: 76rpx; }
.av.self { background: #E8F1FF; color: #1677FF; }
.face { width: 76rpx; height: 76rpx; display: block; }
.who { font-size: 22rpx; color: #9CA3AF; margin: 0 4rpx 8rpx; }
.ball {
background: #fff;