fix(fe): 保存到相册的方法根本没写进去 + 重构社区版式
## 保存到相册点了没反应 上次改的时候,插入方法的锚点用的是「// 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>
This commit is contained in:
@@ -319,16 +319,27 @@ module.exports.sel = function (map, key, index, def) {
|
||||
|
||||
<!-- 评论 -->
|
||||
<block wx:elif="{{innerType === 'comments'}}">
|
||||
<view class="sheet-h3">评论</view>
|
||||
<view wx:for="{{comments}}" wx:key="id" class="record-row" bindlongpress="onDeleteComment" data-index="{{index}}">
|
||||
<text class="bold">{{item.author_name}}<text wx:if="{{item.is_self}}" class="mine-tag">我</text></text>
|
||||
<text class="muted">{{item.content}}</text>
|
||||
<view class="sheet-h3">评论 {{comments.length ? comments.length : ''}}</view>
|
||||
|
||||
<view wx:for="{{comments}}" wx:key="id" class="cm" bindlongpress="onDeleteComment" data-index="{{index}}">
|
||||
<view class="cm-av">{{item.initial}}</view>
|
||||
<view class="cm-body">
|
||||
<view class="cm-head">
|
||||
<text class="cm-name">{{item.author_name}}</text>
|
||||
<text wx:if="{{item.is_self}}" class="mine-tag">我</text>
|
||||
<text class="cm-time">{{item.timeText}}</text>
|
||||
</view>
|
||||
<view class="cm-text">{{item.content}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{!comments.length}}" class="sheet-p">还没有评论,来抢沙发~</view>
|
||||
<view wx:if="{{comments.length}}" class="sheet-p" style="font-size:22rpx;color:var(--muted)">长按自己的评论可删除</view>
|
||||
<view class="ai-input-row" style="margin-top:24rpx">
|
||||
<input class="input" placeholder="友善交流,分享经验..." placeholder-class="placeholder" value="{{commentText}}" bindinput="onCommentInput"/>
|
||||
<button class="btn btn-primary ai-send" bindtap="onSendComment">发</button>
|
||||
|
||||
<view wx:if="{{!comments.length}}" class="empty">还没有评论,来抢个沙发</view>
|
||||
<view wx:if="{{comments.length}}" class="cm-tip">长按自己的评论可删除</view>
|
||||
|
||||
<view class="cm-input">
|
||||
<input class="input" placeholder="友善交流,分享经验…" placeholder-class="placeholder"
|
||||
value="{{commentText}}" bindinput="onCommentInput" confirm-type="send" bindconfirm="onSendComment"/>
|
||||
<view class="cm-send {{commentText ? 'on' : ''}}" bindtap="onSendComment">发送</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user