c7135424e5
## 保存到相册点了没反应 上次改的时候,插入方法的锚点用的是「// AI 聊天」那段注释,而它在 AI 独立成页时已经被删掉了 —— 替换没匹配上,onSavePoster / drawPoster / saveToAlbum 三个方法一个都没进 js,按钮绑了个不存在的方法。 我的检查器没拦住,是因为「事件绑定是否有实现」那条写在临时的 audit.js 里,日常只跑 check.js。已经把这条并进 check.js —— 加完立刻抓出了本次 新写的 13 处缺样式 class,说明它管用。 ## 社区 帖子操作栏原来是 space-around 排三个宽度不一的项:点赞数从 9 变 10 整行就会跳。改成三等分,图标 32rpx 居中对齐,没有数字时显示「点赞/评论」 而不是一个孤零零的 0,加了按下态。 帖子头部原来副标题固定写死「宠友」两个字,等于没有信息。换成发布时间 (刚刚 / 12 分钟前 / 3 天前)。 评论弹层原来拿 .record-row 当评论用 —— 那是个「左右两端对齐」的行, 昵称在左内容在右,评论一长就被挤扁,完全不是评论该有的样子。重做成 头像 + 昵称/时间 + 内容的正常结构;没有头像字段就用昵称首字做色块, 比一律显示同一个 emoji 强。发送按钮有输入才点亮,支持键盘回车发送。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
61 lines
2.9 KiB
Plaintext
61 lines
2.9 KiB
Plaintext
<wxs module="im">
|
|
module.exports.isUrl = function (s) { return s && s.indexOf('http') === 0; }
|
|
</wxs>
|
|
<nav-bar title="宠友圈"></nav-bar>
|
|
|
|
<scroll-view class="page-scroll" scroll-y="{{true}}" enhanced="{{true}}" show-scrollbar="{{false}}">
|
|
<view class="page-body">
|
|
<seg-tabs items="{{feedTabs}}" current="{{feedIdx}}" bind:change="switchFeedTab"></seg-tabs>
|
|
|
|
<view class="compose-card">
|
|
<button class="btn btn-dark btn-block" bindtap="openSheet" data-type="createPost"><pt-icon name="plus" size="{{30}}"></pt-icon>发布图文</button>
|
|
</view>
|
|
|
|
<view wx:for="{{posts}}" wx:key="id" class="post-card" bindlongpress="onLongPressPost" data-index="{{index}}">
|
|
<view class="post-head">
|
|
<view class="post-avatar">{{item.author_emoji}}</view>
|
|
<view class="post-user">
|
|
<view class="pu-b">{{item.author_name}}<text wx:if="{{item.is_ai}}" class="ai-tag">AI</text></view>
|
|
<view class="pu-s">{{item.timeText}}</view>
|
|
</view>
|
|
<view wx:if="{{!item.is_self && item.user_id}}" class="follow-btn {{item.followed ? 'on' : ''}}"
|
|
catchtap="toggleFollow" data-index="{{index}}">{{item.followed ? '已关注' : '+ 关注'}}</view>
|
|
<view wx:if="{{item.tag}}" class="tag {{item.tagClass}}">{{item.tag}}</view>
|
|
</view>
|
|
<view class="post-content">{{item.content}}</view>
|
|
<view wx:if="{{item.images.length}}" class="photo-grid">
|
|
<block wx:for="{{item.images}}" wx:for-item="img" wx:key="*this">
|
|
<image wx:if="{{im.isUrl(img)}}" class="photo-tile" src="{{img}}" mode="aspectFill"></image>
|
|
<view wx:else class="photo-tile">{{img}}</view>
|
|
</block>
|
|
</view>
|
|
<view class="post-actions">
|
|
<view class="pa-btn {{item.liked ? 'liked' : ''}}" data-index="{{index}}" bindtap="likePost">
|
|
<pt-icon name="{{item.liked ? 'like-on' : 'like'}}" size="{{32}}"></pt-icon>
|
|
<text class="pa-n">{{item.like_count || '点赞'}}</text>
|
|
</view>
|
|
<view class="pa-btn" data-id="{{item.id}}" bindtap="openComments">
|
|
<pt-icon name="comment" size="{{32}}"></pt-icon>
|
|
<text class="pa-n">{{item.comment_count || '评论'}}</text>
|
|
</view>
|
|
<button class="pa-btn pa-share" open-type="share" data-content="{{item.content}}">
|
|
<pt-icon name="share" size="{{32}}"></pt-icon>
|
|
<text class="pa-n">分享</text>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{loadErr}}" class="empty lg">
|
|
{{loadErr}}
|
|
<view class="retry-btn" bindtap="loadPosts">点击重试</view>
|
|
</view>
|
|
<view wx:elif="{{loaded && posts.length === 0}}" class="empty lg">
|
|
{{feedTabs[feedIdx] === '关注' ? '还没有关注的人,去「推荐」里关注几个宠友吧 🐾' : '还没有帖子,来发第一条吧 🐾'}}
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
|
|
<fab bind:tap="onFab"></fab>
|
|
<bottom-sheet show="{{sheetShow}}" type="{{sheetType}}" post-id="{{sheetPostId}}"
|
|
bind:close="closeSheet" bind:posted="onPosted" bind:commented="onCommented"></bottom-sheet>
|