28b95a6468
后端 - 每日任务惰性生成:某天为空则从最近一天顺延复制(done 重置),首天用模板 - 任务增删改 API(POST /pets/:id/tasks、PUT/DELETE /tasks/:id),改动自动顺延 - 30 天计划到期自动归档并按当前阶段生成新一轮 - 内置养护模板重写为兽医常识向:狗每阶段含遛狗/牵引/狂犬,猫含猫砂/梳毛/饮水 - 文件 URL 改为按 object_name + 当前配置动态拼接,换 IP/域名不再有旧地址 小程序 - 首页今日任务加「管理」入口:增删改任务弹层 - 记录时间轴显示照片缩略图(可全屏预览)+ 拍照成功提示 - 社区发布条精简为单个「发布图文」按钮,去掉头像/输入框误触 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
2.4 KiB
Plaintext
49 lines
2.4 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">
|
||
<view class="page-title">
|
||
<view class="pt-h2">宠友圈</view>
|
||
<view class="pt-p">和宠友交流、晒宠、求助与经验分享。</view>
|
||
</view>
|
||
|
||
<scroll-view class="feed-tabs" scroll-x="true" enhanced="{{true}}" show-scrollbar="{{false}}">
|
||
<view wx:for="{{feedTabs}}" wx:key="*this"
|
||
class="feed-tab {{feedIdx === index ? 'active' : ''}}" data-index="{{index}}" bindtap="switchFeedTab">{{item}}</view>
|
||
</scroll-view>
|
||
|
||
<view class="compose-card">
|
||
<button class="btn btn-primary btn-block" bindtap="openSheet" data-type="createPost">+ 发布图文</button>
|
||
</view>
|
||
|
||
<view wx:for="{{posts}}" wx:key="id" class="post-card">
|
||
<view class="post-head">
|
||
<view class="post-avatar">{{item.author_emoji}}</view>
|
||
<view class="post-user"><text class="pu-b">{{item.author_name}}<text wx:if="{{item.is_ai}}" class="ai-tag">AI</text></text><text class="pu-s">宠友</text></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">{{item.liked ? '♥' : '♡'}} {{item.like_count}}</view>
|
||
<view class="pa-btn" data-id="{{item.id}}" bindtap="openComments">💬 {{item.comment_count}}</view>
|
||
<view class="pa-btn" data-type="sharePost" bindtap="openSheet">↗ 分享</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view wx:if="{{posts.length === 0}}" class="empty-hint">还没有帖子,来发第一条吧 🐾</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>
|