feat: 电子药箱小程序 - 4Tab药品管理
- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡 - 药品百科: 搜索 + 分类筛选 + 20种药品静态数据 - 惠教中心: 4条药品使用指南课程 - 我的: 家庭成员信息管理 - 自定义TabBar + navigation-bar组件 - SVG药品分类插图
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
"use strict";var _notification=require("../../../utils/notification"),_utils=require("../../../utils/utils"),_bottomIcon=require("../../../utils/icons/bottom-icon"),_liveMenuIcon=require("../../../utils/icons/live-menu-icon");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)}function _defineProperty(t,n,o){return(n=_toPropertyKey(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function _toPropertyKey(t){var n=_toPrimitive(t,"string");return"symbol"===_typeof(n)?n:String(n)}function _toPrimitive(t,n){if("object"!==_typeof(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,n||"default");if("object"!==_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}Component({properties:{sdkInstance:{type:Object,value:null}},observers:{sdkInstance:function(t){if(t){var n=t.store;this.store=n,this.sdkInstance=t;var o=this;"function"==typeof this._unsub&&this._unsub(),this._unsub=null,this._unsub=n.get({iconList:function(t){o.syncIconList(t)},liveInfo:function(){o.syncIconSources()},"reportInfo.videoType":function(){o.syncIconSources()},"notification.isNotificationOpen":function(t){(0,_utils.setDataIfChanged)(o,{isNotificationOpen:!1!==t}),o.syncIconSources()},"notification.isShowNotificationButton":function(){o.syncIconSources()},imageTextInfo:function(t){var n=t.countUnreadImageTextLive||0;(0,_utils.setDataIfChanged)(o,{countUnreadImageTextLive:n>=100?"99+":n})}})}}},lifetimes:{detached:function(){"function"==typeof this._unsub&&this._unsub(),this._unsub=null}},data:{outerIconList:[],innerIconList:[],countUnreadImageTextLive:0,isNotificationOpen:!0},methods:{findIconByKey:function(t,n){return(Array.isArray(t)?t:[]).find(function(t){return t.key===n})},syncIconSources:function(){(0,_liveMenuIcon.syncLiveRoomBottomIconSourcesFromStore)(this.sdkInstance)},syncIconList:function(t){var n=(0,_bottomIcon.buildBottomIconViewModel)(this.sdkInstance,_bottomIcon.BOTTOM_ICON_ROOM_TYPE.PORTRAIT,{defaultMaxVisibleCount:2,sourceIconList:t}),o={outerIconList:n.outerIconList,innerIconList:n.innerIconList};(0,_utils.isSmallPlainDataEqual)(this._iconListData,o)||(this._iconListData=o,this.setData(o))},openDrawer:function(){this.selectComponent("#volc-more-button-drawer").showFrame()},iconClick:function(t){var n=this.findIconByKey(this.data.outerIconList,t.currentTarget.dataset.key);this.dispatchIconClick(n,this.getIconHandlers())},innerIconClick:function(t){var n=this.findIconByKey(this.data.innerIconList,t.currentTarget.dataset.key);n&&((null==n?void 0:n.key)!==_bottomIcon.BOTTOM_ICON_KEY.NOTIFICATION_SWITCH?(this.selectComponent("#volc-more-button-drawer").hideFrame(),this.dispatchIconClick(n,this.getIconHandlers())):this.dispatchIconClick(n,this.getIconHandlers()))},getIconHandlers:function(){var t=this;return _defineProperty({},_bottomIcon.BOTTOM_ICON_KEY.NOTIFICATION_SWITCH,function(){return(0,_notification.toggleNotificationStateWithToast)(t.store)})},dispatchIconClick:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,_bottomIcon.dispatchBottomIconClick)({sdkInstance:this.sdkInstance,icon:t,roomType:_bottomIcon.BOTTOM_ICON_ROOM_TYPE.PORTRAIT,handlers:n})}}});
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{"Drawer":"../../../pubComponents/drawer/drawer","mp-icon":"weui-miniprogram/icon/icon","mp-badge":"weui-miniprogram/badge/badge"}}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<view wx:if="{{outerIconList.length > 0 || innerIconList.length > 0}}" class="volc-outer-box">
|
||||
<view class="volc-more-button" style="{{item.containerStyle}}" wx:for="{{outerIconList}}" wx:for-item="item" wx:key="key" data-key="{{item.key}}" bindtap="iconClick">
|
||||
<view class="volc-more-button-item-badge" wx:if="{{item.key === 'IMAGE_TEXT_LIVE' && countUnreadImageTextLive}}">
|
||||
<mp-badge content="{{countUnreadImageTextLive}}"/>
|
||||
</view>
|
||||
<view class="volc-more-button-icon">
|
||||
<image wx:if="{{item.iconUrl || item.src}}" src="{{item.iconUrl || item.src}}" style="{{item.style}}" />
|
||||
<mp-icon wx:if="{{item.mpIcon}}" icon="{{item.mpIcon.icon}}" color="{{item.mpIcon.color}}" size="{{item.mpIcon.size}}"></mp-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{innerIconList.length > 0}}" class="volc-more-button" bindtap="openDrawer">
|
||||
<view class="volc-more-button-icon volc-more-button-icon-more">
|
||||
<mp-icon icon="more" color="#fff" size="{{25}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<Drawer id='volc-more-button-drawer' needCancel="{{true}}">
|
||||
<view class="volc-more-button-box">
|
||||
<view class="volc-icon-box" style="{{item.containerStyle}}" wx:for="{{innerIconList}}" wx:for-item="item" wx:key="key" data-key="{{item.key}}" bindtap="innerIconClick">
|
||||
<view class="volc-icon">
|
||||
<view class="volc-icon-inner">
|
||||
<image wx:if="{{item.iconUrl || item.src}}" src="{{item.iconUrl || item.src}}" style="{{item.style}}" />
|
||||
<mp-icon wx:if="{{item.mpIcon}}" icon="{{item.mpIcon.icon}}" color="{{item.mpIcon.color}}" size="{{item.mpIcon.size}}"></mp-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="volc-name">{{item.title || item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</Drawer>
|
||||
+1
@@ -0,0 +1 @@
|
||||
.volc-outer-box{display:flex}.volc-more-button{display:flex;height:calc(72rpx + .5 * (1rem - 16px));width:calc(72rpx + .5 * (1rem - 16px));min-width:calc(72rpx + .5 * (1rem - 16px));border-radius:50%;justify-content:center;background-color:rgba(0,0,0,.14);font-size:calc(25px + .5 * (1rem - 16px));color:#fff;align-items:center;margin-left:12px;position:relative}.volc-icon-inner,.volc-more-button-icon{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.volc-more-button-icon-more{transform:scale(1.1)}.volc-more-button-item-badge{position:absolute;top:-18px;right:-8px}.volc-more-button image{width:40rpx;height:40rpx;object-fit:contain}.volc-more-button mp-icon{display:flex;align-items:center;justify-content:center}.volc-more-button-box{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}.volc-more-button-box .volc-icon-box{display:flex;flex:0 0 calc(58px + 0.5 * (1rem - 16px));flex-direction:column;align-items:center;margin-right:18px;margin-bottom:16px}.volc-icon-box .volc-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}.volc-icon image{width:22px;height:22px;object-fit:contain}.volc-icon-box .volc-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}
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
{"component":true,"usingComponents":{"double-tap-like":"../thumb/double-tap-like/index","chat":"../chat/chat","player":"../player/player","image-preview":"../../pubComponents/image-preview/image-preview","Drawer":"../../pubComponents/drawer/drawer","people-counter":"../people-counter/people-counter","image-text-float":"../image-text-float/image-text-float","image-text-card":"../image-text-card/image-text-card","image-text-root":"../image-text-float/image-text-root/image-text-root","count-down":"../image-text-float/count-down/count-down","product-card":"../product-card/product","float-card":"../product-card/float-card/float-card","ad-floating":"../ad-floating/ad-floating","more-button":"./more-button/more-button","richText":"../richText/portrait/index","ban-page":"../ban-page/ban-page","thumb-button":"../thumb/thumb-button/index","questionnaire":"../image-text-float/questionnaire/questionnaire","live-countdown":"../live-countdown/live-countdown","live-description":"../live-description/live-description","attention-detection":"../attention-detection/attention-detection","mp-icon":"weui-miniprogram/icon/icon","volc-loading":"../../pubComponents/loading/loading"}}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
<!-- index.wxml -->
|
||||
<view
|
||||
class="volc-live-portrait-container"
|
||||
style="{{containerStyle + style}}"
|
||||
wx:if="{{!questionnaireBlocking}}"
|
||||
capture-bind:touchstart="onAttentionInteraction"
|
||||
capture-bind:tap="onAttentionInteraction"
|
||||
>
|
||||
<image
|
||||
wx:if="{{MobileBackImage}}"
|
||||
class="volc-live-mobile-background-image {{isMobileBackgroundBlur ? 'volc-live-mobile-background-image-blur' : ''}}"
|
||||
src="{{MobileBackImage}}"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<view wx:if="{{debug}}" class="userId" bindtap="debugClick">
|
||||
<view wx:if="{{debug}}">v0.1.19</view>
|
||||
<view wx:if="{{debug}}" bindtap="copyText">{{userID}}</view>
|
||||
</view>
|
||||
<view
|
||||
wx:if="{{hasLiveDescription || showPeopleCount || showPortraitStatusTag || showImageFloat || showHeaderImage}}"
|
||||
class="volc-live-portrait-top-overlay"
|
||||
>
|
||||
<view class="volc-live-portrait-description {{!hasLiveDescription ? 'volc-live-portrait-description-placeholder' : ''}}">
|
||||
<live-description wx:if="{{hasLiveDescription}}" sdkInstance="{{sdkInstance}}" />
|
||||
</view>
|
||||
<view wx:if="{{showPeopleCount || showPortraitStatusTag}}" class="volc-live-portrait-status-row">
|
||||
<people-counter
|
||||
wx:if="{{showPeopleCount}}"
|
||||
mode="portrait"
|
||||
sdkInstance="{{sdkInstance}}"
|
||||
/>
|
||||
<view class="volc-live-portrait-status-spacer"></view>
|
||||
<view wx:if="{{showPortraitStatusTag}}" class="volc-live-portrait-status-tag">
|
||||
<view>{{portraitStatusText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
wx:if="{{showImageFloat || showHeaderImage}}"
|
||||
class="volc-live-portrait-top-media-row {{!showImageFloat && showHeaderImage ? 'volc-live-portrait-top-media-row-only-banner' : ''}}"
|
||||
>
|
||||
<scroll-view
|
||||
wx:if="{{showImageFloat}}"
|
||||
scroll-x
|
||||
enhanced="{{true}}"
|
||||
show-scrollbar="{{false}}"
|
||||
class="volc-live-portrait-image-float-scroll {{showHeaderImage ? 'volc-live-portrait-image-float-scroll-with-banner' : ''}}"
|
||||
>
|
||||
<image-text-float
|
||||
bind:commentCheck="commentCheck"
|
||||
bind:previewimage="openPreviewImage"
|
||||
bind:attentionInteraction="onAttentionInteraction"
|
||||
bind:openImageTextCardDrawer="openImageTextCardDrawer"
|
||||
sdkInstance="{{sdkInstance}}"
|
||||
/>
|
||||
</scroll-view>
|
||||
<view
|
||||
wx:if="{{showHeaderImage}}"
|
||||
class="volc-live-portrait-header-banner"
|
||||
catchtap="catchNone"
|
||||
>
|
||||
<image
|
||||
class="volc-live-portrait-header-banner-image"
|
||||
src="{{HeaderImageUrl}}"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<view class="volc-live-portrait-header-banner-close" bindtap="closeHeaderBanner">
|
||||
<mp-icon icon="close" size="{{10}}" color="#ffffff" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<double-tap-like wx:if="{{showPlayer}}">
|
||||
<player id="portraitPlayer" wx:if="{{showPlayer}}" isPortrait="{{true}}" sdkInstance="{{sdkInstance}}" />
|
||||
</double-tap-like>
|
||||
<!-- 竖屏 chat 内含默认可见的工具栏入口,初始化配置到达前先不挂载,避免 sdkInit loading 期间露出业务按钮。 -->
|
||||
<chat
|
||||
wx:if="{{!sdkInitLoading}}"
|
||||
id="portraitChat"
|
||||
class="volc-live-portrait-chat"
|
||||
bind:commentCheck="commentCheck"
|
||||
bind:previewimage="openPreviewImage"
|
||||
sdkInstance="{{sdkInstance}}"
|
||||
>
|
||||
<live-countdown slot="top-area" sdkInstance="{{sdkInstance}}" bind:commentCheck="commentCheck" />
|
||||
<more-button id="portraitMoreButton" sdkInstance="{{sdkInstance}}" />
|
||||
<thumb-button mode="portrait" sdkInstance="{{sdkInstance}}" />
|
||||
</chat>
|
||||
|
||||
<image-text-root class="image-text-root" sdkInstance="{{sdkInstance}}" bind:commentCheck="commentCheck" bind:openChatInput="openChatInput" />
|
||||
<!-- 互动工具浮窗位于顶部 scroll-view 内,抽屉放在父级,避免真机 scroll-view 层级导致抽屉打不开。 -->
|
||||
<Drawer id='portrait-image-text-card-drawer' custom-drawer="portrait-image-text-card-drawer-shell" needCancel="{{false}}"
|
||||
bind:myCancel="cancelImageTextCardDrawer">
|
||||
<!-- 控制传给 Drawer 的真实 slot 内容,避免抽屉未打开时提前创建完整互动工具列表。 -->
|
||||
<view wx:if="{{imageTextCardDrawerReady}}" class="portrait-image-text-card-wrap" capture-bind:touchstart="onAttentionInteraction" capture-bind:tap="onAttentionInteraction">
|
||||
<view class="portrait-image-text-card-title">互动工具</view>
|
||||
<mp-icon bindtap="closeImageTextCardDrawer" icon="close" color="#939aa3" size="{{20}}" class="portrait-image-text-card-close" />
|
||||
<view class="portrait-image-text-card">
|
||||
<image-text-card bind:commentCheck="commentCheck" bind:previewimage="openPreviewImage" sdkInstance="{{sdkInstance}}" forceLightTheme="{{true}}" />
|
||||
</view>
|
||||
</view>
|
||||
</Drawer>
|
||||
<view class="volc-live-floating-container">
|
||||
<view class="volc-live-floating-item">
|
||||
<ad-floating sdkInstance="{{sdkInstance}}" />
|
||||
</view>
|
||||
<view class="volc-live-floating-item">
|
||||
<float-card sdkInstance="{{sdkInstance}}" />
|
||||
</view>
|
||||
</view>
|
||||
<product-card id="volc-productContainer" sdkInstance="{{sdkInstance}}" isPortrait="true"
|
||||
themeColor="{{themeColor}}" />
|
||||
<richText sdkInstance="{{sdkInstance}}" themeColor="{{themeColor}}" />
|
||||
<image-preview
|
||||
visible="{{previewImageVisible}}"
|
||||
src="{{previewImageSrc}}"
|
||||
zIndex="{{12000}}"
|
||||
bind:close="closePreviewImage"
|
||||
/>
|
||||
<ban-page sdkInstance="{{sdkInstance}}" bind:continue="onBanContinue" />
|
||||
<attention-detection id="attentionDetection" sdkInstance="{{sdkInstance}}" />
|
||||
<volc-loading wx:if="{{sdkInitLoading}}" zIndex="{{20001}}" theme="dark" />
|
||||
</view>
|
||||
<view class="volc-live-portrait-container" style="{{containerStyle + style}}" wx:if="{{questionnaireBlocking}}"></view>
|
||||
<questionnaire
|
||||
id="questionnaire"
|
||||
sdkInstance="{{sdkInstance}}"
|
||||
allowedTriggers="{{['live_page_in']}}"
|
||||
closable="{{false}}"
|
||||
bind:commentCheck="commentCheck"
|
||||
bind:blockingChange="onQuestionnaireBlockingChange"
|
||||
/>
|
||||
+1
@@ -0,0 +1 @@
|
||||
.volc-live-portrait-container{width:100vw;height:100vh;position:relative;overflow:hidden;box-sizing:border-box;z-index:0}.volc-live-mobile-background-image{position:absolute;left:0;top:0;width:100vw;height:100vh;z-index:-1;pointer-events:none}.volc-live-mobile-background-image-blur{filter:blur(36rpx);transform:scale(1.15);transform-origin:center center}.volc-live-portrait-top-overlay{position:absolute;top:0;left:0;right:0;z-index:104;box-sizing:border-box;pointer-events:none}.volc-live-portrait-description{box-sizing:border-box;height:calc(60rpx + .5 * (1rem - 16px));padding:0 24rpx;background-color:rgba(0,0,0,.2);pointer-events:auto}.volc-live-portrait-description-placeholder{background-color:transparent;pointer-events:none}.volc-live-portrait-status-row{display:flex;align-items:center;justify-content:space-between;min-height:calc(44rpx + .5 * (1rem - 16px));padding:12rpx 24rpx 0;box-sizing:border-box;pointer-events:none}.volc-live-portrait-status-spacer{flex:1;min-width:0}.volc-live-portrait-status-tag{display:flex;align-items:center;height:calc(44rpx + .5 * (1rem - 16px));padding:0 16rpx;border:1rpx solid rgba(255,255,255,.1);border-radius:22rpx;background:rgba(0,0,0,.2);backdrop-filter:blur(4rpx);color:rgba(255,255,255,.8);font-size:calc(22rpx + .5 * (1rem - 16px));font-weight:500;line-height:calc(44rpx + .5 * (1rem - 16px));box-sizing:border-box;pointer-events:auto}.volc-live-portrait-top-media-row{display:flex;align-items:flex-start;width:100%;padding:12rpx 24rpx 0;box-sizing:border-box;gap:16rpx;pointer-events:none}.volc-live-portrait-top-media-row-only-banner{justify-content:flex-end}.volc-live-portrait-image-float-scroll{flex:1;min-width:0;max-width:100%;height:calc(100rpx + .5 * (1rem - 16px));white-space:nowrap;pointer-events:auto}.volc-live-portrait-image-float-scroll-with-banner{max-width:calc(100vw - 48rpx - 460rpx - 16rpx)}.volc-live-portrait-header-banner{position:relative;flex:0 0 460rpx;width:460rpx;height:70rpx;margin-top:8rpx;overflow:hidden;border-radius:2rpx;pointer-events:auto}.volc-live-portrait-header-banner-image{width:100%;height:100%}.volc-live-portrait-header-banner-close{position:absolute;top:50%;right:8rpx;transform:translateY(-50%);width:28rpx;height:28rpx;border-radius:50%;background-color:rgba(0,0,0,.38);opacity:.8;display:flex;align-items:center;justify-content:center}.volc-live-portrait-header-banner-close mp-icon{display:flex;align-items:center;justify-content:center;line-height:1}.volc-live-portrait-player{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0}.image-text-root{position:absolute;z-index:10001}.portrait-image-text-card-drawer-shell{z-index:800!important}.portrait-image-text-card-wrap{background-color:#fff;height:60vh;display:flex;flex-direction:column;box-sizing:border-box}.portrait-image-text-card-title{font-size:calc(16px + .5 * (1rem - 16px));margin:0 20px 0 16px;height:calc(44px + .5 * (1rem - 16px));line-height:calc(44px + .5 * (1rem - 16px));font-weight:500;color:#1d2129}.portrait-image-text-card-close{position:absolute;right:10px;top:8px;background:0 0;box-shadow:none}.portrait-image-text-card{flex:1;min-height:0;overflow:auto}.volc-live-floating-container{position:absolute;right:28rpx;bottom:130rpx;bottom:calc(130rpx + constant(safe-area-inset-bottom));bottom:calc(130rpx + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:flex-end}.volc-live-floating-item+.volc-live-floating-item{margin-top:16rpx}.volc-live-portrait-chat{display:flex;flex:1;width:100vw;bottom:0;bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom);box-sizing:border-box;position:absolute;height:300px}.userId{position:fixed;top:0;left:0;width:150px;height:calc(60px + .5 * (1rem - 16px));color:red;font-size:calc(15px + .5 * (1rem - 16px));z-index:10000}
|
||||
Reference in New Issue
Block a user