✨ feat(购物页面): 已完成页面逻辑,等待对接接口
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { View } from '@tarojs/components'
|
||||
import { Button, Radio, View } from '@tarojs/components'
|
||||
import { FC, ReactNode } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
@@ -7,7 +7,7 @@ type FlexDirection = 'row' | 'col'
|
||||
|
||||
interface PropsType {
|
||||
flexDirection?: FlexDirection
|
||||
|
||||
onClick?: Function
|
||||
circle?: boolean
|
||||
children?: ReactNode
|
||||
customStyle?: React.CSSProperties
|
||||
@@ -15,7 +15,7 @@ interface PropsType {
|
||||
}
|
||||
|
||||
const LayoutBlock: FC<PropsType> = (props) => {
|
||||
const { flexDirection = 'col', circle = false, children, customStyle = {}, customClassName='' } = props
|
||||
const { flexDirection = 'col', circle = false, children, customStyle = {}, customClassName = '', onClick } = props
|
||||
|
||||
const getClassName = () => {
|
||||
const classObject = {
|
||||
@@ -25,8 +25,16 @@ const LayoutBlock: FC<PropsType> = (props) => {
|
||||
return classObject
|
||||
}
|
||||
|
||||
const handleClick = (event)=>{
|
||||
console.log('event==>', event)
|
||||
onClick && onClick()
|
||||
}
|
||||
|
||||
return (
|
||||
<View className={classnames(styles.layoutBlock, getClassName(), customClassName)} style={customStyle}>
|
||||
<View
|
||||
className={classnames(styles.layoutBlock, getClassName(), customClassName)}
|
||||
style={customStyle}
|
||||
onClick={handleClick}>
|
||||
{children}
|
||||
</View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user