
import '@/assets/css/iconfont.css'
import Taro from '@tarojs/taro'
import { useSelector } from 'react-redux'
import './index.scss'

export default function Location () {

  const city = useSelector(state => state.city)

  const ToLocation = () => {
    Taro.navigateTo({ url: `/pages/index/location/index` })
  }

  const ToSearch = () => {
    Taro.navigateTo({ url: `/pages/index/buildingList/index` })
  }

  return (
    <view className='components Location flex-h'>
      <text className='iconfont icon-dingwei' onClick={ToLocation}></text>
      <text onClick={ToLocation}>{city.curCity?.name || '正在定位'}</text>
      <text className='iconfont icon-jiantoudown' onClick={ToLocation}></text>
      <view className='flex-item'>
        <text className='iconfont icon-sousuo' onClick={ToSearch}></text>
        <text onClick={ToSearch}>输入你想查询的楼盘</text>
      </view>
    </view>
  )
}
