<template>
  <view>
    <view class="card_form">
      <hs-cell
        title="房屋信息"
        required
        borderTop
        isLink
        :value="useModel?.formData?.value?.full_name"
        @click="method?.handleToSelectHouse"
      />
      <hs-cell title="装修类型" borderTop required>
        <hs-radio
          :Enums="RenovationAppliesTypeEnum"
          v-model:valueModel="useModel.formData.value.type"
          required
        />
      </hs-cell>
      <hs-cell title="办理类型" borderTop required>
        <hs-radio
          :Enums="RenovationAppliesProcessTypeEnum"
          v-model:valueModel="useModel.formData.value.process_type"
          required
        />
      </hs-cell>
    </view>
    <hs-footer btnParimaryName="下一步" @handleParmaryClick="method.handleSubmit" />
  </view>
</template>

<script setup lang="ts">
import { onShow, onUnload } from '@dcloudio/uni-app'
import method from './method'
import useModel from './model'
import { RenovationAppliesTypeEnum, RenovationAppliesProcessTypeEnum } from '@/gen/Enums'

onShow(() => {
  method?.init()
})
onUnload(() => {
  useModel.formData.value = {}
})
</script>

<style lang="scss">
@import './style.scss';
</style>
