- 新增 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 报错
73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
<view class="post-card" bindtap="onCardTap">
|
|
<!-- 作者头部 -->
|
|
<view class="post-header">
|
|
<view class="post-avatar" style="background: {{avatarGradient}}" catchtap="onAuthorTap">
|
|
<text>{{post.author && post.author.nickName ? post.author.nickName[0] : '?'}}</text>
|
|
</view>
|
|
<view class="post-meta">
|
|
<text class="post-username">{{post.author && post.author.nickName ? post.author.nickName : '匿名用户'}}</text>
|
|
<view class="post-loc" wx:if="{{post.location}}">
|
|
<text class="loc-icon">📍</text>
|
|
<text class="loc-text">{{post.location.name}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="post-time">{{timeText}}</view>
|
|
</view>
|
|
|
|
<!-- 图片 -->
|
|
<view wx:if="{{post.images && post.images.length > 0}}" class="post-images-wrap">
|
|
<!-- 单图全宽 -->
|
|
<view wx:if="{{post.images && post.images.length === 1}}" class="post-img-single">
|
|
<image
|
|
class="img-single"
|
|
src="{{post.images[0]}}"
|
|
mode="aspectFill"
|
|
lazy-load="true"
|
|
catchtap="onImageTap"
|
|
data-idx="0"
|
|
/>
|
|
<view wx:if="{{post.mood}}" class="post-tag-chip">{{post.mood}}</view>
|
|
</view>
|
|
<!-- 多图网格 -->
|
|
<view wx:else class="post-img-grid {{imageGridClass}}">
|
|
<image
|
|
wx:for="{{post.images}}"
|
|
wx:key="index"
|
|
wx:if="{{index < 9}}"
|
|
class="img-grid-item"
|
|
src="{{item}}"
|
|
mode="aspectFill"
|
|
lazy-load="true"
|
|
catchtap="onImageTap"
|
|
data-idx="{{index}}"
|
|
/>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 正文 -->
|
|
<view class="post-body">
|
|
<text class="post-caption" decode="{{true}}">{{post.content}}</text>
|
|
|
|
<!-- hashtags -->
|
|
<view wx:if="{{post.hashtags && post.hashtags.length > 0}}" class="post-tags">
|
|
<text wx:for="{{post.hashtags}}" wx:key="index" class="hashtag">{{item}}</text>
|
|
</view>
|
|
|
|
<!-- 操作栏 -->
|
|
<view class="post-actions">
|
|
<view class="action-btn {{post.isLiked ? 'liked' : ''}}" catchtap="onLike">
|
|
<text class="action-icon">{{post.isLiked ? '❤️' : '🤍'}}</text>
|
|
<text class="action-count">{{likeCount}}</text>
|
|
</view>
|
|
<view class="action-btn" catchtap="onComment">
|
|
<text class="action-icon">💬</text>
|
|
<text class="action-count">{{post.commentCount || 0}}</text>
|
|
</view>
|
|
<view class="action-btn" catchtap="onShare">
|
|
<text class="action-icon">↗</text>
|
|
<text class="action-count">转发</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|