chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* ConversationItem 会话列表项(规范 §35)
|
||||
*
|
||||
* 不变量(AGENTS.md):
|
||||
* - 第 3 条:仅 Mutual Match 后才能聊天——canSendMessage=false 时显示"已停用"角标,
|
||||
* 点击进入后聊天页禁止输入。
|
||||
* - 第 4 条:Block 后会话立即停用,relationStatus=blocked 时灰显。
|
||||
*/
|
||||
Component({
|
||||
options: { addGlobalClass: true },
|
||||
properties: {
|
||||
conversation: { type: Object, value: null },
|
||||
showAvatar: { type: Boolean, value: true },
|
||||
},
|
||||
methods: {
|
||||
onTap() {
|
||||
if (!this.data.conversation) return;
|
||||
this.triggerEvent('tap', {
|
||||
conversationId: this.data.conversation.conversationId,
|
||||
targetUserId: this.data.conversation.targetUserId,
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"ui-avatar": "../avatar/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<view
|
||||
class="ui-conv {{!conversation.canSendMessage ? 'ui-conv--disabled' : ''}}"
|
||||
bindtap="onTap"
|
||||
>
|
||||
<ui-avatar
|
||||
wx:if="{{showAvatar}}"
|
||||
src="{{conversation.targetAvatarUrl}}"
|
||||
size="lg"
|
||||
default-text="{{conversation.targetDisplayName}}"
|
||||
/>
|
||||
<view class="ui-conv__body">
|
||||
<view class="ui-conv__top">
|
||||
<text class="ui-conv__name">{{conversation.targetDisplayName}}</text>
|
||||
<text class="ui-conv__time">{{conversation.lastMessageAtText || ''}}</text>
|
||||
</view>
|
||||
<view class="ui-conv__bottom">
|
||||
<text class="ui-conv__last">{{conversation.lastMessage || '开始你们的对话吧'}}</text>
|
||||
<view wx:if="{{conversation.unreadCount > 0}}" class="ui-conv__badge">
|
||||
{{conversation.unreadCount > 99 ? '99+' : conversation.unreadCount}}
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{!conversation.canSendMessage}}" class="ui-conv__status-hint">
|
||||
{{conversation.relationStatus === 'blocked' ? '会话已停用(已拉黑)' : '会话已停用'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,66 @@
|
||||
.ui-conv {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background: var(--color-bg-card);
|
||||
padding: var(--spacing-3) var(--spacing-page-x);
|
||||
border-bottom: 1rpx solid var(--color-divider);
|
||||
}
|
||||
.ui-conv--disabled {
|
||||
opacity: 0.6;
|
||||
}
|
||||
.ui-conv__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-left: var(--spacing-3);
|
||||
}
|
||||
.ui-conv__top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
}
|
||||
.ui-conv__name {
|
||||
font-size: var(--font-size-lg);
|
||||
font-weight: var(--font-weight-medium);
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
.ui-conv__time {
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--color-text-tertiary);
|
||||
flex-shrink: 0;
|
||||
margin-left: var(--spacing-2);
|
||||
}
|
||||
.ui-conv__bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: var(--spacing-1);
|
||||
}
|
||||
.ui-conv__last {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: var(--font-size-sm);
|
||||
color: var(--color-text-tertiary);
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: var(--spacing-2);
|
||||
}
|
||||
.ui-conv__badge {
|
||||
min-width: 36rpx;
|
||||
height: 36rpx;
|
||||
padding: 0 10rpx;
|
||||
border-radius: var(--radius-full);
|
||||
background: var(--color-danger);
|
||||
color: #FFFFFF;
|
||||
font-size: var(--font-size-xs);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.ui-conv__status-hint {
|
||||
margin-top: var(--spacing-1);
|
||||
font-size: var(--font-size-xs);
|
||||
color: var(--color-text-tertiary);
|
||||
}
|
||||
Reference in New Issue
Block a user