<template>
  <HeaderNav headerText="添加银行卡账号"></HeaderNav>
  <div class="add-zfb-account">
    <div class="account-item">
      <div class="item-title pf500 fs14 fc333333">持卡人姓名</div>
      <div class="left-input">
        <input
          type="text"
          class="input pf400 fs14 fc333333"
          placeholder="请输入"
          v-model="name" />
      </div>
    </div>
    <div class="account-item">
      <div class="item-title pf500 fs14 fc333333">手机号</div>
      <div class="left-input">
        <input
          type="text"
          class="input pf400 fs14 fc333333"
          placeholder="请输入"
          v-model="phone" />
      </div>
    </div>
    <div class="account-item">
      <div class="item-title pf500 fs14 fc333333">开户行</div>
      <div class="left-input">
        <input
          type="text"
          class="input pf400 fs14 fc333333"
          placeholder="请输入"
          v-model="bankOfDeposit" />
      </div>
    </div>
    <div class="account-item">
      <div class="item-title pf500 fs14 fc333333">银行卡号</div>
      <div class="left-input">
        <input
          type="text"
          class="input pf400 fs14 fc333333"
          placeholder="请输入"
          v-model="bankNumber" />
      </div>
    </div>
    <div class="submit pf600 fs14 fcFFFFFF" @click="submit">提交</div>
  </div>
</template>
<script setup>
  import HeaderNav from "../../../index/components/HeaderNav.vue";
  import { AddBankManager } from "@/api/otc";
  import { ref } from "vue";

  const name = ref();
  const phone = ref();
  const bankOfDeposit = ref();
  const bankNumber = ref();

  const submit = async () => {
    const params = {
      name: name.value,
      phone: phone.value,
      open_bank: bankOfDeposit.value,
      card_number: bankNumber.value,
    };
    const data = await AddBankManager(params);
    if (data) {
      // 差一个跳转到购买的页面
      console.log(data);
    }
  };
</script>
<style lang="less" scoped>
  .add-zfb-account {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    margin-top: 48px;
    width: 100%;

    .account-item {
      margin-top: 14px;
      width: 345px;

      .left-input {
        width: 345px;
        height: 45px;

        .input {
          padding-left: 11px;
          margin-top: 5px;
          width: 100%;
          height: 100%;
          box-sizing: border-box;
          border-radius: 6px;
          border: none;
          outline: none;
          background: #f5f5f5;
        }
      }
    }

    .submit {
      margin-top: 264px;
      width: 311px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      border-radius: 100px;
      background: #df384c;
      letter-spacing: 0.2px;
    }
  }
</style>
