initiate_1.html 4.0 KB
{extend name="layout/default"}
{block name="title"}发起招聘{/block}
{block name="title1"}{/block}
{block name="content"}
    <div class="main">
        <!-- 当前位置 -->
        <div class="backNav">
            <div class="backNav_Img"><img src="/static/image/icon14.png" alt=""></div>
            <div class="back_nav">
                <a href="/api/index/index">首页</a>
                <span>></span>
                <a href="/api/talent/index?pid=12">人才服务</a>
                <span>></span>
                <a href="">发布招聘</a>
            </div>
            <div class="backNav_Img2"><img src="/static/image/touxiang_img.png" alt=""></div>
        </div>
        <div class="tender_hairBox">
            <h1 class="tender_rTxt">发布招聘</h1>
            <div class="tender_rBox">
            <form id="form">

                    <div class="release_Li clearfix">
                        <label for=""><span>*</span>人才类型</label>
                        <select name="pid" id="pid" class="release_op">
                            <option value="">请选择类型</option>
                            {foreach($style as $p)}
                            <option value="{$p.id}">{$p.name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="release_Li clearfix">
                        <label for=""><span>*</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input type="text" name="title" class="release_input" placeholder="请输入标题">
                    </div>
                    <div class="release_Li clearfix">
                        <label for=""><span>*</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <textarea placeholder="请输入内容" name="content" id="" cols="30" rows="10" class="release_textarea"></textarea>
                    </div>
                    <div class="release_Li clearfix">
                        <label for=""><span>*</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                        <input type="hidden" class="release_input" name="image" id="image">
                        <div class="release_file">
                            <input type="file" name="file" onchange="sc(this)" value="">
                            <div class="release_fileImg"><img src="/static/image/icon20.png" alt=""></div>
                        </div>
                    </div>
            </form>
                <div class="release_btn">提交</div>
            </div>
        </div>

    </div>
    <script>
        $('.release_op').change(function () {
            $(this).css('color','black')
        });
        function sc(e){
            var data = new FormData($('#form')[0]);
            $.ajax({
                url: "/admin/ajax/upload",
                type: 'POST',
                data: data,
                dataType: 'JSON',
                cache: false,
                processData: false,
                contentType: false
            }).done(function(ret){
                if(ret['code']==1){
                    $("#image").val(ret.data.url);
                    $('.release_fileImg').find("img").attr('src',ret.data.url);
                    w('上传成功');
                }else{
                    w('上传失败');
                }
            });
        }
        $(".release_btn").on("click",function () {
            var data=$("#form").serialize();
            if($(".release_op  option:selected").text() == '请选择类型'){
                w('请选择岗位类型');
            }else if($('.release_input').val() == ''){
                w('请输入标题');
            }else if($('.release_textarea').val() ==''){
                w('请输入内容');
            }else if($('.release_file input').val() == ''){
                w('请选择文件');
            }else{
                ajax("/index/talent/initiate_1",data,"post",function (res) {
                    w(res.msg);
                },"");
            }
        })
    </script>
{/block}