feat: 电子药箱小程序 - 4Tab药品管理

- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡
- 药品百科: 搜索 + 分类筛选 + 20种药品静态数据
- 惠教中心: 4条药品使用指南课程
- 我的: 家庭成员信息管理
- 自定义TabBar + navigation-bar组件
- SVG药品分类插图
This commit is contained in:
陈誉午
2026-07-29 11:20:52 +08:00
commit 994b267f5c
683 changed files with 43849 additions and 0 deletions
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1,32 @@
/* components/collapse/collapse.wxss */
.collapse {
border-radius: 16rpx;
overflow: hidden;
}
.collapse-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx;
font-weight: 700;
}
.arrow {
transition: transform 0.3s;
}
.arrow.opened {
transform: rotate(180deg);
}
.collapse-content {
overflow: hidden;
transition: max-height 0.3s ease;
}
.content-inner {
padding: 24rpx;
color: #333;
background: #ffddcb;
}
@@ -0,0 +1,64 @@
// components/collapse/collapse.ts
export { }
Component({
properties: {
title: {
type: String,
value: ''
},
titleStyle: {
type: String,
value: ''
},
defaultOpen: {
type: Boolean,
value: false
},
disableOpen: {
type: Boolean,
value: false
},
offsetHeight: {
type: Number,
value: 0
}
},
data: {
open: false,
contentHeight: 0
},
lifetimes: {
ready(this: WechatMiniprogram.Component.TrivialInstance) {
this.setData({ open: this.data.defaultOpen })
this.calcHeight()
}
},
methods: {
toggle(this: WechatMiniprogram.Component.TrivialInstance) {
if (this.data.disableOpen) return;
const open = !this.data.open;
this.setData({ open }, () => {
if (open) {
// 等展开后再算高度
this.calcHeight();
}
});
},
calcHeight(this: WechatMiniprogram.Component.TrivialInstance) {
const query = this.createSelectorQuery()
query.select('#content').boundingClientRect()
query.exec(res => {
if (res && res[0]) {
this.setData({
contentHeight: res[0].height
})
}
})
}
}
})
@@ -0,0 +1,17 @@
<view class="collapse">
<!-- header -->
<view class="collapse-header" bind:tap="toggle">
<view class="title">
<view class="title-text" style="{{ titleStyle }}">
{{ title }}
</view>
</view>
<view class="arrow {{ open ? 'open' : '' }}">▼</view>
</view>
<view class="collapse-content" style="max-height: {{ open ? (contentHeight+offsetHeight) + 'px' : '0rpx' }}">
<view class="content-inner" id="content">
<slot />
</view>
</view>
</view>