import Taro from '@tarojs/taro'
import { getImgURL } from '@/utils/image'
import { Image } from '@tarojs/components'
import './index.scss'

export default function VideoListItem (props) {
  const { Data = {} } = props

  const toDetail=()=>{
    console.log(Data,'------------')
    if(Data.type=='video'){
      Taro.navigateTo({ url: `/pages/video/videoDetail/index?id=${Data.id}` })
    }else{
      Taro.navigateTo({ url: `/pages/video/liveDetail/index?id=${Data.id}` })
    }
    // 
  }
  // onClick={()=>{}
  return (
    <view className='components VideoListItem' onClick={()=>toDetail()}>
      <view className='Img'>
        <view>
          <Image mode='aspectFill' className='centerLabel' src={getImgURL(Data.images) || null} />
        </view>
      </view>
      <view className='Title'>
        <text>{Data.title}</text>
      </view>
      <view className='Location flex-h'>
        <text className='iconfont icon-dingwei'></text>
        <view className='flex-item'>
          <view>
            <text>{Data.buildingName}</text>
          </view>
        </view>
      </view>
    </view>
  )
}
