feat: 电子药箱小程序 - 4Tab药品管理
- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡 - 药品百科: 搜索 + 分类筛选 + 20种药品静态数据 - 惠教中心: 4条药品使用指南课程 - 我的: 家庭成员信息管理 - 自定义TabBar + navigation-bar组件 - SVG药品分类插图
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{"Drawer":"../../../pubComponents/drawer/drawer","mp-icon":"weui-miniprogram/icon/icon"}}
|
||||
@@ -0,0 +1,80 @@
|
||||
<Drawer id="vote-drawer" custom-drawer="vote-drawer-shell" needCancel="{{false}}" bind:myCancel="onVoteDrawerCancel">
|
||||
<view wx:if="{{visible}}" class="vote-drawer {{useDarkTheme ? 'vote-drawer-dark' : ''}}">
|
||||
<view class="vote-header">
|
||||
<view class="vote-title-row">
|
||||
<view class="vote-type">[{{data.IsMultiple ? '多选' : '单选'}}]</view>
|
||||
<mp-icon bindtap="closeVoteDrawer" icon="close" color="#939aa3" size="{{20}}" class="vote-close-icon drawer-close-shadow" />
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{loading}}" class="vote-empty">加载中...</view>
|
||||
<view wx:elif="{{errMsg && !data}}" class="vote-empty">{{errMsg}}</view>
|
||||
<view wx:else class="vote-main">
|
||||
<view class="vote-title">{{data.Title}}</view>
|
||||
<scroll-view scroll-y class="vote-options-scroll">
|
||||
<radio-group wx:if="{{!data.IsMultiple}}" bindchange="valueChange" class="vote-options">
|
||||
<label
|
||||
wx:for="{{data.Options}}"
|
||||
wx:key="OptionSite"
|
||||
class="vote-option"
|
||||
>
|
||||
<radio
|
||||
class="vote-native-control"
|
||||
value="{{item.OptionSite}}"
|
||||
checked="{{item.checked}}"
|
||||
disabled="{{isVoted || isVoteClosed}}"
|
||||
color="#3370ff"
|
||||
/>
|
||||
<view class="vote-option-body">
|
||||
<view class="vote-option-row">
|
||||
<view class="vote-option-check {{item.checked ? 'vote-option-check-checked' : ''}}">
|
||||
<view wx:if="{{item.checked}}" class="vote-option-check-mark"></view>
|
||||
</view>
|
||||
<view class="vote-option-content">{{item.OptionName}}</view>
|
||||
</view>
|
||||
<view wx:if="{{isShowResult}}" class="vote-progress">
|
||||
<view class="vote-progress-text">{{item.OptionCount || 0}} 票, {{item.OptionPercent || 0}}%</view>
|
||||
<progress percent="{{item.OptionPercent || 0}}" border-radius="6" stroke-width="6" activeColor="#3370ff" backgroundColor="{{useDarkTheme ? '#37383a' : '#f1f2f5'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
<checkbox-group wx:else bindchange="valueChange" class="vote-options">
|
||||
<label
|
||||
wx:for="{{data.Options}}"
|
||||
wx:key="OptionSite"
|
||||
class="vote-option"
|
||||
>
|
||||
<checkbox
|
||||
class="vote-native-control"
|
||||
value="{{item.OptionSite}}"
|
||||
checked="{{item.checked}}"
|
||||
disabled="{{isVoted || isVoteClosed}}"
|
||||
color="#3370ff"
|
||||
/>
|
||||
<view class="vote-option-body">
|
||||
<view class="vote-option-row">
|
||||
<view class="vote-option-check vote-option-check-multiple {{item.checked ? 'vote-option-check-checked' : ''}}">
|
||||
<view wx:if="{{item.checked}}" class="vote-option-check-mark"></view>
|
||||
</view>
|
||||
<view class="vote-option-content">{{item.OptionName}}</view>
|
||||
</view>
|
||||
<view wx:if="{{isShowResult}}" class="vote-progress">
|
||||
<view class="vote-progress-text">{{item.OptionCount || 0}} 票, {{item.OptionPercent || 0}}%</view>
|
||||
<progress percent="{{item.OptionPercent || 0}}" border-radius="6" stroke-width="6" activeColor="#3370ff" backgroundColor="{{useDarkTheme ? '#37383a' : '#f1f2f5'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</scroll-view>
|
||||
<view wx:if="{{data.TotalCount > -1}}" class="vote-total">实际参与人数:{{data.TotalCount || 0}}人</view>
|
||||
<view class="vote-footer">
|
||||
<button
|
||||
class="vote-submit {{isVoted || isVoteClosed ? 'vote-submit-disabled' : ''}}"
|
||||
disabled="{{isVoted || isVoteClosed}}"
|
||||
loading="{{submitting}}"
|
||||
bindtap="formSubmit"
|
||||
>{{isVoted ? '已投票' : (isVoteClosed ? '投票已截止' : '提交投票')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Drawer>
|
||||
@@ -0,0 +1 @@
|
||||
.vote-drawer-shell .frame{overflow:hidden;padding:0!important}.vote-drawer{position:relative;box-sizing:border-box;background:#fff;color:#1f2329;border-radius:14px 14px 0 0;max-height:86vh;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);display:flex;flex-direction:column}.vote-drawer-dark{background:#1f2025;color:#f2f3f5}.vote-header{padding:28rpx 40rpx 8rpx;background:transparent linear-gradient(180deg,#e7edff,#fff)}.vote-title-row{display:flex;align-items:center;justify-content:space-between}.vote-type{color:#8f98a8;font-size:calc(28rpx + .5 * (1rem - 16px));line-height:calc(40rpx + .5 * (1rem - 16px))}.vote-close-icon{flex-shrink:0}.drawer-close-shadow{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:56rpx;height:56rpx;border-radius:50%;background:0 0;box-shadow:none}.vote-title{flex-shrink:0;padding:16rpx 56rpx 0;margin-bottom:44rpx;font-size:calc(36rpx + .5 * (1rem - 16px));font-weight:500;line-height:calc(50rpx + .5 * (1rem - 16px))}.vote-main{display:flex;flex:1;min-height:0;flex-direction:column}.vote-options-scroll{flex:1;min-height:0;max-height:420rpx;padding:0 56rpx;box-sizing:border-box}.vote-options{display:block}.vote-option{position:relative;display:flex;align-items:flex-start;min-height:calc(74rpx + .5 * (1rem - 16px));padding:10rpx 0 44rpx}.vote-native-control{position:absolute;left:0;top:10rpx;width:42rpx;height:42rpx;opacity:0}.vote-option-body{flex:1;min-width:0}.vote-option-row{display:flex;align-items:center;min-height:calc(46rpx + .5 * (1rem - 16px))}.vote-option-check{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-sizing:border-box;width:34rpx;height:34rpx;border:2rpx solid #d8dbe2;border-radius:50%;background:#fff}.vote-option-check-multiple{border-radius:6rpx}.vote-option-check-checked{border-color:#3370ff;background:#3370ff}.vote-option-check-mark{width:9rpx;height:16rpx;margin-top:-4rpx;border:solid #fff;border-width:0 4rpx 4rpx 0;transform:rotate(45deg)}.vote-option-content{flex:1;min-width:0;margin-left:20rpx}.vote-option-content{color:#1d2129;font-size:calc(30rpx + .5 * (1rem - 16px));line-height:calc(42rpx + .5 * (1rem - 16px))}.vote-progress{margin-top:18rpx}.vote-progress-text{margin-bottom:8rpx;color:#8f98a8;font-size:calc(24rpx + .5 * (1rem - 16px));line-height:calc(34rpx + .5 * (1rem - 16px))}.vote-total{flex-shrink:0;margin-top:0;padding:0 56rpx;color:#8f98a8;font-size:calc(26rpx + .5 * (1rem - 16px));line-height:calc(36rpx + .5 * (1rem - 16px));text-align:center}.vote-footer{flex-shrink:0;box-sizing:border-box;padding:20rpx 56rpx 40rpx;background:inherit}.vote-submit{display:flex!important;align-items:center;justify-content:center;width:100%!important;height:calc(80rpx + .5 * (1rem - 16px));margin:0;padding:0;background:#3370ff;color:#fff;border-radius:100rpx;font-size:calc(28rpx + .5 * (1rem - 16px));font-weight:400;line-height:calc(80rpx + .5 * (1rem - 16px));text-align:center}.vote-submit::after{border:0}.vote-submit-disabled,.vote-submit[disabled]{background:#8baeff!important;color:#fff!important}.vote-empty{padding:20px 0;color:#f53f3f;font-size:calc(14px + .5 * (1rem - 16px));text-align:center}.vote-drawer-dark .vote-header{background:#1f2025}.vote-drawer-dark .vote-option-content,.vote-drawer-dark .vote-title{color:#fff}.vote-drawer-dark .vote-progress-text,.vote-drawer-dark .vote-total,.vote-drawer-dark .vote-type{color:rgba(255,255,255,.5)}.vote-drawer-dark .vote-option-check{border-color:rgba(255,255,255,.34);background:0 0}.vote-drawer-dark .vote-option-check-checked{border-color:#3370ff;background:#3370ff}
|
||||
Reference in New Issue
Block a user