postjob.html 30.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_886149_x7uh64tifl.css">

    <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/weui.css"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/css/index.css">

    <title>我要兼职</title>
    <script type="text/javascript" src="__TMPL__/public/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/js/base.js"></script>
    <style>
        .weui-picker__item{
            font-size: 0.3rem;
        }
        .swiper-container,.swiper-wrapper,.swiper-slide{
            height:2.78rem;
        }
        .swiper-slide img{
            height:100%;
            width:100%;
        }
        .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction {
            bottom: 6px;
            left: 0;
            width: 100%;
        }
        .join{
            display:flex;
            height: 1rem;
            padding: 0 0.29rem;
            align-items: center;
            background: #F5F6FA;
            margin-top: 0.36rem;
        }
        #select{
            width:4rem;
            height:0.5rem;
            font-size: 0.3rem;
            background: transparent;
            margin-bottom: 1.1rem;
            border:none;
            outline: nones;
        }
        .list_attention{
            display:flex;
            justify-content: space-between;
            align-items: center;
        }
        .selsctoption{
            width: 4.5rem;

            color: #97A0A8;
            font-size: 0.26rem;
            height: 0.5rem;
            line-height: 0.5rem;
        }
        .listenter input{
            font-size: 16px;
            color: #5C5858;
        }
    </style>
</head>
<body>
<!--实名认证-->
<div class="registerwrapper" <eq name="final.is_check" value="1"> style="display: none" </eq>>
    <div class="registerpop">
        <div class="cloudhead">
            <p class="cloudone">
                <img src="__TMPL__/public/assets/images/aicon01@2x.png" alt="">
            </p>
            <p class="authrity">实名认证</p>
            <p class="cloudtwo">
                <img src="__TMPL__/public/assets/images/aicon02@2x.png" alt="">
            </p>
        </div>
        <div class="people">
            <p class="people_nameimg"><img src="__TMPL__/public/assets/images/aicon03@2x.png" alt=""></p>
            <p class="people_name">
                <input type="text" placeholder="姓名" class="peopelname">
            </p>
        </div>
        <div class="people">
            <p class="people_phoneimg"><img src="__TMPL__/public/assets/images/aicon04@2x.png" alt=""></p>
            <p class="people_phonename">
                <input type="text" placeholder="手机号" class="peopelphone">
            </p>
        </div>
        <div class="people">
            <p class="people_cardimg"><img src="__TMPL__/public/assets/images/aicon05@2x.png" alt=""></p>
            <p class="people_cardname">
                <input type="text" placeholder="身份证号" class="peopelcard">
            </p>
        </div>
        <div class="sub">提交</div>
    </div>
</div>

<!--联系客服-->
<div class="callTel" style="display: none">
    <div class="registerpop" style="width: 5.86rem;height: 3rem;">
        <div class="cloudhead" style="margin-top: 0.2rem; ">
            <p class="cloudone">
                <img src="__TMPL__/public/assets/images/aicon02@2x.png" alt="">
            </p>
            <p class="authrity">客服电话</p>
            <p class="cloudtwo">
                <img src="__TMPL__/public/assets/images/aicon01@2x.png" alt="">
            </p>
        </div>
        <a href="tel:{$final.tel}" class="call"><div style="margin-top: 8%; font-size: 0.5rem; color: #05A1E3;">{$final.tel}</div></a>


    </div>
</div>

<!--用户协议-->
<div class="workerwapper" style="display:none">
    <div class="worderpop">
        <div class="workerhead">
            {$final.art.title}
        </div>
        <div class="worktext">
            {$final.art.content}
        </div>
        <p class="agree">点击“同意”,即表示您同意上述内容。</p>
        <div class="agreebtn">
            <p class="cancel">取消</p>
            <p class="agreematerial">同意</p>
        </div>
    </div>
</div>

<!--提交审核之后的弹层-->
<div class="examinewrapper" style="display:none">
    <div class="examinepop">
        <div class="examine">
            <p class="waitexamine">您的申请已经提交,请等待审核</p>
            <p class="waitimg">
                <img src="__TMPL__/public/assets/images/aicon08@2x.png" alt="">
            </p>
        </div>

    </div>
</div>
<!--提交成功之后弹层-->
<div class="materialwrapper" <eq name="final.is_resume" value="0"> style="display: none" </eq>>
    <div class="materialpop">
        <p class="materialimg">
            <img src="__TMPL__/public/assets/images/bicon06@2x.png" alt="">
        </p>
        <div class="material_name">
            <eq name="final.is_resume" value="2">
            <p class="materialname">您已成功填写求职信息,请等待审核</p>

            </eq>
            <eq name="final.is_resume" value="3">
                <p class="materialname">您已成功填写求职信息,请在个人中心</p>
                <p class="materialname">
                    <a href="{:url('member/myresume')}" class="myresume">我的简历</a>
                    进行查看
                </p>
            </eq>
        </div>
    </div>
</div>
<div class="container">
    <!--<div class="head">-->
    <!--<img src="__TMPL__/public/assets/images/abanner@2x.png" alt="">-->
    <!--</div>-->

    <div class="head">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <volist name="final.banner" id="banner">
                    <div class="swiper-slide">
                        <a href="{$banner.link}">
                        <img src="{:cmf_get_image_url($banner.pic)}" alt="" >
                        </a>
                    </div>
                </volist>
            </div>
            <div class="swiper-pagination"></div>
        </div>
    </div>
    <div class="bad">

        <div class="position">
            <div class="sign">
                <img src="__TMPL__/public/assets/images/aicon09@2x.png" alt="">
            </div>
            <!--<p class="place">我的位置:</p>-->
            <input type="text" class="place" placeholder="我的位置" readonly style="background: transparent;">

            <input type="text" class="enterplace"  readonly>


        </div>


        <!--雇佣信息-->
        <div class="hire">
            <p class="hire_img">
                <img src="__TMPL__/public/assets/images/aicon06@2x.png" alt="">
            </p>
            <p class="hire_name">兼职信息</p>
            <p class="wire"></p>
        </div>

        <div class="list">
            <div class="list_name">微信号</div>
            <div class="listenter">
                <input type="text" placeholder="请输入您的微信号" class="wx" >
            </div>
        </div>
        <div class="list">
            <p class="list_name">年龄</p>
            <div class="listenter">
                <input type="text" placeholder="请输入您的年龄" class="age" >
            </div>
        </div>
        <div class="list_sex sexselect">

            <!--<div class="listenter">-->
            <!--<input type="text" placeholder="请输入雇主名称" >-->
            <!--</div>-->
            <div class="sex_name">
                <p class="list_sexname">性别</p>
                <p class="sexchose" style="font-size: 16px;color: #5C5858;">请选择</p>
            </div>

            <p class="row">
                <img src="__TMPL__/public/assets/images/bicon01@2x.png" alt="">
            </p>
        </div>

        <div class="list_sex seclectschool">

            <!--<div class="listenter">-->
            <!--<input type="text" placeholder="请输入雇主名称" >-->
            <!--</div>-->
            <div class="sex_name ">
                <p class="list_sexname">学历</p>
                <p class="sex" style="font-size: 16px;color: #5C5858;">请选择</p>
            </div>

            <p class="row">
                <img src="__TMPL__/public/assets/images/bicon01@2x.png" alt="">
            </p>
        </div>
        <div class="list">
            <p class="list_name">居住地址</p>
            <div class="listenter">
                <input type="text" placeholder="请填写您的居住地址" class="address" >
            </div>
        </div>

        <div class="list">
            <p class="list_name">赋闲时间</p>
            <div class="listenter">
                <input type="text" placeholder="请输入您的赋闲时间" class="free_time">
            </div>
        </div>

        <div class="list" >

            <div class="list_name">求职意向</div>
            <div class="listenter list_attention"  >
                <p class="selsctoption" style=" font-size: 16px;color: #5C5858;">请选择求职意向</p>
                <p class="row">
                    <img src="__TMPL__/public/assets/images/bicon01@2x.png" alt="">
                </p>
            </div>
        </div>

        <div class="skill">
            <div class="jobskillname">
                职业技能
            </div>
            <div class="skillist">
                <div class="skill_item " >
                    <!--<div class="skill_itemname">-->
                    <!--&lt;!&ndash;<p class="skill_itemtext">办公软件</p>&ndash;&gt;-->
                    <!--<input type="text" class="skill_itemtext skill1" placeholder="办公软件" >-->
                    <!--<p class="skill_itemimg deleteimg"><img src="__TMPL__/public/assets/images/bicon02@2x.png" alt=""></p>-->
                <!--</div>-->
                </div>
                <div class="addskill">
                    <input type="text" placeholder="请添加您的职业技能" class="enterskill skillCount" style=" font-size: 16px;color: #5C5858;">
                    <p class="addskillimg">
                        <img src="__TMPL__/public/assets/images/bicon03@2x.png" alt="">
                    </p>
                </div>
            </div>
        </div>

        <div class="work">
            <p class="workrequire">工作经历</p>
            <textarea name="" id="workrequire" cols="30" rows="5" placeholder="请输入您的工作经历" class="experience" style="resize: none; font-size: 16px;color: #5C5858;"></textarea>
            <div class="wordnum">
                <p class="before">0</p>
                <p class="line">/</p>
                <p class="after">500</p>
            </div>
        </div>

        <div class="uploadpic">
            <p class="uploadcard">上传身份证正反面照片</p>
            <div class="uploadcardimg">
                <div class="front">
                    <!--<p class="uploadimg">-->
                    <!--<img src="__TMPL__/public/assets/images/bicon04@2x.png" alt="">-->
                    <!--</p>-->

                    <div id="preview" class="uploadimg">
                        <img id="imghead" border="0" src="__TMPL__/public/assets/images/bicon04@2x.png" style="width:100%;height:100%" onclick="$('#previewImg').click();">
                    </div>
                    <!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
                    <input type="file" onchange="previewImage(this)" style="display: none;" id="previewImg">
                    <input type="hidden" id="face"/>
                    <p class="uploadimgname uploadfront">点击上传正面照</p>
                </div>
                <div class="back">
                    <!--<p class="uploadimg">-->
                    <!--<img src="__TMPL__/public/assets/images/bicon04@2x.png" alt="">-->
                    <!--</p>-->
                    <div id="preview1" class="uploadimg">
                        <img id="imghead1" border="0" src="__TMPL__/public/assets/images/bicon04@2x.png" style="width:100%;height:100%" onclick="$('#previewImg1').click();">
                    </div>
                    <!--<img src="__TMPL__/public/assets/images/delet.png" alt="" style="position:absolute;bottom:92px;left:46px" class="deleteimg"/>-->
                    <input type="hidden" id="back"/>
                    <input type="file" onchange="previewImage1(this)" style="display: none;" id="previewImg1">

                    <p class="uploadimgname uploadback">点击上传反面照</p>
                </div>
            </div>
        </div>
        <div class="agree">
            <p class="iconfont select icon-weixuanze "></p>
            <div class="agreement">
                <p class="meagree">我已同意</p>
                <p class="protoal">《用户协议》</p>
            </div>
        </div>
        <div class="listenme">
            <div class="listen callTelAlert">
                <p class="listen_img">
                    <img src="__TMPL__/public/assets/images/aicon07@2x.png" alt="">
                </p>
                <p class="listen_name">联系客服</p>
            </div>
            <div class="mesub">
                提交
            </div>
        </div>
    </div>

</div>


<!--begin:提示弹层-->
<div class="pop_fn"></div>

<script type="text/javascript" src="__TMPL__/public/assets/js/swiper.min.js"></script>
<script src="__TMPL__/public/assets/js/zepto.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/js/weui.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="__TMPL__/public/assets/js/example.js"></script>

<script>
    $('.callTelAlert').click(function () {
        $('.callTel').css('display','block');
    });

    $(".callTel").click(function(){

        $(this).css("display","none")
    });
    $(".registerpop").click(function(){
        window.event.stopPropagation();
    })
    var mySwiper = new Swiper('.swiper-container', {
        pagination: {
            el: '.swiper-pagination',
        },
        autoplay: true,//可选选项,自动滑动

    });
    // 实名认证提交
    $('.sub').click(function () {
        $.ajax({
            type: 'POST',
            url: "{:url('Index/Authentication')}",
            data: {
                'name' : $('.peopelname').val(),
                'tel' : $('.peopelphone').val(),
                'card_num' : $('.peopelcard').val()
            },
            success: function (res) {
                if(res.code == 1){
                    popup('实名认证成功');
                    $('.registerwrapper').css('display','none');
                }else{
                    popup(res.message)
                }
            },
            error: function (res) {
                popup('网络错误,请刷新')
            }
        });
    })


    var sexlist=[{
        label: '男',
        value: 0
    }, {
        label: '女',
        value: 1
    }]
    $('.sexselect').on('click', function () {

        weui.picker(sexlist, {
            onChange: function (result) {
                console.log(result);
            },
            onConfirm: function (result) {
                console.log(sexlist[result[0]].label);
                $(".sexchose").html(sexlist[result[0]].label)
                $(".sexchose").attr('index',sexlist[result[0]].value)
            }
        });
    });


    var list=[{
        label: '小学毕业',
        value: 0
    }, {
        label: '初中毕业',
        value: 1
    }, {
        label: '高中毕业',
        value: 2
    }, {
        label: '中等专业学校毕业',
        value: 3
    }, {
        label: '专科毕业',
        value: 4
    }, {
        label: '本科毕业',
        value: 5
    }, {
        label: '硕士研究生',
        value: 6
    }, {
        label: '博士研究生',
        value: 7
    }, {
        label: '其他',
        value: 8
    }]
    $('.seclectschool').on('click', function () {

        weui.picker(list, {
            onChange: function (result) {
                console.log(result);
            },
            onConfirm: function (result) {
                console.log(list[result]);
                $(".sex").html(list[result[0]].label);
                $(".sex").attr('index',list[result[0]].value);
            }
        });
    });


    //选择注意事项0
    var joblist5 = JSON.parse(`{$final.select}`);
    console.log(joblist5);
    $('.list_attention').on('click', function () {

        weui.picker(joblist5, {
            onChange: function (result) {
                console.log(result);
            },
            onConfirm: function (result) {
                console.log(result);
                $(".selsctoption").html(result[0].label)
                $(".selsctoption").attr('index',result[0].value)
            }
        });
    });


    //用户协议
    $(".protoal").click(function(){
        $(".workerwapper").css("display","block");
        $('.select').removeClass("icon-weixuanze");
        $('.select').addClass("icon-yixuanze");
    })
    $(".cancel,.agreematerial").click(function(){
        $(".workerwapper").css("display","none")
    })
    //是否同意协议
    $(".select").click(function(){
        console.log($(this).attr("class"))
        if($(this).attr("class")=='iconfont select icon-weixuanze '){
            $(this).removeClass("icon-weixuanze");
            $(this).addClass("icon-yixuanze");
        }else if($(this).attr("class")=='iconfont select icon-yixuanze'){
            $(this).removeClass("icon-yixuanze");
            $(this).addClass("icon-weixuanze");
        }
    })
    //字体输入
    $("#workrequire").keyup(function(){
        var len=$(this).val().length;
        $(".before").html(len);
        var tt=$("#workrequire").val().substring(0,500)
        if(len>500){
            popup("请输入500个内的字");
            $(this).val(tt)
        }
    })
    //添加职业技能
    $(".addskillimg").click(function(){
        var cal=$(this).siblings(".enterskill").val();

        if(cal.length ==0 ){
            popup("请添加您的职业技能")
        }else{

            var text="";
            text+=' <div class="skill_itemname">' +
                ' <input type="text" class="skill_itemtext skillCount" style=" font-size: 16px;color: #5C5858;" value="'+cal+'">'+
                '<p class="skill_itemimg deleteimg"><img src="__TMPL__/public/assets/images/bicon02@2x.png" alt=""></p>\n' +
                '</div>';

            $(".skill_item").append(text);
            // $(".enterskill").val("请添加您的职业技能")
            $(".enterskill").val('');
            $(".enterskill").attr('placeholder',"请添加您的职业技能");
        }

    })

    $(".skill").on("click",".deleteimg",function(){
    $(this).parents(".skill_itemname").remove();
    })

    // 提交时资料不完善
    $(".mesub").click(function(){
        var wx = $('.wx').val();
        var age = $('.age').val();
        var sex = $(".sexchose").attr('index');
        var education = $(".sex").attr('index');
        var address = $('.address').val();
        var free_time = $('.free_time').val();
        var select_id = $('.selsctoption').attr('index');
        var skill = $('.skill1').val();
        var experience = $('.experience').val();
        var isTrue = $(".select").hasClass("icon-yixuanze");
        var face = $('#face').val();
        var back = $('#back').val();
        var arr = [];
        $('.skillCount').each(function (index,val) {
            arr.push($(this).val());
        });
        if(isTrue == true){
            $.ajax({
                type: 'POST',
                url: "{:url('Index/resume')}",
                data: {
                    'wx' : wx,
                    'age' : age,
                    'sex' : sex,
                    'education' : education,
                    'address' : address,
                    'free_time' : free_time,
                    'select_id' : select_id,
                    'skill' : arr,
                    'experience' : experience,
                    'just' : face,
                    'back' : back,
                },
                success: function (res) {
                    if(res.code == 1){
                        $('.examinewrapper').css('display','block');
                        setTimeout(function(){
                            location.href="{:url('Member/index')}"
                        },2000);
                    }else{
                        popup(res.message);
                    }
                    console.log('1111111');
                    console.log(res);
                },
                error: function (res) {
                    console.log('33333333');
                    console.log(res);
                }
            });
        }else{
            console.log('2w22222222');
            popup('请先勾选劳动者协议');
        }
    });
    // 上传图片
    function clacImgZoomParam(maxWidth, maxHeight, width, height) {
        var param = {
            top: 0,
            left: 0,
            width: width,
            height: height
        };
        if(width > maxWidth || height > maxHeight) {
            rateWidth = width / maxWidth;
            rateHeight = height / maxHeight;

            if(rateWidth > rateHeight) {
                param.width = maxWidth;
                param.height = Math.round(height / rateWidth);
            } else {
                param.width = Math.round(width / rateHeight);
                param.height = maxHeight;
            }
        }
        param.left = Math.round((maxWidth - param.width) / 2);
        param.top = Math.round((maxHeight - param.height) / 2);
        return param;
    }
    //正面照
    function previewImage(file) {
        $(".uploadfront").css("display","none")
        var MAXWIDTH = 50;
        var MAXHEIGHT = 50;
        var div = document.getElementById('preview');
        if(file.files && file.files[0]) {
            div.innerHTML = '<img id=imghead onclick=$("#previewImg").click()>';
            var img = document.getElementById('imghead');
            img.onload = function() {
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width = rect.width;
                img.height = rect.height;
                //                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top + 'px';
            }
            var reader = new FileReader();
            reader.onload = function(evt) {
                img.src = evt.target.result;
            }
            reader.readAsDataURL(file.files[0]);
        } else //兼容IE
        {
            var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
            div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
        }

        var thisFile = document.getElementById("previewImg").files[0];
        var formData = new FormData();
        formData.append('file',thisFile);
        $.ajax({
            url: "{:url('Index/getPic')}",
            type: "POST",
            data: formData,
            /**
             *必须false才会自动加上正确的Content-Type
             */
            contentType: false,
            /**
             * 必须false才会避开jQuery对 formdata 的默认处理
             * XMLHttpRequest会对 formdata 进行正确的处理
             */
            processData: false,
            success: function (data) {
                if(data.code == 1){
                    $('#face').val(data.data);
                    // popup('上传成功');
                }else{
                    popup(data.message)
                }
                console.log(data);
            },
            error: function () {
                popup("上传失败!");
            }
        });


    }

    //  反面照
    function previewImage1(file) {
        $(".uploadback").css("display","none")
        var MAXWIDTH = 50;
        var MAXHEIGHT = 50;
        var div = document.getElementById('preview1');
        if(file.files && file.files[0]) {
            div.innerHTML = '<img id=imghead1 onclick=$("#previewImg1").click()>';
            var img = document.getElementById('imghead1');
            img.onload = function() {
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                img.width = rect.width;
                img.height = rect.height;
                //                 img.style.marginLeft = rect.left+'px';
                img.style.marginTop = rect.top + 'px';
            }
            var reader = new FileReader();
            reader.onload = function(evt) {
                img.src = evt.target.result;
            }
            reader.readAsDataURL(file.files[0]);
        } else //兼容IE
        {
            var sFilter = 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
            file.select();
            var src = document.selection.createRange().text;
            div.innerHTML = '<img id=imghead>';
            var img = document.getElementById('imghead');
            img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
            var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
            status = ('rect:' + rect.top + ',' + rect.left + ',' + rect.width + ',' + rect.height);
            div.innerHTML = "<div id=divhead style='width:" + rect.width + "px;height:" + rect.height + "px;margin-top:" + rect.top + "px;" + sFilter + src + "\"'></div>";
        }

        var thisFile1 = document.getElementById("previewImg1").files[0];
        var formData1 = new FormData();
        formData1.append('file',thisFile1);
        $.ajax({
            url: "{:url('Index/getPic')}",
            type: "POST",
            data: formData1,
            /**
             *必须false才会自动加上正确的Content-Type
             */
            contentType: false,
            /**
             * 必须false才会避开jQuery对 formdata 的默认处理
             * XMLHttpRequest会对 formdata 进行正确的处理
             */
            processData: false,
            success: function (data) {
                if(data.code == 1){
                    $('#back').val(data.data);
                    // popup('上传成功');
                }else{
                    popup(data.message)
                }
                console.log(data);
            },
            error: function () {
                popup("上传失败!");
            }
        });
    }

    // 微信我的位置
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
        appId: "{$config.appId}", // 必填,公众号的唯一标识
        timestamp: "{$config.timestamp}", // 必填,生成签名的时间戳
        nonceStr: "{$config.nonceStr}", // 必填,生成签名的随机串
        signature: "{$config.signature}",// 必填,签名
        jsApiList: [
            'getLocation',
            'openLocation',
        ] // 必填,需要使用的JS接口列表
    });
    wx.ready(function(){
        wx.getLocation({
            type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
            success: function (res) {
                console.log(res);
                var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
                var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
                var speed = res.speed; // 速度,以米/每秒计
                var accuracy = res.accuracy; // 位置精度
                var data={
                    location:latitude+','+longitude,//纬度,经度
                    key:"HGLBZ-WD66X-2H74V-TJ6NI-NHNWZ-DNBJ5",
                    get_poi:0
                }
                var url="http://apis.map.qq.com/ws/geocoder/v1/?";
                data.output="jsonp";
                $.ajax({
                    type:"get",
                    dataType:'jsonp',
                    data:data,
                    jsonp:"callback",
                    jsonpCallback:"QQmap",
                    url:url,
                    success:function(json){
                        var isGet = $('.enterplace').text();
                        if(isGet.length == 0){
                            var addr =    "{$Request.param.addr}";
                            if(addr.length == 0){
                                $('.enterplace').val(json.result.address);
                            }else{
                                $('.enterplace').val(addr);
                            }
                        }

                    },
                    error : function(err){alert("服务端错误,请刷新浏览器后重试")}
                })
            }
        });
    });

    // 调取腾讯接口
    var txUrl = "https://3gimg.qq.com/lightmap/components/locationPicker2/index.html?callback=QQmap&type=0&backurl=http://yunzhi07.com&search=1&policy=1&mapdraggable=0&zoom=13&referer=myapp&key=HGLBZ-WD66X-2H74V-TJ6NI-NHNWZ-DNBJ5";
    $('.enterplace').click(function () {
        window.location.href = txUrl;
        // $('.enterplace').val(json.result.address);
    })


</script>
</body>
</html>