<template>
    <div class="page1">
        <NavBar :showIcon="true" :showTitle="true" title="岗位信息" backgroundBox="#FFFFFF"></NavBar>
        <div class="title1">填写企业信息</div>
        <div class="form">
            <formItem title="企业（单位）名称">
                <input type="text" v-model="pinias.formData.companyName" placeholder="请填写单位名称" />
            </formItem>
            <formItem title="单位联系人">
                <input type="text" v-model="pinias.formData.contactPerson" placeholder="请填写联系人" />
            </formItem>
            <formItem title="联系电话">
                <input type="text" v-model="pinias.formData.contactPhone" placeholder="请填联系电话" />
            </formItem>
            <formItem title="企业（单位）简介">
                <textarea type="text" v-model="pinias.formData.companyIntro" placeholder="请输入简介" />
            </formItem>
        </div>
        <wd-tabbar
            @tap="next"
            custom-style="display: flex;justify-content: center !important;z-index:1;"
            fixed
            placeholder
            safeAreaInsetBottom
        >
            <view class="footer"> <button class="foot-btn" @click="next">下一步</button></view>
        </wd-tabbar>
    </div>
</template>

<script setup>
import { ref } from "vue";
import formItem from "./formItem.vue";
import { useStore } from "./store";
const pinias = useStore();
onLoad(options => {
    pinias.setFormDataKey("articleId", options.articleId);
});
const next = () => {
    const { companyName, contactPerson, contactPhone, companyIntro } = pinias.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";
.page1 {
    background: #fff;
    box-sizing: border-box;
    padding: 0 32rpx;

    .title1 {
        padding: 32rpx 0;
        font-size: 48rpx;
        font-weight: normal;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        line-height: 54rpx;
        white-space: nowrap;
        color: #1b2026;
    }

    .foot-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 622rpx;
        height: 80rpx;
        color: #ffffff;
        background: #1f86ff;
        border-radius: 12rpx;
    }
}
textarea {
    width: 100%;
    height: 216rpx;
}
</style>
