import React, { useEffect, useMemo, useState } from 'react'
import Taro, { } from "@tarojs/taro";
import { useSelector } from 'react-redux'
import { View, Text, Image } from '@tarojs/components'
import Layout from '../../layout/index'
import ContainerLayout from '../../compents/container/index'
import usericon from '../../assets/usericon.png'
import editicon from '../../assets/editicon.png'
import upload from '../../assets/upload.png'
import menuicon from '../../assets/menuicon.png'

import './index.scss'
import { xor } from 'lodash';

const menuList = [{
  title: '民宿宿老板账号管理',
  icon: usericon,
  url: '/pages/account/index'
}, {
  title: '素材编辑与查询',
  icon: editicon,
  url: '/pages/material/index'
}, {
  title: '素材批量录入',
  icon: upload,
  url: '33'
}, {
  title: '素材标签管理',
  icon: menuicon,
  url: '/pages/label/index'
}]

const index = (props) => {

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

  const user = useSelector(state => state.user)
  const [isOpened, setIsOpened] = useState(false)
  const [userRole, setUserRole] = useState('1')
  const [pageState, setPageState] = useState('1')
  const [list, setList] = useState([])
  const [radioHouseData, setRadioHouseData] = useState()
  const [radioHouseState, setRadioHouseState] = useState(false)

  useEffect(() => {


  }, [])



  const handleClose = () => {
    setIsOpened(false)
  }
  const onTabClick = (e) => {
    console.log(e, '111')
    setUserRole(e)

  }

  const onRegisterChange = (e) => {
    console.log(e, '111')
  }
  const onClick = (row) => {


    Taro.navigateTo({ url: row.url })



  }


  return <View className='adminUser'>




    <Layout>
      {menuList.map((row) => {
        return <ContainerLayout className='adminUser-menu' onClick={() => onClick(row)}>
          <Text>{row.title}</Text>
          <View className='adminUser-menu-img' >
            <Image className='image' src={row.icon}></Image>
          </View>

        </ContainerLayout>
      })}
    </Layout>




  </View>
}

export default index