feat: 电子药箱小程序 - 4Tab药品管理
- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡 - 药品百科: 搜索 + 分类筛选 + 20种药品静态数据 - 惠教中心: 4条药品使用指南课程 - 我的: 家庭成员信息管理 - 自定义TabBar + navigation-bar组件 - SVG药品分类插图
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
background: #ffffff;
|
||||
border-top: 1rpx solid #e8e8e8;
|
||||
z-index: 999;
|
||||
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
padding: 8rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 4rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: #07C160;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,
|
||||
list: [
|
||||
{
|
||||
pagePath: 'pages/tab-bar/medicine-box/index',
|
||||
text: '电子药箱',
|
||||
icon: '💊',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/tab-bar/drug-wiki/index',
|
||||
text: '药品百科',
|
||||
icon: '📖',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/tab-bar/education/index',
|
||||
text: '惠教中心',
|
||||
icon: '🎓',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/tab-bar/profile/index',
|
||||
text: '我的',
|
||||
icon: '👤',
|
||||
},
|
||||
],
|
||||
},
|
||||
methods: {
|
||||
switchTab(e: WechatMiniprogram.TouchEvent) {
|
||||
const { index, path } = e.currentTarget.dataset;
|
||||
wx.switchTab({ url: `/${path}` });
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
<view class="tab-bar">
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:key="index"
|
||||
class="tab-item {{selected === index ? 'active' : ''}}"
|
||||
data-index="{{index}}"
|
||||
data-path="{{item.pagePath}}"
|
||||
bind:tap="switchTab"
|
||||
>
|
||||
<view class="tab-icon">{{item.icon}}</view>
|
||||
<view class="tab-text">{{item.text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user