<!--pages/invoicing/index.wxml-->
<navigator title="发票开具" canBack="{{true}}" />
<view class="info">
  <view class="money"> 发票金额：<text class="moneyNumber"> ￥ {{money}} </text>  </view>
  <view class="content">发票内容：<text class="contentText">电费</text> </view>
</view>
<view>
  <card title="发票类型">
    <van-radio-group disabled="{{true}}"  direction="horizontal" slot="content" value="{{detail.type}}">
      <van-radio name="{{0}}" icon-size="30rpx" style="font-size: 32rpx;margin-bottom: 20rpx;">普通发票</van-radio>
      <van-radio name="{{1}}" icon-size="30rpx" style="font-size: 32rpx;">增值税专用发票</van-radio>
    </van-radio-group>
  </card>
</view>
<view class="cardWrapper">
  <card title="发票详情">
    <view  slot="content">
      <van-field
        value="{{ detail.name }}"
        label="抬头类型"
        border="{{ false }}"
        readonly
        title-width="132rpx"
      >
        <view slot="input" style="margin-top: 16rpx;">
          <van-radio-group disabled="{{true}}"  direction="horizontal" value="{{detail.headerType}}">
            <van-radio name="{{0}}" icon-size="30rpx" style="font-size: 30rpx;margin-bottom: 20rpx;">企业单位</van-radio>
            <van-radio name="{{1}}" icon-size="30rpx" style="font-size: 30rpx;">个人/非企业单位</van-radio>
          </van-radio-group>
        </view>
      
      </van-field>
      <van-field
        wx:if="{{detail.headerType === 0}}"
        value="{{ detail.name }}"
        label="发票抬头"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.tin }}"
        wx:if="{{detail.headerType === 0}}"
        label="发票税号"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.bank }}"
        wx:if="{{detail.headerType === 0}}"
        label="开户行"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.account }}"
        wx:if="{{detail.headerType === 0}}"
        label="银行账号"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.address }}"
        wx:if="{{detail.headerType === 0}}"
        label="地址"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.phone }}"
        wx:if="{{detail.headerType === 0}}"
        label="手机号"
        readonly
        title-width="132rpx"
        disabled="{{true}}"
      />
      <van-field
        value="{{ detail.remark }}"
        label="备注说明"
        title-width="132rpx"
        bind:change="changeRemark"
      />
    </view>
    
  </card>
</view>
<view class="content">

</view>
<view class="submit">
  <van-button type="info" block bind:click="changeShow"> 立即申请 </van-button>
</view>

<van-dialog
  use-slot
  title="确认开具"
  show="{{ show }}"
  show-cancel-button
  bind:confirm="onSubmit"
>
  <view class="modalContentWrapper">
    <van-field
      value="{{ detail.name }}"
      label="发票抬头"
      readonly
      type="textarea"
      autosize="{{true}}"
      title-width="132rpx"
      border="{{false}}"
    />
    <van-field
      value="{{ money }}"
      label="发票金额"
      readonly
      title-width="132rpx"
      border="{{false}}"
    />
    <van-field
      value="{{ detail.type === 0 ? '普通发票' : '增值税专用发票' }}"
      label="发票类型"
      readonly
      title-width="132rpx"
      border="{{false}}"
    />
    <van-field
      value="{{ detail.email }}"
      label="邮箱地址"
      readonly
      title-width="132rpx"
      type="textarea"
      autosize="{{true}}"
      border="{{false}}"
    />
  </view>
 
</van-dialog>