🌈 style:订单页搜索合成一个

This commit is contained in:
Haiyi
2022-09-26 19:05:42 +08:00
parent 113ac6b229
commit ba018b1d25
8 changed files with 69 additions and 55 deletions
+16 -2
View File
@@ -21,7 +21,9 @@ type Params = {
defaultValue?: string
children?: ReactNode
customRightSlot?: ReactNode
adjustPosition?: boolean
adjustPosition?: boolean,
showScan?: boolean
handScan?: () => void
}
export default memo(
@@ -30,7 +32,7 @@ export default memo(
{
clickOnSearch, //点击筛选按钮触发
changeOnSearch, //输入文字触发
adjustPosition=false,
adjustPosition = false,
disabled = false, //是否禁用
placeholder = '输入搜索内容',
showIcon = true, //是否显示关闭图标
@@ -42,6 +44,8 @@ export default memo(
defaultValue = '', //默认值
children,
customRightSlot,
showScan = false,
handScan
}: Params,
ref,
) => {
@@ -102,6 +106,16 @@ export default memo(
<View className={styles.search_closeBtn}>
{!!inputCon && <CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />}
</View>
{
showScan && <View onClick={() => {
handScan?.()
}}>
<IconFont
name={'icon-saomiao'} size={40}
></IconFont>
</View>
}
<View>{customRightSlot}</View>
</View>
</View>