<template>
  <view>
    <view class="invitation_title"> 发票信息 </view>

    <view class="form_card_box">
      <hs-cell title="抬头类型" required>
        <hs-radio :Enums="InvoiceTypeEnum" v-model:valueModel="formData.type" required />
      </hs-cell>
      <template v-if="formData?.type === 1">
        <hs-cell title="企业名称" required borderTop>
          <hs-input v-model:valueModel="formData.name" textAlign="right" />
        </hs-cell>
        <hs-cell title="纳税人识别号" required borderTop>
          <hs-input v-model:valueModel="formData.no" textAlign="right" />
        </hs-cell>
      </template>
      <template v-if="formData?.type === 2">
        <hs-cell title="发票抬头" required borderTop>
          <hs-input v-model:valueModel="formData.name" textAlign="right" />
        </hs-cell>
      </template>
      <hs-cell title="手机号" required borderTop>
        <hs-input
          v-model:valueModel="formData.phone"
          placeholder="非常重要！接收开票进度信息"
          textAlign="right"
        />
      </hs-cell>
      <hs-cell title="电子邮箱" required borderTop>
        <hs-input
          v-model:valueModel="formData.email"
          placeholder="接收电子发票的邮箱"
          textAlign="right"
        />
      </hs-cell>
      <hs-cell title="备注说明" borderTop>
        <hs-input v-model:valueModel="formData.des" textAlign="right" />
      </hs-cell>
    </view>

    <view class="form_card_box">
      <hs-cell title="设为默认">
        <switch color="#0082FA" style="transform: scale(0.7)" />
      </hs-cell>
    </view>

    <hs-footer btnParimaryName="确定" @handleParmaryClick="handleAdd()" />
  </view>
</template>
<script setup lang="ts">
import { ref } from 'vue'

const formData = ref<any>({ type: 1 })
const InvoiceTypeEnum = {
  1: { text: '企业', value: 1 },
  2: { text: '个人', value: 2 }
}

const handleAdd = () => {
  uni.showModal({
    title: '提示',
    content: '当前项目暂未开放！',
    success: function (res) {
      if (res.confirm) {
        console.log('用户点击确定')
      } else if (res.cancel) {
        console.log('用户点击取消')
      }
    }
  })
}
</script>
<style lang="scss">
@import './style.scss';
</style>
