fix(消息头像): 修复消息列表中接收者头像显示问题

This commit is contained in:
yangzhe 2026-03-19 17:00:46 +08:00
parent f043ee6fa3
commit 28c617a33d
2 changed files with 14 additions and 13 deletions

12
App.vue
View File

@ -230,9 +230,10 @@ export default {
receiverId: data.ReceiverId,
sendDate: data.SendDate,
message: data.Message,
sendUserType: 2,
sendUserType: data.SendUserType, // 0 AI 1 2 3
};
const id = data.Id || data.id || Math.random().toString(36).substring(2);
const id =
data.Id || data.id || Math.random().toString(36).substring(2);
const msg = {
...processData,
messageType: 0,
@ -403,9 +404,10 @@ uni-page-body {
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
"Microsoft Yahei", sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Microsoft Yahei",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
// max-width: 1536rpx;

View File

@ -245,7 +245,7 @@
</view>
<image
class="user-avatar"
:src="headSculptureUrl"
:src="$getHeadImgUrl(vuex_user.HeadSculptureUrl)"
mode="scaleToFill"
/>
</view>
@ -375,7 +375,7 @@
<view class="message-content-container-Teacher">
<image
class="ai-avatar"
:src="receiverHeadSculptureUrl"
:src="getReceiverHeadSculptureUrl(message)"
mode="scaleToFill"
/>
<view
@ -640,12 +640,6 @@ export default {
},
computed: {
headSculptureUrl() {
return this.$getHeadImgUrl(this.vuex_user.HeadSculptureUrl);
},
receiverHeadSculptureUrl() {
return this.$getHeadImgUrl(this.vuex_msgUser.headSculptureUrl);
},
aiMessageGroups() {
return Array.isArray(this.vuex_aiMessageGroups)
? this.vuex_aiMessageGroups
@ -711,6 +705,11 @@ export default {
},
methods: {
//
getReceiverHeadSculptureUrl(message) {
return this.$getHeadImgUrl(message.headSculptureUrl);
},
async handleLeftClick() {
await this.getChatHistoryList();
await this.GetDialogueList_User();