const getDataList = (str) => {
  let { pageSize, pageIndex, dataList, isListEmpty } = this.state
  // Taro.api.y.ordertradeindexlist().then(res => {
  Taro.api.base.test({
    pageIndex,
    pageSize,
  }).then(res => {
    const curData = res.data || []
    let isListEnd = false
    if (curData.length > 0) {
      dataList = dataList.concat(curData)
      if (res.pageSize && res.pageSize === pageSize) {
        isListEnd = false
      } else {
        isListEnd = true
      }
    }
    if (curData.length === 0 && pageIndex === 0) {
      isListEmpty = true
      dataList = []
    } else {
      isListEmpty = false
    }
    this.setState({
      dataList,
      isListEnd,
      isListEmpty,
      isListLoading: false
    })
  })
}
const onScrollToLower =  () => {
  let { isListEnd, isListLoading, pageIndex } = this.state
  if (!isListEnd && !isListLoading) {
    pageIndex++
    this.setState({
      pageIndex,
      isListLoading: true
    }, () => {
      this.getDataList()
    })
  }
}
// function withTest (Comp) {
//   return class extends Comp {
//     getDataList
//     onScrollToLower
//   }
// }
// @withTest