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:
@@ -0,0 +1,20 @@
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,
|
||||
hidden: false,
|
||||
list: [
|
||||
{ pagePath: '/pages/home/home', text: '首页', icon: '🏠' },
|
||||
{ pagePath: '/pages/plan/plan', text: '计划', icon: '📅' },
|
||||
{ pagePath: '/pages/record/record', text: '记录', icon: '✍️' },
|
||||
{ pagePath: '/pages/report/report', text: '报告', icon: '📊' },
|
||||
{ pagePath: '/pages/community/community', text: '社区', icon: '🐾' }
|
||||
]
|
||||
},
|
||||
methods: {
|
||||
switchTab(e) {
|
||||
const idx = e.currentTarget.dataset.index;
|
||||
const path = this.data.list[idx].pagePath;
|
||||
wx.switchTab({ url: path });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<view class="tabbar" hidden="{{hidden}}">
|
||||
<view wx:for="{{list}}" wx:key="text" class="tab {{selected === index ? 'active' : ''}}"
|
||||
data-index="{{index}}" bindtap="switchTab">
|
||||
<text class="tab-icon">{{item.icon}}</text>
|
||||
<text class="tab-text">{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,16 @@
|
||||
.tabbar{
|
||||
position:fixed;left:0;right:0;bottom:0;z-index:50;
|
||||
height:calc(156rpx + env(safe-area-inset-bottom));
|
||||
padding-bottom:calc(16rpx + env(safe-area-inset-bottom));
|
||||
background:rgba(255,255,255,.94);
|
||||
border-top:1rpx solid #EEE6DC;
|
||||
display:flex;
|
||||
backdrop-filter:blur(32rpx);
|
||||
-webkit-backdrop-filter:blur(32rpx);
|
||||
}
|
||||
.tab{
|
||||
flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8rpx;
|
||||
color:#8D8277;font-size:24rpx;
|
||||
}
|
||||
.tab-icon{font-size:42rpx;line-height:1}
|
||||
.tab.active{color:#DD8420;font-weight:900}
|
||||
Reference in New Issue
Block a user