init: 毛孩子计划 小程序 + Go 后端 + 内嵌后台

- pets-fe: 微信原生小程序(首页/计划/记录/报告/社区/引导),
  服务端驱动、无假数据;弹层改用 scroll-view,打开时隐藏自定义 tabBar
- pets-be: Gin + GORM(MySQL, sundynix_ 前缀) + MinIO,统一响应/分页,
  微信 code2session 登录,provider-neutral AI(DeepSeek),go:embed React 后台
- 修复:分段选择类型不匹配(字符串 vs 数字)导致选不中

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-03 15:33:31 +08:00
commit 609f7d06cf
180 changed files with 15259 additions and 0 deletions
+252
View File
@@ -0,0 +1,252 @@
/* ===== 全局设计令牌 + 通用样式(由 preview.html 迁移,px→rpx ×2 ===== */
page{
--bg:#F8F6F2;
--bg2:#FBF8F3;
--card:#FFFFFF;
--text:#2D2925;
--muted:#8D8277;
--muted2:#B5A99D;
--line:#EEE6DC;
--primary:#F5A947;
--primary2:#FFBF68;
--primary-dark:#DD8420;
--green:#73BE9D;
--green-soft:#EAF7F1;
--red:#EE7D73;
--red-soft:#FFF0EE;
--blue:#78A6E8;
--blue-soft:#EEF5FF;
--purple:#A993E8;
--purple-soft:#F4F0FF;
--yellow-soft:#FFF6E4;
--shadow:0 24rpx 60rpx rgba(70,48,25,.08);
--shadow2:0 36rpx 88rpx rgba(70,48,25,.13);
--radius:44rpx;
color:var(--text);
font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
background:
radial-gradient(circle at 10% 8%, rgba(245,169,71,.26), transparent 30%),
radial-gradient(circle at 88% 10%, rgba(115,190,157,.20), transparent 26%),
radial-gradient(circle at 72% 88%, rgba(120,166,232,.14), transparent 28%),
linear-gradient(135deg,#FBF5EA,#EEF6F1 55%,#F8F1E7);
min-height:100vh;
}
view,text{box-sizing:border-box}
/* 全局隐藏滚动条(页面级 + 组件级),保留正常滚动 */
::-webkit-scrollbar{
width:0 !important;
height:0 !important;
display:none;
-webkit-appearance:none;
background:transparent;
color:transparent;
}
page{scrollbar-width:none;-ms-overflow-style:none}
/* 文本 */
.muted{color:var(--muted)}
.tiny{font-size:24rpx;color:var(--muted)}
/* 区块标题 */
.section-head{
display:flex;align-items:center;justify-content:space-between;margin:8rpx 0 24rpx;
}
.section-head .sh-title{font-size:36rpx;letter-spacing:-.4rpx;font-weight:700}
.link{
color:var(--primary-dark);font-weight:900;font-size:26rpx;
}
/* 页面标题 */
.page-title{margin:4rpx 0 28rpx}
.page-title h2{font-size:46rpx;letter-spacing:-.6rpx;font-weight:800}
.page-title p{color:var(--muted);font-size:26rpx;margin-top:10rpx}
/* 按钮 */
.btn{
border:0;height:96rpx;border-radius:34rpx;padding:0 32rpx;
display:inline-flex;align-items:center;justify-content:center;gap:16rpx;
font-weight:900;font-size:30rpx;line-height:96rpx;transition:.16s ease;
}
.btn::after{border:none}
.btn:active{transform:scale(.98)}
.btn-primary{
color:#fff;background:linear-gradient(135deg,var(--primary),var(--primary2));
box-shadow:0 24rpx 48rpx rgba(245,169,71,.28);
}
.btn-ghost{color:var(--text);background:#fff;border:1rpx solid var(--line)}
.btn-soft{color:#9E6200;background:var(--yellow-soft)}
.btn-green{color:#fff;background:linear-gradient(135deg,#69B991,#86CEB0)}
.btn-block{width:100%;display:flex}
.btn-small{height:68rpx;border-radius:24rpx;padding:0 22rpx;font-size:24rpx;line-height:68rpx}
/* 卡片 */
.card{
background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);
padding:32rpx;margin-bottom:28rpx;position:relative;overflow:hidden;
}
.card.no-shadow{box-shadow:none;border:1rpx solid var(--line)}
/* 标签 */
.tag{
display:inline-flex;align-items:center;height:48rpx;border-radius:999rpx;padding:0 18rpx;
font-size:24rpx;font-weight:900;background:var(--green-soft);color:#377A61;white-space:nowrap;
}
.tag.warn{background:#FFF0D7;color:#A96500}
.tag.red{background:var(--red-soft);color:#C95348}
.tag.blue{background:var(--blue-soft);color:#3C6EBA}
.tag.purple{background:var(--purple-soft);color:#765AC5}
/* 表单 */
.field{margin-bottom:28rpx}
.field:last-child{margin-bottom:0}
.field label{display:block;font-size:26rpx;color:var(--muted);font-weight:800;margin-bottom:16rpx}
.input,input,textarea,.picker-box{
width:100%;border:1rpx solid var(--line);background:#FBFAF8;height:88rpx;border-radius:30rpx;
padding:0 26rpx;color:var(--text);font-size:30rpx;outline:none;box-sizing:border-box;
display:flex;align-items:center;
}
.textarea{
width:100%;border:1rpx solid var(--line);background:#FBFAF8;height:184rpx;border-radius:30rpx;
padding:24rpx 26rpx;color:var(--text);font-size:30rpx;box-sizing:border-box;
}
.placeholder{color:var(--muted2)}
/* 分段选择 */
.seg{display:flex;gap:16rpx}
.seg .seg-btn{
flex:1;height:80rpx;line-height:80rpx;text-align:center;border-radius:26rpx;
border:1rpx solid var(--line);background:#fff;color:var(--muted);font-weight:800;font-size:28rpx;
}
.seg .seg-btn.selected{color:var(--primary-dark);background:#FFF2DC;border-color:#FFD39A}
/* 多选 check */
.check-list{display:flex;flex-direction:column;gap:20rpx;margin:32rpx 0}
.check{
display:flex;align-items:center;gap:20rpx;background:#fff;box-shadow:var(--shadow);
border-radius:32rpx;padding:26rpx;border:1rpx solid transparent;font-size:28rpx;font-weight:700;
}
.box{
width:44rpx;height:44rpx;border-radius:16rpx;border:4rpx solid #DDCEC1;
display:flex;align-items:center;justify-content:center;color:#fff;flex:none;
font-size:26rpx;font-weight:900;
}
.check.selected{background:#FFF8EC;border-color:#FFD29A}
.check.selected .box{background:var(--primary);border-color:var(--primary)}
/* 圆形/条形选项 */
.mini-options{display:flex;flex-wrap:wrap;gap:16rpx;margin:20rpx 0 28rpx}
.option{
border:1rpx solid var(--line);background:#fff;border-radius:999rpx;height:68rpx;line-height:68rpx;
padding:0 24rpx;color:#5F554D;font-weight:800;font-size:24rpx;
}
.option.selected{background:#FFF2DC;color:var(--primary-dark);border-color:#FFD39A}
/* 进度条 */
.progress-row{
display:flex;align-items:center;justify-content:space-between;margin-bottom:16rpx;
font-size:26rpx;color:#6A5D52;font-weight:900;
}
.bar{height:20rpx;border-radius:999rpx;background:#F0E7DD;overflow:hidden}
.bar .bar-fill{
height:100%;border-radius:999rpx;
background:linear-gradient(90deg,var(--primary),#FFD57F);display:block;transition:.25s ease;
}
/* 头像 */
.avatar{
width:120rpx;height:120rpx;border-radius:44rpx;
background:linear-gradient(135deg,#FFE5B7,#FFC06B);
display:flex;align-items:center;justify-content:center;font-size:64rpx;
box-shadow:0 24rpx 52rpx rgba(245,169,71,.18);flex:none;
}
/* 多宠切换 */
.pet-switch{display:flex;gap:20rpx;overflow-x:auto;padding:0 0 24rpx;white-space:nowrap}
.pet-switch::-webkit-scrollbar{display:none}
.pet-chip{
flex:none;display:inline-flex;border:1rpx solid var(--line);background:#fff;border-radius:40rpx;
padding:18rpx 24rpx;align-items:center;gap:16rpx;color:var(--muted);font-weight:900;font-size:28rpx;
box-shadow:0 12rpx 36rpx rgba(70,48,25,.05);
}
.pet-chip.active{color:var(--primary-dark);background:#FFF4E4;border-color:#FFD6A1}
.pet-chip .mini-avatar{
width:56rpx;height:56rpx;border-radius:20rpx;display:flex;align-items:center;
justify-content:center;background:#FFE4B7;font-size:30rpx;
}
/* 任务列表 */
.task-list{display:flex;flex-direction:column;gap:20rpx}
.task{display:flex;gap:20rpx;align-items:flex-start;background:#FBFAF8;border-radius:32rpx;padding:24rpx;transition:.15s ease}
.circle{
width:46rpx;height:46rpx;border-radius:50%;border:4rpx solid #DED1C4;display:flex;
align-items:center;justify-content:center;color:#fff;font-size:24rpx;flex:none;margin-top:2rpx;font-weight:900;
}
.task.done{opacity:.55}
.task.done .circle{background:var(--green);border-color:var(--green)}
.task-text{flex:1}
.task-text b{font-size:28rpx}
.task-text p{font-size:24rpx;color:var(--muted);margin-top:8rpx;line-height:1.45}
.priority{
font-size:22rpx;color:#A96500;background:#FFF0D7;border-radius:999rpx;padding:8rpx 14rpx;font-weight:900;flex:none;
}
/* 记录行 */
.record-row{
display:flex;justify-content:space-between;align-items:center;padding:24rpx 0;
border-bottom:1rpx solid var(--line);font-size:26rpx;
}
.record-row:last-child{border-bottom:0}
.record-row b{font-size:28rpx}
.record-row span{color:var(--muted);font-size:24rpx}
/* 统计格 */
.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16rpx;margin:28rpx 0}
.stat{background:#fff;border:1rpx solid var(--line);border-radius:32rpx;padding:24rpx 14rpx;text-align:center}
.stat b{display:block;font-size:36rpx;margin-bottom:8rpx}
.stat span{font-size:22rpx;color:var(--muted)}
/* 文章卡 */
.article-card{
display:flex;gap:24rpx;background:#fff;border-radius:40rpx;padding:26rpx;box-shadow:var(--shadow);margin-bottom:24rpx;
}
.article-icon{
width:116rpx;height:116rpx;border-radius:36rpx;flex:none;display:flex;align-items:center;
justify-content:center;background:#FFF1D8;font-size:56rpx;
}
.article-card b{font-size:30rpx}
.article-card p{color:var(--muted);font-size:24rpx;line-height:1.45;margin-top:10rpx}
/* 海报 */
.poster{
background:
radial-gradient(circle at 100% 0%, rgba(245,169,71,.24), transparent 35%),
linear-gradient(160deg,#FFF7E8,#FFFFFF);
border:1rpx solid #F2DFC3;border-radius:52rpx;padding:36rpx;text-align:center;overflow:hidden;position:relative;
}
.poster h3{font-size:40rpx;margin-bottom:20rpx;font-weight:800}
.poster-avatar{
width:152rpx;height:152rpx;margin:16rpx auto 20rpx;border-radius:54rpx;
background:linear-gradient(135deg,#FFE5B7,#FFC06B);display:flex;align-items:center;justify-content:center;
font-size:80rpx;box-shadow:0 24rpx 52rpx rgba(245,169,71,.20);
}
.poster-list{
background:rgba(255,255,255,.78);border-radius:32rpx;padding:24rpx;margin:28rpx 0;text-align:left;line-height:1.8;font-size:26rpx;
}
/* 风险盒 */
.risk-box{
background:#FFF0D8;color:#A96500;padding:24rpx;border-radius:32rpx;font-weight:900;
display:flex;gap:18rpx;margin-bottom:24rpx;align-items:center;
}
/* 弹层内动作行 */
.sheet-actions{display:flex;gap:20rpx;margin-top:24rpx}
.sheet-actions .btn{flex:1}
/* 聊天气泡 */
.plan-chat{display:flex;flex-direction:column;gap:20rpx;margin-bottom:24rpx}
.msg{max-width:88%;border-radius:36rpx;padding:22rpx 26rpx;font-size:26rpx;line-height:1.55}
.msg.ai{background:#F3F8F5;align-self:flex-start}
.msg.user{background:#FFF1D8;align-self:flex-end}