import React, { useState, useEffect, useRef } from 'react' import Taro from '@tarojs/taro' import CustomNav from '@/components/CustomNav' import logo from '@/assets/icons/comm/logo_small.png' import withLayout from '@/layouts' import tabList from './tabbar' import Guide from './tabs/Guide' import Mine from './tabs/Mine' import Recommend from './tabs/Recommend' import './index.less' import { getLocation } from '@/utils/location' import { getIndexType, getResourceList } from '@/services/home' export default withLayout((props) => { const { router, person, location } = props const { params, path } = router const { tab } = params || {} const [currentTab, setCurrentTab] = useState(0) const handleTabChange = (e) => { const { index } = e.detail setCurrentTab(index) } useEffect(() => { if (tab) { setCurrentTab(tab - 0) } }, [tab]) return ( {currentTab === 0 && } {currentTab === 1 && } {/* {currentTab === 2 && } */} {currentTab === 2 && } ) })