<template>
  <scroll-view class="scroll-Y" scroll-y>
<!--    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>-->

    <div>
      <div class="choose-invoice-header" v-if="list.length">
        <van-radio-group class="radios">
          <div
            class="uni-list-cell uni-list-cell-pd radio-label lines"
            v-for="(item, index) in list"
            :key="index"
          >
            <div
              class="invoice-header-info"
              @click="chooseHeader(item, index)"
            >
              <!-- <div><radio :value="item.id" :checked="index === current" /></div> -->
              <div class="invoice-header-text">
                <div class="invoice-header-name">
                  <div class="invoice-header-name-text">
                    {{ item.titleName
                    }}<span class="isDefault" v-if="item.defaultOrNot"
                  >默认</span
                  >
                  </div>
                  <div class="invoice-header-name-icon">
                    <div
                      class="edit-header"
                      @click.stop="changeHeader('edit', item.id, item)"
                    >
                      <img
                        class="invoice-header-arrow"
                        :src="editwIcon"
                        mode="widthFix"
                      />
                    </div>
                    <div class="edit-header" @click.stop="delHeader(item.id)">
                      <img
                        class="invoice-header-arrow"
                        :src="delwIcon"
                        mode="widthFix"
                      />
                    </div>
                  </div>
                </div>
                <div class="duty-paragraph" v-if="item.invoiceTitleType === 'COMPANY'">
                  税号 {{ item.taxNo }}
                </div>
              </div>
            </div>
          </div>
        </van-radio-group>
      </div>
      <div class="choose-invoice-header noData" v-else>
        <div style="height: 30px"></div>
        <img class="noDataImg" :src="noDataIcon" mode="widthFix" />
        <div class="">您还没添加发票抬头</div>
      </div>
    </div>
    <div class="footer">
      <div
        :class="{
          'push-again-btn': true,
          'blue-push-again-btn': custTypeId === 1,
          'green-push-again-btn': custTypeId === 2,
        }"
        @click="changeHeader('add')"
      >添加抬头</div
      >
    </div>
  </scroll-view>
</template>

<script>
import parkingChooseHeaderJs from '../../../mixins/parkingReceipt/parkingChooseHeader';

export default {
  mixins: [parkingChooseHeaderJs],
};
</script>

<style lang="less" scoped>
//@import '../../../styles/common.less';
.scroll-Y {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f2f2f2;
  .choose-invoice-header {
    padding: 20px 30px;
    .radios {
      width: 100%;
      .radio-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-radius: 10px;
        background-color: #ffffff;
        margin-bottom: 20px;
        .invoice-header-info {
          flex: 1;
          display: flex;
          justify-content: flex-start;
          align-items: center;
          .invoice-header-text {
            width: 100%;
            padding: 0 20px;
            .invoice-header-name {
              color: #333333;
              padding: 20px 0;
              border-bottom: 2px solid #f8f8f8;
              display: flex;
              justify-content: space-between;
              align-items: center;
              .isDefault {
                color: #8cc63f;
                border: 2px solid #8cc63f;
                margin-left: 16px;
                border-radius: 20px;
                padding: 0 10px;
              }
              .invoice-header-name-icon {
                width: 100px;
                display: flex;
                align-items: center;
                justify-content: space-around;
                .invoice-header-arrow {
                  width: 30px;
                }
              }
            }
          }
          .duty-paragraph {
            color: #6f6f70;
            padding: 20px 0;
          }
        }
        .invoice-header-icon {
          width: 100px;
          display: flex;
          align-items: center;
          justify-content: space-around;
          .invoice-header-arrow {
            width: 30px;
          }
        }
      }
    }
  }
  .noData {
    position: relative;
    top: 80%;
    transform: translateY(-50%);
    color: #cccccc;
    text-align: center;
    .noDataImg {
      width: 200px;
      margin-bottom: 20px;
    }
  }
  .footer {
    width: 100%;
    background-color: #ffffff;
    position: fixed;
    bottom: 0;
    box-shadow: 0 0 10px 0 hsla(0, 6%, 58%, 0.6);
    -webkit-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
    -moz-box-shadow: 0 0 20px 0 hsla(0, 6%, 58%, 0.6);
    // padding-bottom: constant(safe-area-inset-bottom);
    // padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: 20px;
    .push-again-btn {
      margin: 20px 60px;
      color: #ffffff;
      background-image: linear-gradient(to right, #7d4ea1, #40397c);
      border-radius: 50px;
      text-align: center;
      padding: 20px 0;
    }
    .blue-push-again-btn {
      .color-background-color('blue');
    }
    .green-push-again-btn {
      .color-background-color('green');
    }
  }
  .lines {
    border-bottom: 2px solid #ececec;
  }
  
  
}
</style>
