feat: 每日任务顺延与增删改 + 计划到期续期 + 靠谱养护模板 + 图片URL修复

后端
- 每日任务惰性生成:某天为空则从最近一天顺延复制(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>
This commit is contained in:
Blizzard
2026-07-06 10:06:13 +08:00
parent 2f5dd6eefc
commit 28b95a6468
21 changed files with 478 additions and 81 deletions
+2 -4
View File
@@ -15,10 +15,8 @@ module.exports.isUrl = function (s) { return s && s.indexOf('http') === 0; }
class="feed-tab {{feedIdx === index ? 'active' : ''}}" data-index="{{index}}" bindtap="switchFeedTab">{{item}}</view>
</scroll-view>
<view class="compose-card" data-type="createPost" bindtap="openSheet">
<view class="post-avatar">{{pet.emoji}}</view>
<view class="compose-input">分享一下今天和 {{pet.name}} 的日常...</view>
<button class="btn btn-primary btn-small" catchtap="openSheet" data-type="createPost">发布</button>
<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">
+1 -9
View File
@@ -10,15 +10,7 @@
}
.feed-tab.active{color:var(--primary-dark);background:#FFF4E4;border-color:#FFD39A}
.compose-card{
display:flex;gap:20rpx;align-items:center;background:#fff;border-radius:44rpx;
box-shadow:var(--shadow);padding:24rpx;margin-bottom:28rpx;
}
.compose-input{
flex:1;height:76rpx;line-height:76rpx;border-radius:999rpx;background:#FBFAF8;
border:1rpx solid var(--line);color:var(--muted);padding:0 26rpx;font-size:26rpx;
overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
.compose-card{margin-bottom:28rpx}
.post-card{background:#fff;border-radius:48rpx;box-shadow:var(--shadow);padding:30rpx;margin-bottom:28rpx}
.post-head{display:flex;align-items:center;gap:20rpx;margin-bottom:22rpx}
+4 -1
View File
@@ -133,7 +133,10 @@ Page({
this.setData({ sheetShow: false });
this.loadAll();
},
onSheetSave() {},
onSheetSave() {
this.loadTasks();
this.loadSummary();
},
onAddPet() {
this.openSheetType('addPet');
},
+5 -2
View File
@@ -42,8 +42,11 @@
<view class="card">
<view class="section-head">
<view class="sh-title">{{taskLabel}}</view>
<view wx:if="{{selectedDate && selectedDate !== todayDate}}" class="link" bindtap="backToToday">回今天</view>
<view wx:else class="link" bindtap="completeTasks">全部完成</view>
<view class="head-links">
<view class="link" data-type="manageTasks" bindtap="openSheet">管理</view>
<view wx:if="{{selectedDate && selectedDate !== todayDate}}" class="link" bindtap="backToToday">回今天</view>
<view wx:else class="link" bindtap="completeTasks">全部完成</view>
</view>
</view>
<view class="task-list">
<view wx:for="{{tasks}}" wx:key="title" class="task {{item.done ? 'done' : ''}}" data-index="{{index}}" bindtap="onTapTask">
+5
View File
@@ -19,6 +19,7 @@ function mapRecord(r) {
icon: r.icon || '✍️',
title: r.title,
desc: fmtTime(r.occurred_at) + (r.description ? '' + r.description : ''),
image: r.image_url || '',
};
}
@@ -151,6 +152,10 @@ Page({
const i = e.currentTarget.dataset.index;
this.setData({ selDot: this.data.trendDots[i], selIdx: i });
},
previewImage(e) {
const src = e.currentTarget.dataset.src;
if (src) wx.previewImage({ urls: [src], current: src });
},
openSheet(e) {
this.openSheetType(e.currentTarget.dataset.type);
},
+4 -1
View File
@@ -53,7 +53,10 @@
<view class="health-timeline">
<view wx:for="{{timeline}}" wx:key="index" class="health-event">
<view class="event-dot">{{item.icon}}</view>
<view><text class="he-b">{{item.title}}</text><view class="he-p">{{item.desc}}</view></view>
<view class="he-body">
<text class="he-b">{{item.title}}</text><view class="he-p">{{item.desc}}</view>
<image wx:if="{{item.image}}" class="he-img" src="{{item.image}}" mode="aspectFill" bindtap="previewImage" data-src="{{item.image}}"></image>
</view>
</view>
<view wx:if="{{timeline.length === 0}}" class="tl-empty">还没有记录,用上面的按钮记一条吧</view>
</view>
+2
View File
@@ -44,6 +44,8 @@
}
.he-b{font-size:28rpx;font-weight:700}
.he-p{color:var(--muted);font-size:24rpx;line-height:1.45;margin-top:6rpx}
.he-body{flex:1;min-width:0}
.he-img{margin-top:14rpx;width:220rpx;height:220rpx;border-radius:20rpx}
/* 页面不自身滚动,改由 page-scroll 承载滚动(隐藏滚动条)*/
page{height:100vh;overflow:hidden;display:flex;flex-direction:column}