|
@@ -3,6 +3,7 @@ import './Box.scss'
|
|
|
import { BoxType } from "@/utils/types";
|
|
import { BoxType } from "@/utils/types";
|
|
|
import Taro from "@tarojs/taro";
|
|
import Taro from "@tarojs/taro";
|
|
|
import { ColorType } from "@/context/themes/color";
|
|
import { ColorType } from "@/context/themes/color";
|
|
|
|
|
+import { rpxToPx } from "@/utils/tools";
|
|
|
|
|
|
|
|
export default function Component(props: {
|
|
export default function Component(props: {
|
|
|
children: React.ReactNode,
|
|
children: React.ReactNode,
|
|
@@ -11,7 +12,7 @@ export default function Component(props: {
|
|
|
style?: any,
|
|
style?: any,
|
|
|
type?: BoxType,
|
|
type?: BoxType,
|
|
|
onClick?: Function,
|
|
onClick?: Function,
|
|
|
- tranparentBg?:boolean
|
|
|
|
|
|
|
+ tranparentBg?: boolean
|
|
|
}) {
|
|
}) {
|
|
|
|
|
|
|
|
function onClick(e) {
|
|
function onClick(e) {
|
|
@@ -37,10 +38,15 @@ export default function Component(props: {
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return <View className="box-container" style={{ ...props.style,backgroundColor:props.tranparentBg?'transparent':ColorType.box }} onTap={onClick}>
|
|
|
|
|
- {
|
|
|
|
|
- props.title && <Text className="box-title">{props.title}</Text>
|
|
|
|
|
- }
|
|
|
|
|
- {props.children}
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ return <View className="box-container"
|
|
|
|
|
+ style={{
|
|
|
|
|
+ ...props.style,
|
|
|
|
|
+ backgroundColor: props.tranparentBg ? 'transparent' : ColorType.box,
|
|
|
|
|
+ // marginBottom: props.marginBottom ? props.marginBottom : rpxToPx(24)
|
|
|
|
|
+ }} onTap={onClick}>
|
|
|
|
|
+ {
|
|
|
|
|
+ props.title && <Text className="box-title">{props.title}</Text>
|
|
|
|
|
+ }
|
|
|
|
|
+ {props.children}
|
|
|
|
|
+ </View>
|
|
|
}
|
|
}
|