'use strict';

import React, { Component } from 'react';
import resList from '../../resconfig/resList';

import './cominvitep.less';

class Cominvitep extends Component {
  constructor(props) {
    super(props);
    this.state = this.state || { resList: resList };
  }
  render() {
    const { inviteRecordList, onClose } = this.props;
    console.log('inviteRecordList=', inviteRecordList);
    /*
    userName	string	
    userId	number	
    avatar	string	
    bonus	number	
    inviteTime
    */
    return (
      <div className="invitep">
        <img className="inviteBg" />
        <img className="bj" src={this.state.resList['d90703c1-655e-4b42-9122-d8931c30d591'].url} />
        <img className="inviteh" src={this.state.resList['923fc6ea-34bb-4344-9918-45aa79a455b1'].url} />
        <div className="items">
          <img className="inviteb" src={this.state.resList['e4bacfdd-db1d-4ce6-bed7-9b01ac97f9db'].url} />
          <label className="user">用户</label>
          <label className="invitet">邀请时间</label>
          <label className="reward">获得奖励</label>
          <div className="inviteList">
            {/* className={index % 2 == 1 ? 'inviteSlot1' : 'inviteSlot2'} */}
            {inviteRecordList.map((item, index) => <p key={index} className={index % 2 == 1 ? 'inviteSlot1' : 'inviteSlot2'} >
              <label className="inviteName" >{item.userName}</label>
              <label className="inviteTime">{item.inviteTime}</label>
              <label className="inviteBonus">{item.bonus}</label>
            </p>
            )}
          </div>
        </div>
        {/* {arr.map((item, index) => <p key={index} className={index == 0 ? 'rankSlot0' : (index % 2 == 1 ? 'rankSlot1' : 'rankSlot2')}>
          {<label className="rankItems">{item.index}</label>}
          <label className="rankItems2">{item.nickname}</label>
          <label className="rankItems3">{item.score}</label>
        </p>)} */}



        <img className="invitec" onClick={onClose} src={this.state.resList['c9098829-9dc3-4561-887d-e2a9b3a60e43'].url} />
      </div>
    );
  }
}
export default Cominvitep;
