<template>
  <div class="financial-container">
    <!-- 导航栏 -->
    <div class="nav-bar">
      <div class="back-btn" @click="$router.back()">
        <i class="arrow-left"></i>
      </div>
      <div class="title">提升额度</div>
    </div>
    <!-- 页面内容 -->
    <div class="content">
      <div class="wrap">
        <div class="card-list">
          <div v-for="(card, index) in cards" :key="index" class="card-col">
            <div class="card-item">
              <div class="card-image">
                <img src="@/assets/card.jpg" alt="信用卡" draggable="false">
              </div>
              <div class="card-info">
                <div class="limit-text">额度 {{ card.limit }}</div>
                <button class="upgrade-button" @click="handleUpgrade(card)">立即提升</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Financial',
  data() {
    return {
      cards: [
        { limit: '100 万', amount: 310 },
        { limit: '300 万', amount: 620 },
        { limit: '500 万', amount: 930 },
        { limit: '1000 万', amount: 1240 },
        { limit: '2000 万', amount: 1550 },
        { limit: '2000万以上', amount: 1860 }
      ]
    }
  },
  methods: {
    handleUpgrade(card) {
      this.$router.push({
        path: '/charges',
        query: {
          type: '4',
          money: card.amount,
          title: '到账额度提升'
        }
      });
    }
  }
}
</script>

<style scoped>
.financial-container {
  min-height: 100vh;
  background: url('../assets/xiaobh.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.nav-bar {
  height: 44px;
  background-color: #ed4b39;
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 15px;
}

.back-btn {
  width: 24px;
  height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.arrow-left {
  width: 12px;
  height: 12px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 500;
}

.content {
  padding: 15px;
  min-height: calc(100vh - 44px);
}

.wrap {
  padding: 10px;
}

.card-list {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px;
}

.card-col {
  width: 50%;
  padding: 4px;
  box-sizing: border-box;
}

.card-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-image {
  width: 100%;
  height: 0;
  padding-bottom: 60%;
  position: relative;
  overflow: hidden;
}

.card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info {
  padding: 12px;
  text-align: center;
}

.limit-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 12px;
  font-weight: bold;
}

.upgrade-button {
  background: #ed4b39;
  color: #fff;
  border: none;
  border-radius: 20px;
  width: 80%;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  cursor: pointer;
  margin: 0 auto;
  display: block;
}

.upgrade-button:active {
  opacity: 0.9;
}
</style>
