import React from 'react'; import { View, Image, ScrollView, ITouchEvent } from '@tarojs/components'; import classNames from 'classnames'; const iconClose = 'https://wanmi-b2b-x-site.oss-cn-shanghai.aliyuncs.com/pandora-ui/assets/components/images/icon-close.png'; interface PopupLayerProps { /** 弹框位置 */ position?: | 'bottom' // 底部 | 'right' // 右侧 | 'left'; // 左侧 /** 标题 */ title?: string; /** 是否滚动 */ scroll?: boolean; /** 是否可见 */ visible?: boolean; /** 关闭事件 */ onClose?: (event: ITouchEvent) => void; } /** * 弹层组件 */ const PopupLayer: React.FC = ({ position = 'bottom', title = '', scroll = false, visible = false, onClose = () => {}, children, }) => { const classObject = classNames( 'wm-popup-layer', `wm-popup-layer-${position}`, { 'wm-popup-layer-active': visible }, ); return ( { e.stopPropagation(); }} className={classObject}> {title !== '' && ( {title} )} {scroll ? ( {children} ) : ( {children} )} ); }; export default PopupLayer;