<template>
  <div class="medical-page">
    <!-- 页面头部 -->
    <div class="page-header">
      <h2 class="page-title">红旗资本原始股</h2>
      <p class="page-subtitle">优质投资机会，稳健收益保障</p>
    </div>

    <!-- 原始股计划列表 -->
    <div class="plans-section">
      <div class="section-title">原始股投资计划</div>
      <div class="plans-list">
        <div
          class="plan-card"
          v-for="(item, index) in rewards"
          :key="item.id"
        >
          <div class="plan-header">
            <h4 class="plan-title">{{ item.title }}</h4>
            <div class="stock-badge">获得{{ index + 1 }}万原始股</div>
          </div>
          <div class="plan-body">
            <div class="plan-metrics">
              <div class="metric-item primary">
                <div class="metric-value">{{ item.power }}%</div>
                <div class="metric-label">每日收益</div>
              </div>
              <div class="metric-item">
                <div class="metric-value price">{{ item.money }}元</div>
                <div class="metric-label">投资金额</div>
              </div>
            </div>
            <button class="purchase-btn" @click="toPayment(item)">
              立即抢购
            </button>
          </div>
        </div>
      </div>
    </div>

    <!-- 投资说明区域 -->
    <div class="info-section">
      <div class="info-card">
        <div class="info-header">
          <h3>投资说明</h3>
        </div>
        <div class="info-content">
          <div class="info-item">
            <span class="info-icon">📈</span>
            <span class="info-text">红旗资本原始股为优质投资标的</span>
          </div>
          <div class="info-item">
            <span class="info-icon">🔒</span>
            <span class="info-text">投资安全有保障，收益稳定可靠</span>
          </div>
          <div class="info-item">
            <span class="info-icon">💰</span>
            <span class="info-text">每日按比例分配收益，透明公开</span>
          </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>
.medical-page {
  min-height: 100vh;
  background: linear-gradient(to bottom, #2f9580 0%, #4fb3a1 100%);
  padding: 20px 16px 80px;
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 24px;
  text-align: center;
}

.page-header .page-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

.page-header .page-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin: 0;
  font-weight: 500;
}

.plans-section {
  margin-bottom: 24px;
}

.plans-section .section-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-left: 8px;
  position: relative;
}

.plans-section .section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: #ffffff;
  border-radius: 2px;
}

.plans-section .plans-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.plan-card .plan-header {
  background: linear-gradient(135deg, #2f9580 0%, #4fb3a1 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-card .plan-header .plan-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.plan-card .plan-header .stock-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.plan-card .plan-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.plan-metrics {
  display: flex;
  gap: 32px;
  flex: 1;
}

.plan-metrics .metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.plan-metrics .metric-item.primary .metric-value {
  color: #dc2626;
  font-size: 24px;
  font-weight: 700;
}

.plan-metrics .metric-item .metric-value {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.plan-metrics .metric-item .metric-value.price {
  color: #2f9580;
  font-size: 17px;
  font-weight: 700;
}

.plan-metrics .metric-item .metric-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.purchase-btn {
  padding: 12px 20px;
  background: #2f9580;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.purchase-btn:hover {
  background: #268371;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 149, 128, 0.3);
}

.info-section .info-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-section .info-card .info-header {
  background: linear-gradient(135deg, #f8fffe 0%, #f0fdfb 100%);
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.info-section .info-card .info-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2f9580;
  margin: 0;
}

.info-section .info-card .info-content {
  padding: 20px;
}

.info-section .info-card .info-content .info-item {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.info-section .info-card .info-content .info-item:last-child {
  margin-bottom: 0;
}

.info-section .info-card .info-content .info-item .info-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.info-section .info-card .info-content .info-item .info-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .medical-page {
    padding: 16px 12px 80px;
  }
  
  .page-header .page-title {
    font-size: 20px;
  }
  
  .page-header .page-subtitle {
    font-size: 13px;
  }
  
  .plan-card .plan-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .plan-card .plan-header .plan-title {
    font-size: 15px;
  }
  
  .plan-card .plan-header .stock-badge {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .plan-card .plan-body {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .plan-card .plan-body .purchase-btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  .plan-metrics {
    justify-content: space-around;
    gap: 16px;
  }
  
  .plan-metrics .metric-item.primary .metric-value {
    font-size: 20px;
  }
  
  .plan-metrics .metric-item .metric-value {
    font-size: 16px;
  }
  
  .plan-metrics .metric-item .metric-value.price {
    font-size: 15px;
  }
  
  .plan-metrics .metric-item .metric-label {
    font-size: 11px;
  }
  
  .info-section .info-card .info-header {
    padding: 12px 16px;
  }
  
  .info-section .info-card .info-header h3 {
    font-size: 15px;
  }
  
  .info-section .info-card .info-content {
    padding: 16px;
  }
  
  .info-section .info-card .info-content .info-item {
    margin-bottom: 12px;
  }
  
  .info-section .info-card .info-content .info-item .info-icon {
    font-size: 18px;
    margin-right: 10px;
    width: 20px;
  }
  
  .info-section .info-card .info-content .info-item .info-text {
    font-size: 13px;
  }
}
</style> 