Files
PetCommunity/miniprogram/pages/friends/friends.wxml
chenwu 3d21a9d297 fix: 修复评论/资料/导航胶囊/宠物档案/定位等多处问题,补全相关云函数
- 新增 addComment/getComments/getFollowList/followUser/getUser/updateProfile/updatePet/deletePet 云函数并完成部署
- 统一通过 app.globalData.navBarInfo 避让系统胶囊按钮(编辑资料/编辑宠物等页面保存按钮被遮挡问题)
- 编辑资料页所在城市改为省份 picker 选择
- 修复"我的"页动态为空(getUserPosts 应传 openid 而非数据库 _id)
- 重构编辑宠物页:品种改用 picker 滚轮(替代有数量上限的 actionSheet),标签改用 selectedTagSet 映射 + 自定义标签输入(5字以内、仅中英文/数字、最多8个)
- 接通宠物保存/删除真实云函数调用并同步本地缓存
- 移除 feed 页对不存在的 getStories 云函数调用,修复模拟器卡死
- 移除 post 页对不存在的 wx.reverseGeocoder API 的调用
- 统一扩展 AppGlobalData 类型并修正所有 getApp 调用的泛型,解决 TS 报错
2026-06-07 15:59:21 +08:00

73 lines
2.6 KiB
Plaintext

<view class="friends-page">
<!-- 状态栏占位 -->
<view style="height: {{statusBarHeight}}px; flex-shrink: 0;"></view>
<!-- 主导航栏:与胶囊等高,右侧避让胶囊 -->
<view class="navbar" style="height: {{navbarHeight}}px; padding-right: {{navbarPaddingRight}}px;">
<view class="topbar-logo">汪<text class="logo-accent">友</text></view>
</view>
<!-- 次级菜单栏:位于胶囊下方,全宽可用 -->
<view class="subbar">
<view class="topbar-tabs">
<view class="ftab {{activeTab === 'following' ? 'ftab-active' : ''}}" bindtap="switchTab" data-tab="following">
关注 <text class="ftab-count">{{followingCount}}</text>
</view>
<view class="ftab {{activeTab === 'followers' ? 'ftab-active' : ''}}" bindtap="switchTab" data-tab="followers">
粉丝 <text class="ftab-count">{{followersCount}}</text>
</view>
</view>
<view class="topbar-btn" bindtap="onFindFriends">+</view>
</view>
<!-- 空态 -->
<view wx:if="{{!loading && list.length === 0}}" class="empty-wrap">
<view class="empty-inner">
<text class="empty-emoji">🐾</text>
<text class="empty-title">还没有{{activeTab === 'following' ? '关注' : '粉丝'}}</text>
<text class="empty-desc">去附近认识新朋友,一起遛狗打卡吧</text>
<view class="btn-primary go-btn" bindtap="onGoNearby">去附近找</view>
</view>
</view>
<!-- 列表 -->
<scroll-view
wx:else
scroll-y="true"
class="friends-scroll"
enhanced="true"
show-scrollbar="false"
refresher-enabled="true"
bindrefresherrefresh="onRefresh"
refresher-triggered="{{refreshing}}"
>
<view
wx:for="{{list}}"
wx:key="_id"
class="friend-item"
bindtap="onItemTap"
data-uid="{{item._id}}"
>
<view class="friend-avatar" style="background: {{item.gradient}}">
<text>{{item.nickName[0]}}</text>
</view>
<view class="friend-info">
<view class="friend-name-row">
<text class="friend-name">{{item.nickName}}</text>
<view wx:if="{{item.isOnline}}" class="online-tag">在线</view>
</view>
<text class="friend-bio">{{item.pets[0] ? item.pets[0].emoji + ' ' + item.pets[0].name + ' · ' + item.pets[0].breed : item.bio || '宠物爱好者'}}</text>
</view>
<view
class="follow-btn {{activeTab === 'following' ? 'following' : ''}}"
catchtap="onFollowTap"
data-uid="{{item._id}}"
>
{{activeTab === 'following' ? '已关注' : '关注'}}
</view>
</view>
<view style="height: {{tabBarHeight}}px"></view>
</scroll-view>
</view>