feat: init fitness-coach (backend + miniprogram)
- backend: NestJS service with exercise/plan data - miniprogram: WeChat mini program client - exclude node_modules, dist, runtime data-store, local env
This commit is contained in:
20
miniprogram/components/bottom-nav/index.js
Normal file
20
miniprogram/components/bottom-nav/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
Component({
|
||||
properties: {
|
||||
active: { type: String, value: 'home' } // 'home' | 'category' | 'plan'
|
||||
},
|
||||
data: {
|
||||
items: [
|
||||
{ key: 'home', label: '首页', emoji: '🏠', page: '/pages/index/index' },
|
||||
{ key: 'category', label: '分类', emoji: '📚', page: '/pages/category/category' },
|
||||
{ key: 'plan', label: '计划', emoji: '📋', page: '/pages/collection/collection' }
|
||||
]
|
||||
},
|
||||
methods: {
|
||||
onTap(e) {
|
||||
const page = e.currentTarget.dataset.page;
|
||||
if (!page) return;
|
||||
// 使用 reLaunch 重置页面栈,避免页面层级堆叠
|
||||
wx.reLaunch({ url: page });
|
||||
}
|
||||
}
|
||||
});
|
||||
4
miniprogram/components/bottom-nav/index.json
Normal file
4
miniprogram/components/bottom-nav/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
11
miniprogram/components/bottom-nav/index.wxml
Normal file
11
miniprogram/components/bottom-nav/index.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<view class="bn">
|
||||
<view
|
||||
wx:for="{{items}}"
|
||||
wx:key="key"
|
||||
class="bn__item {{active === item.key ? 'bn__item--active' : ''}}"
|
||||
data-page="{{item.page}}"
|
||||
bindtap="onTap">
|
||||
<text class="bn__emoji">{{item.emoji}}</text>
|
||||
<text class="bn__label">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
22
miniprogram/components/bottom-nav/index.wxss
Normal file
22
miniprogram/components/bottom-nav/index.wxss
Normal file
@@ -0,0 +1,22 @@
|
||||
.bn {
|
||||
position: fixed;
|
||||
left: 0; right: 0; bottom: 0;
|
||||
display: flex;
|
||||
background: rgba(20,26,22,0.92);
|
||||
backdrop-filter: blur(12px);
|
||||
border-top: 1rpx solid var(--line);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 60;
|
||||
}
|
||||
.bn__item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16rpx 0 14rpx;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.bn__item--active { color: var(--gold); }
|
||||
.bn__emoji { font-size: 40rpx; line-height: 1; }
|
||||
.bn__label { font-size: 22rpx; margin-top: 6rpx; }
|
||||
.bn__item--active .bn__label { color: var(--gold-2); }
|
||||
Reference in New Issue
Block a user