<route lang="yaml">
style:
  navigationBarBackgroundColor: '#fff'
  navigationBarTitleText: '推荐材料商'
</route>
<script setup lang="ts">
import DataForm from '@/components/data-form.vue'
import { useToast } from 'wot-design-uni'

const { success: showSuccess } = useToast()

const model = reactive<{
  value1: string
  value2: string
}>({
  value1: '',
  value2: '',
})
const form = ref()
const schema = {
  name: {
    type: 'TextField',
    label: '*材料商名称/品牌名称',
  },
  agentName: {
    type: 'TextField',
    label: '*对接人姓名',
  },
  agentPosition: {
    type: 'TextField',
    label: '*对接人职位',
  },
  agentPhone: {
    type: 'TextField',
    label: '*对接人电话',
  },
  submit: {
    type: 'Submit',
    label: '提交',
    // onSubmit: handleSubmit,
  },
}

function handleSubmit() {
  form.value
    .validate()
    .then(({ valid, errors }) => {
      if (valid) {
        showSuccess({
          msg: '校验通过',
        })
      }
    })
    .catch((error) => {
      console.log(error, 'error')
    })
}
</script>
<template>
  <div class="w-full px-3.5 bg-white">
    <!-- <LoginTest title="推荐材料"></LoginTest> -->
    <DataForm :schema="schema"></DataForm>
    <div
      class="w-[319px] h-[43px] text-center text-black/30 text-xs font-normal font-['PingFang SC'] leading-normal"
    >
      为满足筑巢荟设计师设计需求，各位设计师可向平台推荐优质服务材料商/施工队，平台优先进行洽谈和考核
    </div>
    <!-- <wd-form ref="form" :model="model" :isCell="false">
      <wd-cell-group border>
        <wd-input
          label="用户名"
          label-width="100px"
          prop="value1"
          clearable
          v-model="model.value1"
          placeholder="请输入用户名"
          :rules="[{ required: true, message: '请填写用户名' }]"
          :isCell="false"
        />
        <wd-input
          label="密码"
          label-width="100px"
          prop="value2"
          show-password
          clearable
          v-model="model.value2"
          placeholder="请输入密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
      </wd-cell-group>
      <view class="footer">
        <wd-button type="primary" size="large" @click="handleSubmit" block>提交</wd-button>
      </view>
    </wd-form> -->
  </div>
</template>
