Files
PetCommunity/miniprogram/pages/pet-detail/pet-detail.wxml
2026-06-05 17:46:51 +08:00

66 lines
2.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<view class="detail-page">
<view class="safe-top" style="height: {{statusBarHeight}}px"></view>
<!-- 顶部导航 -->
<view class="detail-nav">
<view class="nav-back" bindtap="onBack"></view>
<view class="nav-title">{{user.nickName || '宠物主页'}}</view>
<view class="nav-more" bindtap="onMore">⋯</view>
</view>
<scroll-view scroll-y="true" class="detail-scroll" enhanced="true" show-scrollbar="false">
<!-- 用户卡片 -->
<view class="user-card">
<view class="card-top">
<view class="card-avatar" style="background: {{avatarGradient}}">
<text>{{user.nickName ? user.nickName[0] : '?'}}</text>
</view>
<view class="card-meta">
<text class="card-name">{{user.nickName}}</text>
<text class="card-location">📍 {{user.location || '未知位置'}}</text>
<text class="card-bio">{{user.bio || '还没有介绍~'}}</text>
</view>
</view>
<!-- 宠物列表 -->
<view wx:if="{{user.pets && user.pets.length > 0}}" class="pets-row">
<view
wx:for="{{user.pets}}"
wx:key="_id"
class="pet-chip"
>
<text class="chip-emoji">{{item.emoji}}</text>
<view class="chip-info">
<text class="chip-name">{{item.name}}</text>
<text class="chip-breed">{{item.breed}} · {{item.age}}</text>
</view>
</view>
</view>
<!-- 操作按钮 -->
<view wx:if="{{!isMe}}" class="action-row">
<view
class="follow-action {{isFollowing ? 'following' : ''}}"
bindtap="onFollow"
>
{{isFollowing ? '✓ 已关注' : '+ 关注'}}
</view>
<view class="msg-action" bindtap="onMessage">💬 发消息</view>
</view>
</view>
<!-- 帖子 -->
<view class="posts-section">
<view class="section-hd">
<text class="section-title">TA 的动态</text>
</view>
<post-card wx:for="{{posts}}" wx:key="_id" post="{{item}}" />
<view wx:if="{{!loading && posts.length === 0}}" class="empty-posts">
<text>还没有发布过动态</text>
</view>
</view>
<view style="height: 60rpx;"></view>
</scroll-view>
</view>