|
@@ -89,7 +89,8 @@
|
|
|
<image
|
|
<image
|
|
|
class="avatar"
|
|
class="avatar"
|
|
|
:src="msg.fromUserId === userId ? userAvatar : targetUserAvatar"
|
|
:src="msg.fromUserId === userId ? userAvatar : targetUserAvatar"
|
|
|
- mode="aspectFill" />
|
|
|
|
|
|
|
+ mode="aspectFill"
|
|
|
|
|
+ @click="goToUserDetail(msg.fromUserId)" />
|
|
|
|
|
|
|
|
<!-- 消息内容 -->
|
|
<!-- 消息内容 -->
|
|
|
<view class="message-content-wrapper">
|
|
<view class="message-content-wrapper">
|
|
@@ -1558,6 +1559,45 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 跳转到用户详情页面
|
|
|
|
|
+ */
|
|
|
|
|
+ goToUserDetail(userId) {
|
|
|
|
|
+ // 检查是否为红娘ID(以m_开头)
|
|
|
|
|
+ if (typeof userId === 'string' && userId.startsWith('m_')) {
|
|
|
|
|
+ console.log('点击的是红娘头像,不跳转');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 将字符串类型的userId转换为数字
|
|
|
|
|
+ let numericUserId = userId;
|
|
|
|
|
+ if (typeof userId === 'string') {
|
|
|
|
|
+ numericUserId = parseInt(userId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 验证userId是否有效
|
|
|
|
|
+ if (!numericUserId || isNaN(numericUserId)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '用户信息无效',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ console.log('跳转到用户详情页面,userId:', numericUserId);
|
|
|
|
|
+
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages/recommend/user-detail?userId=${numericUserId}`,
|
|
|
|
|
+ fail: (err) => {
|
|
|
|
|
+ console.error('跳转用户详情页失败:', err);
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: '跳转失败',
|
|
|
|
|
+ icon: 'none'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 显示消息操作菜单
|
|
* 显示消息操作菜单
|
|
|
*/
|
|
*/
|