✨ feat(购物页面): 已完成页面逻辑,等待对接接口

This commit is contained in:
xuan
2022-09-16 19:06:00 +08:00
parent c2fa0766aa
commit ad32aa5773
13 changed files with 424 additions and 184 deletions
+12 -4
View File
@@ -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>
)