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

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

  return (
    <view className='components MyActivityListItem' onClick={() => { Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${Data.id}&eventType=${Data.type || 'dymic'}` }) }}>
      <view className='Img'>
        <Image mode='aspectFill' className='centerLabel' src={getImgURL(Data.listImgUrl) || null} />
      </view>
      <view className='Info'>
        <text className='Name'>{Data.title}</text>
        <text className='Address'>{Data.address}</text>
        <text className='Time'>活动时间：{formatDate(Data.startDate, 'yyyy-MM-dd hh:mm:ss')} - {formatDate(Data.endDate, 'yyyy-MM-dd hh:mm:ss')}</text>
      </view>
    </view>
  )
}
