feat: 电子药箱小程序 - 4Tab药品管理
- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡 - 药品百科: 搜索 + 分类筛选 + 20种药品静态数据 - 惠教中心: 4条药品使用指南课程 - 我的: 家庭成员信息管理 - 自定义TabBar + navigation-bar组件 - SVG药品分类插图
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"use strict";Component({externalClasses:["custom-class"],properties:{type:{type:String,value:"normal"},size:{type:String,value:"44"},disabled:{type:Boolean,value:!1},loading:{type:Boolean,value:!1},customStyle:{type:String,value:""}},methods:{onTap:function(e){this.data.disabled||this.data.loading||this.triggerEvent("click",e.detail)}}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{}}
|
||||
@@ -0,0 +1,10 @@
|
||||
<view
|
||||
class="v-btn v-btn--{{type}} v-btn--{{size}} {{disabled ? 'v-btn--disabled' : ''}} {{loading ? 'v-btn--loading' : ''}} custom-class"
|
||||
style="{{customStyle}}"
|
||||
bindtap="onTap"
|
||||
hover-class="{{disabled || loading ? '' : 'v-btn--active-' + type}}"
|
||||
hover-stay-time="70"
|
||||
>
|
||||
<view wx:if="{{loading}}" class="v-btn__loading-icon"></view>
|
||||
<slot wx:else></slot>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.v-btn{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:4px;font-weight:400;transition:all .2s;overflow:hidden}.v-btn--44{height:calc(44px + .5 * (1rem - 16px));font-size:calc(16px + .5 * (1rem - 16px));padding:0 16px}.v-btn--36{height:calc(36px + .5 * (1rem - 16px));font-size:calc(14px + .5 * (1rem - 16px));padding:0 16px}.v-btn--28{height:calc(28px + .5 * (1rem - 16px));font-size:calc(12px + .5 * (1rem - 16px));padding:0 12px}.v-btn--24{height:calc(24px + .5 * (1rem - 16px));font-size:calc(12px + .5 * (1rem - 16px));padding:0 8px}.v-btn--primary{background-color:#f53f3f;color:#fff;border:none}.v-btn--primary.v-btn--disabled{opacity:.5}.v-btn--primary.v-btn--active-primary{background-color:#d93535}.v-btn--primary.v-btn--loading{opacity:.8}.v-btn--secondary{background-color:#ffece8;color:#f53f3f;border:none}.v-btn--secondary.v-btn--disabled{background-color:#ffece8;color:rgba(245,63,63,.5);opacity:1}.v-btn--secondary.v-btn--active-secondary{background-color:#ffdcdc}.v-btn--secondary.v-btn--loading{color:transparent}.v-btn--secondary.v-btn--loading .v-btn__loading-icon{border-color:#f53f3f;border-top-color:transparent}.v-btn--normal{background-color:#f2f3f5;color:#1d2129;border:none}.v-btn--normal.v-btn--disabled{background-color:#f2f3f5;color:rgba(29,33,41,.5);opacity:1}.v-btn--normal.v-btn--active-normal{background-color:#e5e6eb}.v-btn--normal.v-btn--loading{color:transparent}.v-btn--normal.v-btn--loading .v-btn__loading-icon{border-color:#1d2129;border-top-color:transparent}.v-btn--outline{background-color:#fff;color:#1d2129;border:1px solid #c9cdd4}.v-btn--outline.v-btn--disabled{background-color:#fff;color:rgba(29,33,41,.5);border-color:#e5e6eb;opacity:1}.v-btn--outline.v-btn--active-outline{background-color:#f2f3f5;border-color:#c9cdd4}.v-btn--outline.v-btn--loading{color:transparent}.v-btn--outline.v-btn--loading .v-btn__loading-icon{border-color:#1d2129;border-top-color:transparent}.v-btn__loading-icon{width:1em;height:1em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:v-btn-spin 1s linear infinite}@keyframes v-btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";Component({options:{addGlobalClass:!0,multipleSlots:!0,styleIsolation:"apply-shared"},properties:{visible:{type:Boolean,value:!1},showMask:{type:Boolean,value:!0},maskClosable:{type:Boolean,value:!0},zIndex:{type:Number,value:1e3},maskStyle:{type:String,value:""},containerClass:{type:String,value:""},containerStyle:{type:String,value:""}},methods:{onMaskTap:function(){this.triggerEvent("masktap"),this.data.maskClosable&&this.triggerEvent("close")},onContainerTap:function(){},onTouchMove:function(){}}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{}}
|
||||
@@ -0,0 +1,21 @@
|
||||
<view
|
||||
wx:if="{{visible}}"
|
||||
class="mp-dialog-root"
|
||||
style="z-index: {{zIndex}};"
|
||||
catchtouchmove="onTouchMove"
|
||||
>
|
||||
<view
|
||||
class="mp-dialog-mask {{showMask ? '' : 'mp-dialog-mask--transparent'}}"
|
||||
style="{{maskStyle}}"
|
||||
bindtap="onMaskTap"
|
||||
></view>
|
||||
<view
|
||||
class="mp-dialog-container {{containerClass}}"
|
||||
style="{{containerStyle}}"
|
||||
catchtap="onContainerTap"
|
||||
>
|
||||
<slot name="header"></slot>
|
||||
<slot></slot>
|
||||
<slot name="footer"></slot>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.mp-dialog-root{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.mp-dialog-mask{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.35)}.mp-dialog-mask--transparent{background:0 0}.mp-dialog-container{position:relative;z-index:1;width:86vw;max-width:640rpx;background:#fff;border-radius:16rpx;box-sizing:border-box;overflow:hidden}
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Component({options:{styleIsolation:"apply-shared"},externalClasses:["custom-drawer"],properties:{needCancel:{type:Boolean,value:!0},mask:{type:Boolean,value:!0},themeColor:{type:Object,value:null}},data:{flag:!1,wrapAnimate:"wrapAnimate",bgOpacity:0,frameAnimate:"frameAnimate"},methods:{showFrame:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.setData({flag:!0,wrapAnimate:"wrapAnimate",frameAnimate:"frameAnimate"})},hideFrame:function(t){var e=!(!t||"object"!==_typeof(t)||!0!==t.silent),a=this;a.setData({wrapAnimate:"wrapAnimateOut",frameAnimate:"frameAnimateOut"}),e||a.onCancel(),this.timer=setTimeout(function(){a.setData({flag:!1})},400)},onCancel:function(){this.triggerEvent("myCancel")},catchNone:function(){}}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{}}
|
||||
@@ -0,0 +1,30 @@
|
||||
<view wx:if='{{flag}}' class="drawer custom-drawer">
|
||||
<view
|
||||
wx:if="{{mask}}"
|
||||
class='wrap {{wrapAnimate}}'
|
||||
style='background:rgba(0,0,0,{{bgOpacity}});'
|
||||
catchtap='hideFrame'
|
||||
></view>
|
||||
<view
|
||||
wx:else
|
||||
class='wrap {{wrapAnimate}}'
|
||||
style='background:rgba(0,0,0,{{bgOpacity}});'
|
||||
catchtap='catchNone'
|
||||
></view>
|
||||
|
||||
<view wx:if="{{mask}}" catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
|
||||
<view catchtap='catchNone' class='frame' style="background-color: {{themeColor.Fill_7}};">
|
||||
<!-- 内容 -->
|
||||
<slot></slot>
|
||||
<view wx:if="{{needCancel}}" class='cancel' bindtap="hideFrame" hover-class="buttonHover">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view wx:else catchtap='catchNone' class='frame-wrapper {{frameAnimate}}'>
|
||||
<view catchtap='catchNone' class='frame' style="background-color: {{themeColor.Fill_7}};">
|
||||
<!-- 内容 -->
|
||||
<slot></slot>
|
||||
<view wx:if="{{needCancel}}" class='cancel' bindtap="hideFrame" hover-class="buttonHover">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.wrapAnimate{animation:wrapAnimate .5s ease-in-out forwards}@keyframes wrapAnimate{100%{background:rgba(0,0,0,.35)}}.wrapAnimateOut{animation:wrapAnimateOut .4s ease-in-out forwards}@keyframes wrapAnimateOut{0%{background:rgba(0,0,0,.35)}100%{background:rgba(0,0,0,0)}}.frameAnimate{animation:frameAnimate .5s ease forwards}@keyframes frameAnimate{100%{opacity:1;top:0}}.frameAnimateOut{animation:frameAnimateOut .4s ease forwards}@keyframes frameAnimateOut{0%{opacity:1;top:0}100%{opacity:0;top:100vh}}.drawer{z-index:10000;position:fixed;bottom:0;left:0}.frame-wrapper{position:fixed;height:100vh;width:100vw;z-index:2;top:50vh}.frame{background:#202124;color:#fff;position:absolute;bottom:0;width:100%;padding:0;border-top-left-radius:20rpx;border-top-right-radius:20rpx;z-index:3;box-sizing:border-box;overflow:hidden}.flex{display:flex;align-items:center}.wrap{position:fixed;z-index:1;top:0;left:0;right:0;bottom:0}.cancel{border-top:1px solid rgba(255,255,255,.1);display:flex;align-items:center;justify-content:center;height:calc(56px + .5 * (1rem - 16px));font-size:calc(16px + .5 * (1rem - 16px))}.buttonHover{background-color:#1f1f1f}
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";Component({options:{addGlobalClass:!0},properties:{visible:{type:Boolean,value:!1},src:{type:String,value:""},zIndex:{type:Number,value:1300}},methods:{onClose:function(){this.triggerEvent("close")}}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true}
|
||||
@@ -0,0 +1,12 @@
|
||||
<view
|
||||
wx:if="{{visible}}"
|
||||
class="mp-image-preview"
|
||||
style="z-index: {{zIndex}};"
|
||||
>
|
||||
<view class="mp-image-preview-mask" bindtap="onClose"></view>
|
||||
<view class="mp-image-preview-body" bindtap="onClose">
|
||||
<view class="mp-image-preview-content">
|
||||
<image class="mp-image-preview-image" src="{{src}}" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.mp-image-preview{position:fixed;inset:0}.mp-image-preview-mask{position:absolute;inset:0;background:rgba(0,0,0,.88)}.mp-image-preview-body{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.mp-image-preview-content{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.mp-image-preview-image{width:100%;height:100%}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.432 7.82055C16.6695 7.29651 14.7849 7.3558 13.0588 7.98959C11.3327 8.62337 9.85754 9.79775 8.85293 11.3378C7.84833 12.8779 7.36805 14.7013 7.48363 16.5364C7.59921 18.3715 8.30446 20.1202 9.49436 21.5221C10.6842 22.9239 12.2951 23.9039 14.0871 24.3161C15.879 24.7283 17.7562 24.5507 19.4391 23.8097C20.6521 23.2755 22.0686 23.8259 22.6027 25.0389C23.1369 26.252 22.5866 27.6685 21.3735 28.2026C18.7441 29.3605 15.811 29.638 13.011 28.994C10.2111 28.3499 7.69409 26.8186 5.83488 24.6282C3.97567 22.4378 2.87372 19.7055 2.69312 16.8381C2.51253 13.9707 3.26296 11.1217 4.83266 8.71534C6.40236 6.30898 8.70734 4.47402 11.4043 3.48373C14.1013 2.49344 17.0461 2.4008 19.8 3.21961C22.5539 4.03841 24.9697 5.72486 26.6875 8.02779C28.4054 10.3307 29.3334 13.1269 29.3334 16C29.3334 17.3255 28.2589 18.4 26.9334 18.4C25.6079 18.4 24.5334 17.3255 24.5334 16C24.5334 14.1612 23.9395 12.3717 22.8401 10.8978C21.7406 9.42391 20.1945 8.34458 18.432 7.82055Z" fill="url(#paint0_linear_344_10021)" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.432 7.82055C16.6695 7.29651 14.7849 7.3558 13.0588 7.98959C11.3327 8.62337 9.85754 9.79775 8.85293 11.3378C7.84833 12.8779 7.36805 14.7013 7.48363 16.5364C7.59921 18.3715 8.30446 20.1202 9.49436 21.5221C10.6842 22.9239 12.2951 23.9039 14.0871 24.3161C15.879 24.7283 17.7562 24.5507 19.4391 23.8097C20.6521 23.2755 22.0686 23.8259 22.6027 25.0389C23.1369 26.252 22.5866 27.6685 21.3735 28.2026C18.7441 29.3605 15.811 29.638 13.011 28.994C10.2111 28.3499 7.69409 26.8186 5.83488 24.6282C3.97567 22.4378 2.87372 19.7055 2.69312 16.8381C2.51253 13.9707 3.26296 11.1217 4.83266 8.71534C6.40236 6.30898 8.70734 4.47402 11.4043 3.48373C14.1013 2.49344 17.0461 2.4008 19.8 3.21961C22.5539 4.03841 24.9697 5.72486 26.6875 8.02779C28.4054 10.3307 29.3334 13.1269 29.3334 16C29.3334 17.3255 28.2589 18.4 26.9334 18.4C25.6079 18.4 24.5334 17.3255 24.5334 16C24.5334 14.1612 23.9395 12.3717 22.8401 10.8978C21.7406 9.42391 20.1945 8.34458 18.432 7.82055Z" fill="url(#paint1_linear_344_10021)" />
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_344_10021" x1="24.3334" y1="11" x2="21.0001" y2="23.5" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#1765FF" />
|
||||
<stop offset="1" stop-color="#1765FF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_344_10021" x1="-3.16658" y1="25.1667" x2="22.6667" y2="30.1667" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#ADC9FF" />
|
||||
<stop offset="1" stop-color="#8AB1FF" stop-opacity="0" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1 @@
|
||||
"use strict";Component({properties:{zIndex:{type:Number,value:1},theme:{type:String,value:"dark"},type:{type:String,value:"default"}}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true}
|
||||
@@ -0,0 +1,12 @@
|
||||
<view class="volc-loading-mask" style="z-index: {{zIndex}};">
|
||||
<view class="volc-loading-panel volc-loading-{{theme}} volc-loading-{{type}}">
|
||||
<image
|
||||
wx:if="{{type === 'player'}}"
|
||||
class="volc-loading-player-icon"
|
||||
src="./assets/player-loading.svg"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<view wx:else class="volc-loading-spinner"></view>
|
||||
<view wx:if="{{type !== 'player'}}" class="volc-loading-text">加载中</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.volc-loading-mask{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.volc-loading-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;background:0 0}.volc-loading-spinner{width:48rpx;height:48rpx;border:6rpx solid rgba(255,255,255,.28);border-top-color:#fff;border-right-color:#fff;border-radius:50%;animation:volc-loading-spin 1.2s linear infinite;box-sizing:border-box}.volc-loading-text{margin-top:22rpx;color:#fff;font-size:calc(24rpx + .5 * (1rem - 16px));line-height:calc(30rpx + .5 * (1rem - 16px))}.volc-loading-light .volc-loading-spinner{border-color:rgba(29,33,41,.18);border-top-color:#1d2129;border-right-color:#1d2129}.volc-loading-light .volc-loading-text{color:#1d2129}.volc-loading-player-icon{width:64rpx;height:64rpx;animation:volc-loading-spin 1s linear infinite}@keyframes volc-loading-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
|
||||
@@ -0,0 +1 @@
|
||||
"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===_typeof(e)&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}({5:function(e,t,r){Component({options:{addGlobalClass:!0,pureDataPattern:/^_/,multipleSlots:!0},properties:{tabs:{type:Array,value:[]},tabClass:{type:String,value:""},containerStyle:{type:String,value:""},swiperClass:{type:String,value:""},swiperStyle:{type:String,value:""},activeClass:{type:String,value:""},tabUnderlineColor:{type:String,value:"#4080FF"},tabActiveTextColor:{type:String,value:"#000000"},tabInactiveTextColor:{type:String,value:"#000000"},tabBackgroundColor:{type:String,value:"#ffffff"},activeTab:{type:Number,value:0},swipeable:{type:Boolean,value:!0},animation:{type:Boolean,value:!0},duration:{type:Number,value:500}},data:{currentView:0},observers:{activeTab:function(e){var t=this.data.tabs.length;if(0!==t){var r=e-1;r<0&&(r=0),r>t-1&&(r=t-1),this.setData({currentView:r})}}},lifetimes:{created:function(){}},methods:{handleTabClick:function(e){var t=e.currentTarget.dataset.index;this.setData({activeTab:t}),this.triggerEvent("tabclick",{index:t})},handleSwiperChange:function(e){var t=e.detail.current;this.setData({activeTab:t}),this.triggerEvent("change",{index:t})}}})}});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{}}
|
||||
@@ -0,0 +1,20 @@
|
||||
<view class="weui-tabs" style="{{containerStyle}}">
|
||||
<view class="weui-tabs-bar__wrp">
|
||||
<scroll-view scroll-x scroll-into-view="item_{{currentView}}" scroll-with-animation="{{animation}}">
|
||||
<view class="weui-tabs-bar__content">
|
||||
<block wx:for="{{tabs}}" wx:key="title">
|
||||
<view id="item_{{index}}" class="weui-tabs-bar__item" style="background-color: {{tabBackgroundColor}}; color: {{activeTab === index ? tabActiveTextColor : tabInactiveTextColor}};" bindtap="handleTabClick" data-index="{{index}}">
|
||||
<view class="weui-tabs-bar__title {{tabClass}} {{activeTab === index ? activeClass : ''}}" style="border-bottom-color: {{activeTab === index ? tabUnderlineColor : 'transparent'}}">
|
||||
<text class="">{{item.title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<swiper class="{{swiperClass}}" style="{{swiperStyle}}" current="{{activeTab}}" duration="{{duration}}" bindchange="handleSwiperChange">
|
||||
<swiper-item wx:for="{{tabs}}" wx:key="title">
|
||||
<slot data-set="{{item}}" name="tab-content-{{index}}"></slot>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.weui-tabs{--tabs-bar-height:calc(40px + 0.5 * (1rem - 16px));width:100%}.weui-tabs-bar__wrp{width:100%;background-color:transparent}.weui-tabs-bar__content{min-width:100%;white-space:nowrap;height:var(--tabs-bar-height)}.weui-tabs-bar__item{display:inline-flex;align-items:flex-end;justify-content:center;height:100%;max-width:40%;background-color:transparent!important;box-sizing:border-box}.weui-tabs-bar__title{display:inline-flex;align-items:center;justify-content:center;max-width:100%;height:100%;box-sizing:border-box;padding:0 4rpx;border-bottom-width:4rpx;border-bottom-style:solid;border-bottom-color:transparent;font-size:calc(32rpx + .5 * (1rem - 16px))}.weui-tabs-bar__title text{max-width:100%;margin:0 8rpx;display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:inherit}.menu-swiper{height:calc(100% - var(--tabs-bar-height));width:100%}.p-swiper{height:480px}
|
||||
Reference in New Issue
Block a user