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

    <view class="part" v-if="header.invoiceTitleType === 0">
      <view class="part-item">
        <text class="part-item-key">抬头类型</text>
        <view class="part-item-value">单位</view>
      </view>
      <view class="part-item">
        <text class="part-item-key">抬头名称</text>
        <text class="part-item-value">{{ header.invoiceTitleName }}</text>
      </view>

      <view class="part-item">
        <text class="part-item-key">公司税号</text>
        <text class="part-item-value">{{ header.corporationTax }}</text>
      </view>
      <view class="part-item">
        <text class="part-item-key">公司地址</text>
        <text class="part-item-value">{{ header.companyAddress }}</text>
      </view>
      <view class="part-item">
        <text class="part-item-key">公司电话</text>
        <text class="part-item-value">{{ header.companyTel }}</text>
      </view>
      <view class="part-item">
        <text class="part-item-key">开户银行</text>
        <text class="part-item-value">{{ header.depositBank }}</text>
      </view>
      <view class="part-item">
        <text class="part-item-key">开户账户</text>
        <text class="part-item-value">{{ header.accountNumber }}</text>
      </view>
    </view>
    <view class="part" v-else>
      <view class="part-item">
        <text class="part-item-key">抬头类型</text>
        <view class="part-item-value">个人/非企业单位</view>
      </view>
      <view class="part-item">
        <text class="part-item-key">抬头名称</text>
        <text class="part-item-value">{{ header.invoiceTitleName }}</text>
      </view>
    </view>
  </scroll-view>
</template>

<script>
const app = getApp();
export default {
  data() {
    return {
      header: {},
    };
  },
  onLoad(options) {
    this.header = JSON.parse(options.header);
    console.log('获取的发票信息', this.header);
  },
};
</script>

<style lang="less" scoped>
.scroll-Y {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f2f2f2;
  padding: 20rpx;
  box-sizing: border-box;
  .part {
    background-color: #ffffff;
    padding: 0 30rpx;
    border-radius: 20rpx;
    .part-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20rpx 0;
      box-sizing: border-box;
      .part-item-key {
        color: #4c4c4d;
      }
      .part-item-value {
        color: #6f6f70;
        text-align: right;
        display: flex;
        align-items: center;
        > image {
          width: 30rpx;
        }
      }
    }
  }
}
</style>
