修复已知问题

This commit is contained in:
2025-08-07 20:36:07 +08:00
parent bf99796d8c
commit 5dd0e97e3c
24 changed files with 519 additions and 69 deletions

View File

@@ -2,7 +2,8 @@ import {Search} from '@nutui/icons-react-taro'
import {Button, Input} from '@nutui/nutui-react-taro'
import {useState} from "react";
import Taro from '@tarojs/taro';
function MySearch(props) {
function MySearch() {
const [keywords, setKeywords] = useState<string>('')
const onKeywords = (keywords: string) => {
@@ -10,14 +11,24 @@ function MySearch(props) {
}
const onQuery = () => {
if(!keywords){
if(!keywords.trim()){
Taro.showToast({
title: '请输入关键字',
icon: 'none'
});
return false;
}
props.done(keywords);
// 跳转到搜索页面
Taro.navigateTo({
url: `/shop/search/index?keywords=${encodeURIComponent(keywords.trim())}`
});
}
// 点击搜索框跳转到搜索页面
const onInputFocus = () => {
Taro.navigateTo({
url: '/shop/search/index'
});
}
@@ -40,6 +51,7 @@ function MySearch(props) {
value={keywords}
onChange={onKeywords}
onConfirm={onQuery}
onFocus={onInputFocus}
style={{ padding: '9px 8px'}}
/>
<div