150 lines
4.5 KiB
Plaintext
150 lines
4.5 KiB
Plaintext
<!-- 用户资料详情页 U21 -->
|
|
<view class="profile-page">
|
|
<ui-nav-bar
|
|
title="用户资料"
|
|
status-bar-height="{{statusBarHeight}}"
|
|
nav-bar-height="{{navBarHeight}}"
|
|
bind:back="onBack"
|
|
/>
|
|
|
|
<!-- 首次加载 -->
|
|
<view wx:if="{{loading}}" class="profile-loading">
|
|
<ui-loading mode="spinner" text="正在加载资料…" />
|
|
</view>
|
|
|
|
<!-- 加载失败 -->
|
|
<view wx:elif="{{loadError}}" class="profile-empty">
|
|
<ui-empty
|
|
title="加载失败"
|
|
description="{{loadError}}"
|
|
illustration="default"
|
|
actions="{{[{text:'重试', event:'retry', variant:'primary'}]}}"
|
|
bind:action="onRetry"
|
|
/>
|
|
</view>
|
|
|
|
<!-- 用户不存在 -->
|
|
<view wx:elif="{{!profile}}" class="profile-empty">
|
|
<ui-empty
|
|
title="用户不存在"
|
|
description="该用户可能已注销或不可见"
|
|
illustration="default"
|
|
/>
|
|
</view>
|
|
|
|
<!-- 资料主体 -->
|
|
<view wx:else class="profile-body">
|
|
<!-- 顶部信息 -->
|
|
<view class="profile-header">
|
|
<ui-avatar
|
|
src="{{profile.avatarUrl}}"
|
|
size="xl"
|
|
verified="{{profile.verified || profile.isRealNameVerified}}"
|
|
reviewed="{{profile.reviewed || profile.profileReviewStatus === 'approved'}}"
|
|
default-text="{{displayName}}"
|
|
/>
|
|
<view class="profile-header__info">
|
|
<view class="profile-header__name-row">
|
|
<text class="profile-header__name">{{displayName}}</text>
|
|
<text wx:if="{{ageText}}" class="profile-header__age">{{ageText}}</text>
|
|
</view>
|
|
<view wx:if="{{metaLine}}" class="profile-header__meta">{{metaLine}}</view>
|
|
<view wx:if="{{badges.length}}" class="profile-header__badges">
|
|
<ui-status-badge
|
|
wx:for="{{badges}}"
|
|
wx:key="label"
|
|
kind="{{item.kind}}"
|
|
label="{{item.label}}"
|
|
/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 关于我 -->
|
|
<view wx:if="{{basicInfo.length}}" class="profile-section">
|
|
<ui-section-header title="关于我" />
|
|
<view class="profile-info-grid">
|
|
<view
|
|
wx:for="{{basicInfo}}"
|
|
wx:key="label"
|
|
class="profile-info-item {{item.full ? 'profile-info-item--full' : ''}}"
|
|
>
|
|
<text class="profile-info-item__label">{{item.label}}</text>
|
|
<text class="profile-info-item__value">{{item.value}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 自我介绍 -->
|
|
<view wx:if="{{profile.selfIntro}}" class="profile-section">
|
|
<ui-section-header title="自我介绍" />
|
|
<text class="profile-intro-text">{{profile.selfIntro}}</text>
|
|
</view>
|
|
|
|
<!-- 婚恋态度 -->
|
|
<view wx:if="{{attitudeInfo.length}}" class="profile-section">
|
|
<ui-section-header title="婚恋态度" />
|
|
<view class="profile-info-grid">
|
|
<view
|
|
wx:for="{{attitudeInfo}}"
|
|
wx:key="label"
|
|
class="profile-info-item profile-info-item--full"
|
|
>
|
|
<text class="profile-info-item__label">{{item.label}}</text>
|
|
<text class="profile-info-item__value">{{item.value}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 底部操作(仅 profile 加载成功时展示) -->
|
|
<view wx:if="{{profile && !loadError}}" class="profile-actions">
|
|
<ui-button
|
|
variant="ghost"
|
|
size="md"
|
|
custom-class="profile-actions__btn profile-actions__btn--block"
|
|
bind:tap="onBlock"
|
|
disabled="{{actionLoading}}"
|
|
>拉黑</ui-button>
|
|
<ui-button
|
|
variant="ghost"
|
|
size="md"
|
|
custom-class="profile-actions__btn profile-actions__btn--report"
|
|
bind:tap="onReport"
|
|
disabled="{{actionLoading}}"
|
|
>举报</ui-button>
|
|
<ui-button
|
|
wx:if="{{canChat}}"
|
|
variant="secondary"
|
|
size="md"
|
|
custom-class="profile-actions__btn"
|
|
bind:tap="onGoChat"
|
|
disabled="{{actionLoading}}"
|
|
>开始聊天</ui-button>
|
|
<ui-button
|
|
wx:if="{{!isLiked}}"
|
|
variant="primary"
|
|
size="md"
|
|
custom-class="profile-actions__btn profile-actions__btn--like"
|
|
loading="{{actionLoading}}"
|
|
bind:tap="onLike"
|
|
>喜欢</ui-button>
|
|
<ui-button
|
|
wx:else
|
|
variant="primary"
|
|
size="md"
|
|
custom-class="profile-actions__btn"
|
|
disabled
|
|
>已喜欢</ui-button>
|
|
</view>
|
|
|
|
<!-- 拉黑确认弹窗 -->
|
|
<ui-danger-action-dialog
|
|
visible="{{showBlockDialog}}"
|
|
action="{{blockAction}}"
|
|
target-name="{{displayName}}"
|
|
bind:confirm="onConfirmBlock"
|
|
bind:cancel="onCancelBlock"
|
|
/>
|
|
</view>
|