import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import './index.scss'
import RaiseCard from '../../components/RaiseCard'
import { queryRaiseDetail } from '@/services/project'

export default class HouseResource extends Component {
  config = {
    navigationBarTitleText: '房源清单'
  }
  state = {
    houseList: [],
  }

  componentWillMount() {
    const { raiseRecordId } = this.$router.params
    queryRaiseDetail(raiseRecordId).then(res => {
      this.setState({
        houseList: res.houseList || [],

      })
    })
  }
  render() {
    const { houseList } = this.state
    return (
      <View style="padding-top:30rpx">
        {
          houseList.map(item => (
            <View key={item.raiseRecordId} >
              <RaiseCard type="houseResource" summary={item} />
            </View>
          )
          )
        }
      </View>
    )
  }

}
