import React, { useState } from 'react'
import ActivityListItem from '@/components/ActivityListItem/index'
import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
import '@/assets/css/reset.less'
import '@/assets/css/iconfont.less'
import './index.less'

export default function WoDeHuoDong (props) {

  const [PageList, setPageList] = useState([])

  const Refresh = (e) => { // 下拉刷新
    setPageList(e)
  }

  const Push = (e) => { // 上拉加载
    setPageList(PageList.concat(e))
  }
  

  return (
    <view className='WoDeHuoDong'>
      <ScrollPageRefresh ApiName={`getActivityList`} RequestParams={{ mine: 1 }} Refresh={Refresh} Push={Push}>
        <view className='Content Activity'>
          {
            PageList.map((item, index) => (
              <view className='ListItem' key={`ActivityItem-${index}`}>
                <ActivityListItem Data={item}></ActivityListItem>
              </view>
            ))
          }
        </view>
      </ScrollPageRefresh>
    </view>
  )
}
