<template>
    <div class="page">
        <div class="title">填写企业信息</div>
        <div class="form">
            <formItem title="企业（单位）名称">
                <input type="text" v-model="formData.companyName" placeholder="请填写单位名称" />
            </formItem>
            <formItem title="单位联系人">
                <input type="text" v-model="formData.contactPerson" placeholder="请填写联系人" />
            </formItem>
            <formItem title="联系电话">
                <input type="text" v-model="formData.contactPhone" placeholder="请填联系电话" />
            </formItem>
            <formItem title="企业（单位）简介">
                <textarea type="text" v-model="formData.companyIntro" placeholder="请输入简介" />
            </formItem>
        </div>
        <div class="footer">
            <button class="bottom-btn" @click="next">下一步</button>
        </div>
    </div>
</template>

<script setup>
import { ref } from "vue";
import formItem from "./formItem.vue";
import { useStore } from "./store";
const { formData, setFormDataKey } = useStore();
setFormDataKey("articleId", "580953961662623744");

const next = () => {
    const { companyName, contactPerson, contactPhone, companyIntro } = formData;
    if (companyName && contactPerson && contactPhone && companyIntro) {
        uni.navigateTo({
            url: "/pages/signUp/addPost"
        });
    } else {
        uni.showToast({
            title: "请填写完整信息",
            icon: "none"
        });
    }
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
textarea {
    width: 100%;
    height: 108px;
}
</style>
