🐞 fix(ID1001592): 【内部小程序】- 搜索不出内容,需要重新退出进去才能搜索到。

【【内部小程序】- 搜索不出内容,需要重新退出进去才能搜索到。】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001592
This commit is contained in:
xuan 2023-03-23 16:52:21 +08:00
parent 7afb11bc74
commit fab0652997
3 changed files with 10 additions and 13 deletions

View File

@ -95,7 +95,7 @@ const Search = (
customStyle={{ width: '100%' }}
/>
<View className={styles.search_closeBtn}>
{!!inputCon && <CloseBtn onClose={() => clearInput()} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />}
{!!inputCon && <CloseBtn onClose={clearInput} styleObj={{ width: '20rpx', height: '20rpx', backgroundColor: '#fff', border: '0' }} />}
</View>
{showScan && (
<View

View File

@ -10,7 +10,6 @@ page {
font-size: 28px;
color: #000000;
margin-left: 32px;
margin-right: 32px;
}
.line {

View File

@ -302,21 +302,19 @@ const SearchPage = () => {
// 输入了搜索关键字
const getSearchData = useCallback((e) => {
if (e) {
setHasFonts(true)
getProduct(e)
}
else {
if (!e) {
setHasFonts(false)
setSearchList([])
}
setdefaultvalue(e)
}, [])
// 返回
const back = () => {
Taro.navigateBack({
delta: 1,
})
// 搜索
const onSearch = () => {
if (defaultvalue) {
setHasFonts(true)
getProduct(defaultvalue)
}
}
// 判断是否整数类型
function isInteger(obj) {
@ -420,7 +418,7 @@ const SearchPage = () => {
<View className={styles.main}>
<View className={styles.topBox}>
<Search placeholder="请输入搜索布料" defaultValue={defaultvalue} showBtn={false} changeOnSearch={getSearchData} >
<View className={styles.cancelFont} onClick={() => back()}></View>
<View className={styles.cancelFont} onClick={onSearch}></View>
</Search>
</View>
<View className={styles.line}></View>