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

export default function WuYeJiaoFei () {
  
  const [PageList, setPageList] = useState([])

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

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

  return (
    <view className='WuYeJiaoFei'>
      <ScrollPageRefresh ApiName={`getJiaoFeiList`} ListName={`list`} RequestUrlData={{ type: 0 }} Refresh={Refresh} Push={Push}>

        {/* 大图 */}
        <view className='BigImg'>
          <image mode='aspectFill' src={null} className='centerLabel'></image>
        </view>

        {/* 缴费列表 */}
        <view className='List'>
          {
            PageList.map((item, index) => (
              <view key={`WuYeJiaoFeiItem-${index}`}>
                <WuYeJiaoFeiItem Data={item}></WuYeJiaoFeiItem>
              </view>
            ))
          }
        </view>

      </ScrollPageRefresh>
    </view>
  )
}
