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 @@
"use strict";var _liveMenuIcon=require("../../../utils/icons/live-menu-icon");Component({properties:{module:{type:String,value:"toolbar"},sdkInstance:{type:Object,value:null},iconList:{type:Array,value:[]},useExternalDrawer:{type:Boolean,value:!1},hasExternalDrawerItems:{type:Boolean,value:!1}},data:{outerIconList:[],innerIconList:[],showMoreEntry:!1},observers:{"sdkInstance, module":function(){this.bindIconSourceSync()},"module, iconList, useExternalDrawer, hasExternalDrawerItems":function(){this.syncIconList()}},lifetimes:{detached:function(){this.unbindIconSourceSync()}},methods:{bindIconSourceSync:function(){var n=this;this.unbindIconSourceSync();var t=this.data.sdkInstance;if(t&&"player"===this.data.module){var e=t.store,o=function(){return n.syncIconSources()};this._unsubIconSources=e.get({liveInfo:o,"reportInfo.videoType":o,"notification.isNotificationOpen":o,"notification.isShowNotificationButton":o}),this.syncIconSources()}},unbindIconSourceSync:function(){"function"==typeof this._unsubIconSources&&this._unsubIconSources(),this._unsubIconSources=null},syncIconSources:function(){(0,_liveMenuIcon.syncLiveRoomBottomIconSourcesFromStore)(this.data.sdkInstance)},syncIconList:function(){var n=Array.isArray(this.data.iconList)?this.data.iconList:[];if("player"===this.data.module)return this.data.useExternalDrawer?void this.setData({outerIconList:n,innerIconList:[],showMoreEntry:this.data.useExternalDrawer&&this.data.hasExternalDrawerItems}):void this.setData({outerIconList:n.slice(0,1),innerIconList:n.slice(1),showMoreEntry:!1});this.setData({outerIconList:n,innerIconList:[],showMoreEntry:!1})},openDrawer:function(){var n,t;this.data.useExternalDrawer?this.triggerEvent("openmore",{module:this.data.module}):null===(n=this.selectComponent("#volc-landscape-more-button-drawer"))||void 0===n||null===(t=n.showFrame)||void 0===t||t.call(n)},onOuterIconTap:function(n){var t=this.findIconByKey(this.data.outerIconList,n.currentTarget.dataset.key);this.emitIconTap(t)},onInnerIconTap:function(n){this.tapInnerIconByKey(n.currentTarget.dataset.key)},tapInnerIconByKey:function(n){var t,e,o=this.findIconByKey(this.data.innerIconList,n);this.emitIconTap(o),this.data.useExternalDrawer||null===(t=this.selectComponent("#volc-landscape-more-button-drawer"))||void 0===t||null===(e=t.hideFrame)||void 0===e||e.call(t)},findIconByKey:function(n,t){return(Array.isArray(n)?n:[]).find(function(n){return n.key===t})},emitIconTap:function(n){null!=n&&n.key&&this.triggerEvent("tapicon",{icon:n,module:this.data.module})}}});
@@ -0,0 +1 @@
{"component":true,"usingComponents":{"mp-icon":"weui-miniprogram/icon/icon","Drawer":"../../../pubComponents/drawer/drawer"}}
@@ -0,0 +1,37 @@
<view wx:if="{{outerIconList.length || showMoreEntry || innerIconList.length}}" class="landscape-more-button landscape-more-button-{{module}}">
<view
class="landscape-more-button-item"
style="{{item.containerStyle}}"
wx:for="{{outerIconList}}"
wx:for-item="item"
wx:key="key"
data-key="{{item.key}}"
bindtap="onOuterIconTap"
>
<image wx:if="{{item.iconUrl || item.src}}" class="landscape-more-button-image" src="{{item.iconUrl || item.src}}" mode="aspectFit" style="{{item.style}}" />
<mp-icon wx:if="{{item.mpIcon}}" icon="{{item.mpIcon.icon}}" color="{{item.mpIcon.color}}" size="{{item.mpIcon.size}}" />
</view>
<view wx:if="{{module === 'player' && (showMoreEntry || innerIconList.length)}}" class="landscape-more-button-item landscape-more-button-item-more" bindtap="openDrawer">
<mp-icon icon="more" color="#fff" size="{{30}}" />
</view>
</view>
<Drawer wx:if="{{module === 'player' && !useExternalDrawer}}" id="volc-landscape-more-button-drawer">
<view class="landscape-more-drawer">
<view
class="landscape-more-drawer-item"
style="{{item.containerStyle}}"
wx:for="{{innerIconList}}"
wx:for-item="item"
wx:key="key"
data-key="{{item.key}}"
bindtap="onInnerIconTap"
>
<view class="landscape-more-drawer-icon">
<image wx:if="{{item.iconUrl || item.src}}" class="landscape-more-drawer-image" src="{{item.iconUrl || item.src}}" mode="aspectFit" style="{{item.style}}" />
<mp-icon wx:if="{{item.mpIcon}}" icon="{{item.mpIcon.icon}}" color="{{item.mpIcon.color}}" size="{{item.mpIcon.size}}" />
</view>
<view class="landscape-more-drawer-name">{{item.title || item.name}}</view>
</view>
</view>
</Drawer>
@@ -0,0 +1 @@
.landscape-more-button{display:flex;align-items:center}.landscape-more-button-toolbar{gap:12rpx}.landscape-more-button-player{gap:16rpx}.landscape-more-button-item{width:calc(72rpx + .5 * (1rem - 16px));height:calc(72rpx + .5 * (1rem - 16px));min-width:calc(72rpx + .5 * (1rem - 16px));border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;background:rgba(0,0,0,.14);position:relative;box-sizing:border-box}.landscape-more-button-image{width:40rpx;height:40rpx}.landscape-more-drawer{display:flex;flex-wrap:wrap;align-content:flex-start;width:100%;overflow-x:hidden;overflow-y:auto;max-height:calc(50vh - 56px - .5 * (1rem - 16px));padding:21px 15px 5px;box-sizing:border-box;-webkit-overflow-scrolling:touch}.landscape-more-drawer-item{display:flex;flex:0 0 calc(58px + 0.5 * (1rem - 16px));flex-direction:column;align-items:center;margin-right:18px;margin-bottom:16px}.landscape-more-drawer-icon{display:flex;align-items:center;justify-content:center;background-color:#2c2d30;height:calc(34px + .5 * (1rem - 16px));width:calc(34px + .5 * (1rem - 16px));border-radius:50%;color:#fff}.landscape-more-drawer-image{width:22px;height:22px}.landscape-more-drawer-name{display:block;width:100%;margin-top:8px;font-size:calc(12px + .5 * (1rem - 16px));line-height:calc(18px + .5 * (1rem - 16px));color:#d2d3d3;text-align:center;white-space:normal;word-break:break-all;overflow-wrap:break-word}