import React, { useState, useEffect } from 'react' import Taro from '@tarojs/taro' import { View, Image, Input, Picker, LivePlayer } from '@tarojs/components' import request from '@/services/request' import './index.scss' import '../patrolView/index.scss' import patrolIcon from '../../static/img/patrolView/patrol.svg' import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg' import conserveIcon from '../../static/img/patrolView/conserve.svg' import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg' import chevronDown from '../../static/img/patrolView/chevron-down.png' import searchIcon from '../../static/img/patrolView/search.png' function Index() { const [isBus, setIsBus] = useState(true) const [filterText, setFilterText] = useState('') const [videoList, setVideoList] = useState([]) useEffect(() => { getVideoList() }, []) const getVideoList = () => { let nextVideoList = [] for (let i = 0; i < 10; i++) { nextVideoList.push({ title: '视频' + i, url: '链接' + i }) } setVideoList(nextVideoList) } const onTypeChange = bool => { setIsBus(bool) } const handleConfirm = e => { } const handleInput = e => { } return ( onTypeChange(true)}> 公交 onTypeChange(false)}> 道路 路段: {'请选择'} { videoList && videoList.map(v => { return ( {v.title} ) }) } ) } export default Index