feat: rebuild pet app and backend around core care flows

This commit is contained in:
2026-10-01 13:11:30 +08:00
parent 51ead8f411
commit bfcf8788a4
321 changed files with 4918 additions and 25199 deletions
+134
View File
@@ -0,0 +1,134 @@
<view class="screen">
<view class="eyebrow">LITTLE THINGS, BIG LOVE</view>
<view class="title">今日小任务 ☑</view>
<view class="summary">
<view>今天也要照顾好它们</view>
<strong>
{{done}}
<text>/ {{tasks.length}}</text>
</strong>
<view class="progress">
<view style="width:{{tasks.length?done/tasks.length*100:0}}%"></view>
</view>
</view>
<view class="row">
<text class="section-title">{{date}} 的日常</text>
<text class="add" bindtap="open">+ 添加任务</text>
</view>
<view class="card list">
<view wx:for="{{tasks}}" wx:key="id" class="task">
<view
class="check {{item.completed?'done':''}}"
data-index="{{index}}"
bindtap="toggle"
>
{{item.completed?'✓':''}}
</view>
<view class="icon">
{{item.category==='water'?'💧':item.category==='food'?'🥣':'🐾'}}
</view>
<view class="info" data-index="{{index}}" bindtap="toggle">
<strong>{{item.title}}</strong>
<text>
{{item.petName}} · {{item.time_of_day}} ·
{{item.repeat_rule==='daily'?'每天':item.repeat_rule==='weekdays'?'工作日':'周末'}}
</text>
</view>
<text class="remove" data-index="{{index}}" bindtap="remove">×</text>
</view>
<view wx:if="{{!tasks.length}}" class="empty">
从喝水、喂食开始,安排温柔的小日常 ✨
</view>
</view>
<button class="primary" bindtap="open">+ 新建日常任务</button>
</view>
<view wx:if="{{showForm}}" class="overlay">
<view class="sheet">
<view class="row">
<strong>新建小任务</strong>
<text bindtap="close">×</text>
</view>
<view class="field">
<view class="field-label">任务名称</view>
<input
placeholder="比如:更换饮水"
value="{{title}}"
data-key="title"
bindinput="field"
/>
</view>
<view class="field">
<view class="field-label">照顾谁</view>
<picker
range="{{pets}}"
range-key="name"
value="{{petIndex}}"
bindchange="petChange"
>
<view class="picker">{{pets[petIndex].name||'请先添加宠物'}}</view>
</picker>
</view>
<view class="field">
<view class="field-label">类型</view>
<radio-group bindchange="categoryChange">
<label>
<radio value="food" checked="{{category==='food'}}" color="#194f42" />
喂食
</label>
<label>
<radio
value="water"
checked="{{category==='water'}}"
color="#194f42"
/>
喝水
</label>
<label>
<radio
value="other"
checked="{{category==='other'}}"
color="#194f42"
/>
其他
</label>
</radio-group>
</view>
<view class="field">
<view class="field-label">时间</view>
<picker mode="time" value="{{time_of_day}}" bindchange="timeChange">
<view class="picker">{{time_of_day}}</view>
</picker>
</view>
<view class="field">
<view class="field-label">重复</view>
<radio-group bindchange="repeatChange">
<label>
<radio
value="daily"
checked="{{repeat_rule==='daily'}}"
color="#194f42"
/>
每天
</label>
<label>
<radio
value="weekdays"
checked="{{repeat_rule==='weekdays'}}"
color="#194f42"
/>
工作日
</label>
<label>
<radio
value="weekends"
checked="{{repeat_rule==='weekends'}}"
color="#194f42"
/>
周末
</label>
</radio-group>
</view>
<button class="primary" bindtap="save">保存任务</button>
</view>
</view>
<tab-bar current="/pages/tasks/tasks" />