<template>
  <div class="china-page">
    <!-- 页面头部 -->
    <div class="page-header">
      <h2 class="page-title">红旗资本医疗补贴</h2>
      <p class="page-subtitle">（每份收益三年）</p>
    </div>

    <!-- 政策说明区域 -->
    <div class="policy-section">
      <div class="policy-card">
        <div class="policy-header">
          <h3>国务院国资委帮扶政策</h3>
        </div>
        <div class="policy-content">
          国务院国资委帮扶完成指标，医疗补贴(或称医疗补助，医疗救助)，是国家或地方政府为减轻低收入人口的医疗费用负担，在基本医疗保险的基础上，提供的额外经济支持。
        </div>
      </div>
    </div>

    <!-- 团队返佣区域 -->
    <div class="commission-section">
      <div class="commission-card">
        <div class="commission-header">
          <h3>团队返佣政策</h3>
        </div>
        <div class="commission-content">
          <div class="commission-list">
            <div class="commission-item">
              <span class="level">一级</span>
              <span class="rate">5%</span>
            </div>
            <div class="commission-item">
              <span class="level">二级</span>
              <span class="rate">2%</span>
            </div>
            <div class="commission-item">
              <span class="level">三级</span>
              <span class="rate">1%</span>
            </div>
          </div>
        </div>
      </div>
    </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="subsidy-badge">获得{{ (index + 1) * 10 }}万元医疗补贴</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">10000份</div>
              </div>
            </div>
            <button class="purchase-btn" @click="toPayment(item)">
              立即抢购
            </button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'China',
  data() {
    return {
      rewards: [
        {
          id: 1,
          title: '初级医疗补贴',
          money: '30000',
          power: '10'
        },
        {
          id: 2,
          title: '一级医疗补贴',
          money: '60000',
          power: '10'
        },
        {
          id: 3,
          title: '二级医疗补贴',
          money: '100000',
          power: '10'
        },
        {
          id: 4,
          title: '三级医疗补贴',
          money: '200000',
          power: '10'
        }
      ]
    }
  },
  methods: {
    getPlans(){
      let data = {
        page:'',
        size:'',
        type:1
      }
      // 保持原有API调用逻辑
      console.log('API调用数据:', data)
      // 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>
.china-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-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

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

.policy-section, .commission-section {
  margin-bottom: 20px;
}

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

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

.policy-header h3, .commission-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2f9580;
  margin: 0;
}

.policy-content {
  padding: 16px 20px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  text-align: justify;
}

.commission-content {
  padding: 20px;
}

.commission-list {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.commission-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0fdfb 0%, #f8fffe 100%);
  border-radius: 8px;
  border: 1px solid #e0f2f1;
}

.level {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}

.rate {
  font-size: 18px;
  color: #2f9580;
  font-weight: 700;
}

.plans-section {
  
}

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

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

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

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

.subsidy-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-body {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

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

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

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

.metric-value.price {
  color: #2f9580;
  font-size: 17px;
  font-family: system-ui;
}

.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);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .china-page {
    padding: 16px 12px 80px;
  }
  
  .page-header .page-title {
    font-size: 20px;
  }
  
  .page-header .page-subtitle {
    font-size: 13px;
  }
  
  .policy-card .policy-header, 
  .commission-card .commission-header {
    padding: 12px 16px;
  }
  
  .policy-header h3, 
  .commission-header h3 {
    font-size: 15px;
  }
  
  .policy-content {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .commission-content {
    padding: 16px;
  }
  
  .commission-list {
    gap: 8px;
  }
  
  .commission-item {
    padding: 10px 12px;
  }
  
  .level {
    font-size: 12px;
  }
  
  .rate {
    font-size: 16px;
  }
  
  .plan-card .plan-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .plan-title {
    font-size: 15px;
  }
  
  .subsidy-badge {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .plan-body {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .purchase-btn {
    width: 100%;
    padding: 14px 20px;
  }
  
  .plan-metrics {
    justify-content: space-around;
    gap: 16px;
  }
  
  .metric-item.primary .metric-value {
    font-size: 20px;
  }
  
  .metric-value {
    font-size: 16px;
  }
  
  .metric-value.price {
    font-size: 15px;
  }
  
  .metric-label {
    font-size: 11px;
  }
}
</style> 