<template>
  <div class="usremei-container">
    <div class="invite-header">
      红旗资本原始股
    </div>
    <div class="invite-list">
      <div class="invite-item" v-for="(item,index) in rewards" :key="item.id">
        <div class="item_header">
            <div class="title">{{ item.title }}</div>
            <div class="titletwo">获得{{index +1}}万原始股</div>
        </div>
        <div class="item_body">
            <div class="body_left">
                <div class="bodt_one">{{item.power}}%</div>
                <div class="bodt_two">每日收益</div>
            </div>
            <div class="body_right">
                <div class="bodt_one">{{item.money}}元</div>
            </div>
            <div class="body_btn" @click="toPayment(item)">立即抢购</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getMiner} from '@/api/home.js'

export default {
  name: 'Dynamic',
  data() {
    return {
      rewards: [{},{},{},{}]
    }
  },
  methods: {
     getPlans(){
      let data = {
        page:'',
        size:'',
        type:1
      }
      getMiner(data).then(res=>{
        if(res.code === 1){
          this.rewards = res.data
        }
      })
    },
     toPayment(item){
            this.$router.push({path:'/Payment',query:{item:item}});
    }
  },
  mounted(){
    this.getPlans()
  }
}
</script>

<style scoped>
.usremei-container {
  min-height: 100vh;
  background-image: url('../assets/dabag.png');
  background-size: cover;
  background-position: center;
  padding-top: 60px;
  padding-bottom: 80px;
  box-sizing: border-box;
  overflow-y: auto;
  position: relative;
}

.invite-header {
  background: #ffeddf;
  color: #f11859;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin: 0 auto 30px auto;
  padding: 20px 0 10px 0;
  width: 90%;
  box-shadow: 0 4px 16px rgba(208,2,27,0.08);
  letter-spacing: 2px;
}

.invite-list {
  width: 90%;
  margin: 0 auto;
}

.invite-item {
  margin-bottom: 22px;
  width:100%;
  height:88px;
  background:#fff;
}
.item_header{
    height:30px;
    line-height:30px;
    background:#a30100;
    display:flex;
    color:#fff;
    font-size:14px;
}
.title{
    margin-left:20px;
}
.titletwo{
    margin-left:65px;
}
.item_body{
    padding:8px 20px;
    display:flex;
    justify-content: space-between;
    text-align:center;
    align-items: center;
}
.bodt_two{
    margin-top:4px;
}
.body_btn{
    width:60px;
    height:20px;
    background:#a30100;
    color:#fff;
    font-size:12px;
    text-align:center;
    line-height:20px;
    border-radius:12px;
    padding:2px 4px;
    
}
</style> 