import { React, useState, useEffect, } from 'react' // .就是当前路径 import iconsearch from '../../assets/icons/housemantj/search.png' import CustomNav from '@/components/CustomNav' import Taro from '@tarojs/taro' import Card from '../index/components/Card' import { getResourceList } from '@/services/home' import List from '@/components/List'; import './searchResult.less' import withLayout from '@/layouts' export default withLayout((props) => { const { router, person, location } = props const { q } = props.router.params // 横向tab const [activeTab, setActiveTab] = useState(0) const [queryParams, setQueryParams] = useState({ q: q, location: location, pageNum: 1, pageSize: 10, typeId: '' }) // 获取资源表信息 const [alllist, setAllList] = useState([]) const tabs = [ { title: '全部', }, { title: '美食', }, { title: '景点', }, ] const handleTabChange = (e) => { const { index } = e.detail setActiveTab(index) if (index == 0) { setQueryParams({ q: q, location: location, pageNum: 1, pageSize: 10, typeId: '' }) } else if (index == 1) { setQueryParams({ q: q, targetType: 'shop', location: location, pageNum: 1, pageSize: 10, typeId: '' }) } else { setQueryParams({ q: q, targetType: 'tourist', location: location, pageNum: 1, pageSize: 10, typeId: '' }) } } const onSearch = () => { // 用绝对路径 Taro.navigateTo({ url: '/pages/search/search' }); } return ( { alllist.map((item) => ) } ) })