index.html 38.4 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 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/weui.min.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/swiper-3.4.2.min.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_970727_pul0ncci0v.css">
    <link rel="stylesheet" href="__TMPL__/public/assets/assets/css/style.css">
    <script type="text/javascript" src="__TMPL__/public/assets/assets/js/fontsize.js"></script>
    <script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-2.1.0.js"></script>
    <title>我要托管</title>
</head>
<body>
<div class="fill_topimg">
    <img src="{$page_html1.thumbnail}" alt="">
</div>
<div class="trust_box">
    <div class="trustmain">
        <div class="trustmaintitle">产品信息</div>
        <div class="trust_m_item">
            <div>保险公司</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="gsmaintxt"></div>
                <div class="sex_itemtxt gs_item">选择</div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>产品名称</div>
            <div class="trust_iteminput">
                <input type="text" placeholder="请输入" value="" id="cp">
            </div>
        </div>
        <div class="trust_m_item">
            <div>保单类型</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="baselxmaintxt"></div>
                <div class="sex_itemtxt lx_item">选择</div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>保险金额</div>
            <div class="trust_iteminput  m_tipitem">
                <input type="number" placeholder="请输入" value="" id="jr">
                <div class="m_tip"></div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>缴费方式</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="jfmaintxt"></div>
                <div class="sex_itemtxt jf_item">选择</div>
            </div>
        </div>
        <div class="trust_m_item ">
            <div>缴费期限</div>
            <div class="trust_iteminput choose_iteminputcell">
                <input type="number" placeholder="请输入或选择" value="" id="qx">
                <div class="m_tip"></div>
                <div class="sex_itemtxt qx_choose">选择</div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>期缴保费</div>
            <div class="trust_iteminput m_tipitem">
                <input type="number" placeholder="请输入" value="" id="bf">
                <div class="m_tip"></div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>保障期限</div>
            <div class="trust_iteminput choose_iteminputcell">
                <input type="text" placeholder="请输入或选择" value="" id="bzqs">
                <!--<div class="m_tip">年</div>-->
                <div class="sex_itemtxt bzqs_choose">选择</div>
            </div>
        </div>
    </div>
    <div class="fujia_trust">
        <div class="trustmain fujia_trusttrustmain">
            <div class="trust_subbox">
                <div class="trust_subboxtitle add_trustmian mark" style="color: #fff;font-size: 0.24rem;">添加附加险</div>
                <div class="trust_del">删除</div>
            </div>
            <div class="trust_m_item">
                <div>产品名称</div>
                <div class="trust_iteminput">
                    <input type="text" placeholder="请输入" value="" class="subjoin_product_name">
                </div>
            </div>
            <div class="trust_m_item">
                <div>保单类型</div>
                <div class="trust_iteminput choose_iteminputcell">
                    <div class="lxmaintxt subjoin_insurance_type_id"></div>
                    <div class="sex_itemtxt fujia_lx_item">选择</div>
                </div>
            </div>
            <div class="trust_m_item">
                <div>保险金额</div>
                <div class="trust_iteminput  m_tipitem">
                    <input type="text" placeholder="请输入" value="" class="subjoin_price">
                    <div class="m_tip"></div>
                </div>
            </div>
            <!--<div class="trust_m_item">-->
                <!--<div>保险时间</div>-->
                <!--<div class="trust_iteminput choose_iteminputcell">-->
                    <!--<div class="lxmaintxt subjoin_time"></div>-->
                    <!--<div class="sex_itemtxt fujia_time_item">选择</div>-->
                <!--</div>-->
            <!--</div>-->
            <div class="trust_m_item">
                <div>缴费期限</div>
                <div class="trust_iteminput choose_iteminputcell">
                    <input type="number" placeholder="请输入或选择" value="" class="fujia_bzqs_input payment_time">
                    <div class="m_tip"></div>
                    <div class="sex_itemtxt fujia_bzqs_choose">选择</div>
                </div>
            </div>
            <div class="trust_m_item">
                <div>期缴保费</div>
                <div class="trust_iteminput m_tipitem">
                    <input type="number" placeholder="请输入" value="" class="subjoin_pay_method_price">
                    <div class="m_tip"></div>
                </div>
            </div>
            <div class="trust_m_item">
                <div>保障期限</div>
                <div class="trust_iteminput choose_iteminputcell">
                    <input type="text" placeholder="请输入或选择" value="" class="fujia_bzqs_input subjoin_guarantee_deadline_time">
                    <!--<div class="m_tip">年</div>-->
                    <div class="sex_itemtxt fujia_bzqs_choose">选择</div>
                </div>
            </div>
        </div>
    </div>
    <div class="add_trustmian">添加附加险</div>
    <div class="trustmain">
        <div class="trustmaintitle">合同基本信息</div>
        <div class="trust_m_item">
            <div>保险单号</div>
            <div class="trust_iteminput">
                <input type="text" placeholder="请输入" value="" id="danhao">
            </div>
        </div>
        <div class="trust_m_item">
            <div>投保人</div>
            <div class="trust_iteminput">
                <input type="text" placeholder="请输入" value="" id="toubaor">
            </div>
        </div>
        <div class="trust_m_item ">
            <div>被保人</div>
            <div class="trust_iteminput">
                <input type="text" placeholder="请输入" value="" id="beibaor">

            </div>
        </div>
        <div class="trust_m_item mini_m_item">
            <div>与被保人关系</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="lxmaintxt tip_guanximiantxt beibaorgx"></div>
                <div class="sex_itemtxt trust_guanxi">选择</div>
            </div>
        </div>
        <div class="trust_m_item mini_m_item">
            <div>被保人生日</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="lxmaintxt tip_guanximiantxt beibairsr"></div>
                <div class="sex_itemtxt trust_shengren">选择</div>
            </div>
        </div>
        <div class="trust_m_item">
            <div>投保日期</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="lxmaintxt tip_guanximiantxt beibaorrq"></div>
                <div class="sex_itemtxt trust_toubaorqi">选择</div>
            </div>
        </div>
        <div class="trust_m_item mini_m_item">
            <div>合同生效日期</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="lxmaintxt tip_guanximiantxt hetongsxr"></div>
                <div class="sex_itemtxt hetongshegnxiao">选择</div>
            </div>
        </div>
        <!--<div class="trust_m_item">-->
            <!--<div>保险时间</div>-->
            <!--<div class="trust_iteminput choose_iteminputcell">-->
                <!--<div class="lxmaintxt tip_guanximiantxt baoxianrq"></div>-->
                <!--<div class="sex_itemtxt baozhangrq">选择</div>-->
            <!--</div>-->
        <!--</div>-->
        <div class="trust_m_item mini_m_item">
            <div>投保人豁免</div>
            <div class="trust_iteminput choose_iteminputcell">
                <div class="lxmaintxt tip_guanximiantxt huominatxt"></div>
                <div class="sex_itemtxt huomian">选择</div>
            </div>
        </div>
    </div>
    <div class="img_title">
        <div>您可将保单拍照或者截图上传平台</div>
        <div class="img_titlesun">上传说明</div>
    </div>
    <div class="trust_imgs">
        <div class="trust_img add_img" style="position:relative;" >
            <div class="iconfont icon-jia" id="doc"></div>
        </div>
    </div>
    <div class="trustmain">
        <div class="trustmaintitle trustmiantitle_top">合同基本信息</div>
        <div class="trust_textbox">
            <div class="trust_textboxtitle">备注</div>
            <div class="textbox">
                <textarea name="" id="remark" cols="30" rows="10" placeholder="请填写受益人详情,特殊保障等"></textarea>
            </div>
        </div>
        <div class="choosefill_title">您保险代理人的姓名 (选填)</div>
        <div class="choosefill_input">
            <input type="text" placeholder="请输入" id="agent_name">
        </div>
        <div class="choosefill_title">您保险代理人的联系方式 (选填)</div>
        <div class="choosefill_input">
            <input type="number" placeholder="请输入" id="agent_phone">
        </div>
    </div>
    <div class="reg_box activetxt trust_txtnox recommend">
        <div class="iconfont icon-xuanzhong1"></div>
        暂无代理人信息,希望平台推荐</div>

    <div class="regbtn trust_btn">确认提交</div>

</div>
<div class="trust_mold" style="display: none">
    <div class="trust_main">
        <div class="trust_maintop">教你如何拍保单</div>
        <div class="trust_mainimg">
            <img src="{$page_html2.thumbnail}" alt="">
        </div>
    </div>
    <div class="trust_mold_btn">关闭</div>
</div>
<div class="trust_mold1" style="display: none">
    <div class="trust1_mian">
        <div>请至少上传一张图片</div>
        <div class="trust_mold_btn">提交</div>
    </div>
</div>
<div id="toast" style="display: none;">
    <div class="weui-mask_transparent"></div>
    <div class="weui-toast">
        <p class="weui-toast__content">已完成</p>
    </div>
</div>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/swiper-3.4.2.jquery.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/weui.min.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/common.js"></script>
<script type="text/javascript" src="__TMPL__/public/assets/assets/js/Augly_Verification.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script type="text/javascript">
    wx.config(
        {$jssdk}
    );
    var imgs=[];
    wx.ready(function () {
        $('#doc').click(function () {
            var num = 9-imgs.length;
            if(num<=0) {
                toast('最多上传就九张');
            }else {
                wx.chooseImage({
                    count: num, // 默认9
                    sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
                    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
                    success: function (res) {
                        var mydata = '';
                        for (var i = 0; i < res.localIds.length; i++) {
                            mydata += '<div class="trust_img"><div class="img_close iconfont icon-close-b"></div><img class="num images" src="' + res.localIds[i] + '" alt=""></div>';
                            uploadImages(res.localIds[i]);
                        }
                        $('.trust_imgs').prepend(mydata);
                        $('.images').click(function(){
                            var thisUrl = $(this).attr('src');
                            var allUrlLength = $('.images').length;
                            var allUrl = [];
                            for(var i=0;i<allUrlLength;i++){
                                allUrl.push($('.images').eq(i).attr('src'));
                            }
                            wx.previewImage({
                                current: thisUrl,
                                urls: allUrl
                            });
                        })
                    }
                });
            }
        });
        function uploadImages(localId) {
            wx.uploadImage({
                localId: localId,
                isShowProgressTips: 1,
                success: function (res) {
                    var serverId = res.serverId; // 返回图片的服务器端ID
                    $.ajax({
                        url:"{:url('index/upload/wechat_upload')}",
                        type:"GET",
                        data:{'media':serverId},
                        success:function(data){
                            var result = eval("(" + data + ")");
                            if(result.code == 40000){
                                toast('与服务器断开连接');
                            }else if(result.code == 20000){
                                var url = result.data;
                                re = new RegExp("/","g");
                                var Newurl = url.replace(re, "*");
                                if(imgs.length < 9){
                                    imgs.push(Newurl);
                                    if(imgs.length==9){
                                        $('.add_img').hide();
                                    }
                                }
                            }
                        }
                    })
                },
                fail: function (res) {
                    $modal.toast(JSON.stringify(res));
                }
            });
        }
        $('.images').click(function(){
            var thisUrl = $(this).attr('src');
            var allUrlLength = $('.images').length;
            var allUrl = [];
            for(var i=0;i<allUrlLength;i++){
                allUrl.push($('.images').eq(i).attr('src'));
            }
            wx.previewImage({
                current: thisUrl,
                urls: allUrl
            });
        })
    });

    $('.regbtn').click(function () {
        console.log(imgs);
        var gs=$('.gsmaintxt').attr('data-id');//保险公司
        console.log(gs);
        var cp=$('#cp').val();//产品名称
        var lx=$('.baselxmaintxt').attr('data-id');//保单类型
        var jr=$('#jr').val();//保险金额
        var jf=$('.jfmaintxt').html();//缴费方式
        var qx=$('#qx').val();//缴费期限
        var bf=$('#bf').val();//期缴保费
        var bzqs=$('#bzqs').val();//保障期限
        var danhao=$('#danhao').val();//保险单号
        var toubaor=$('#toubaor').val();//投保人
        var beibaor=$('#beibaor').val();//被保人
        var guanxi=$('.beibaorgx').html();//与被保人关系
        var shengr=$('.beibairsr').html();//被保人生日
        var toubaorq=$('.beibaorrq').html();//投保日期
        var hetongshengxr=$('.hetongsxr').html();//合同生效日期
        var baoxianshijian=1;//$('.baoxianrq').html();//保险时间
        var beibaorhm=$('.huominatxt').html();//投保人豁免
        if(gs==''){
            toast('请选择保险公司');
        }else if(cp==''){
            toast('请输入产品名称');
        }else if(lx==''){
            toast('请选择保单类型');
        }else if(jr==''){
            toast('请输入保险金额');
        }else if(jf==''){
            toast('请选择缴费方式');
        }else if(qx==''){
            toast('请输入或选择缴费期限');
        }else if(bf==''){
            toast('请输入期缴保费');
        } else if(bzqs==''){
            toast('请输入保障期限');
        }else if(danhao==''){
            toast('请输入保险单号');
        }else if(toubaor==''){
            toast('请选择投保人');
        }else if(beibaor==''){
            toast('请选择被保人');
        }else if(guanxi==''){
            toast('请选择与被保人关系');
        }else if(shengr==''){
            toast('请选择被保人生日');
        }else if(toubaorq==''){
            toast('请选择投保日期');
        }else if(hetongshengxr==''){
            toast('请选择合同生效日期');
        }
        // else if(baoxianshijian==''){
        //     toast('请选择保险时间');
        // }
        else if(beibaorhm==''){
            toast('请选择投保人豁免');
        }else if(imgs.length == 0){
            $('.trust_mold1').show();
        }else {
            //附加险数据
            var subjoin_product_name = $('.subjoin_product_name');//附加险产品名
            var subjoin_insurance_type_id = $('.subjoin_insurance_type_id');//保单类型
            var subjoin_price = $('.subjoin_price');//保险金额
            var subjoin_time = $('.subjoin_time');//保险时间
            var payment_time = $('.payment_time');//缴费期限
            var subjoin_pay_method_price = $('.subjoin_pay_method_price');//期缴保费
            var subjoin_guarantee_deadline_time = $('.subjoin_guarantee_deadline_time');//保障期限
            var remark = $('#remark').val() ? $('#remark').val() : 0;//备注
            var agent_name = $('#agent_name').val() ? $('#agent_name').val() : 0;//代理人姓名
            var agent_phone = $('#agent_phone').val() ? $('#agent_phone').val() : 0;//代理人电话
            var fujia_len=$('.fujia_trusttrustmain').length;
            var subjoin_product_name_arr = [];
            var subjoin_insurance_type_id_arr = [];
            var subjoin_price_arr = [];
            var subjoin_time_arr = [];
            var payment_time_arr = [];
            var subjoin_pay_method_price_arr = [];
            var subjoin_guarantee_deadline_time_arr = [];
            for(var i=0;i<fujia_len;i++){
                if(subjoin_product_name.eq(i).val() == ''){
                    toast("附加险"+i+"的产品名称不能为空");
                    return false;
                }else if(subjoin_insurance_type_id.eq(i).attr('data-id') == ''){
                    toast("附加险"+i+"的保单类型不能为空")
                    return false;
                }else if(subjoin_price.eq(i).val() == ''){
                    toast("附加险"+i+"的保险金额不能为空")
                    return false;
                }
                //else if(subjoin_time.eq(i).text() == ''){
                    //toast("附加险"+i+"的保险时间不能为空")
                    //return false;
                //}
                else if(payment_time.eq(i).val() == ''){
                    toast("附加险"+i+"的缴费期限不能为空")
                    return false;
                }else if(subjoin_pay_method_price.eq(i).val() == ''){
                    toast("附加险"+i+"的期缴保费不能为空")
                    return false;
                }else if(subjoin_guarantee_deadline_time.eq(i).val() == ''){
                    toast("附加险"+i+"的保障期限不能为空")
                    return false;
                }else{
                    subjoin_product_name_arr.push(subjoin_product_name.eq(i).val());
                    subjoin_insurance_type_id_arr.push(subjoin_insurance_type_id.eq(i).attr('data-id'));
                    subjoin_price_arr.push(subjoin_price.eq(i).val());
                    //subjoin_time_arr.push(1);//(subjoin_time.eq(i).text());
                    payment_time_arr.push(payment_time.eq(i).val());
                    subjoin_pay_method_price_arr.push(subjoin_pay_method_price.eq(i).val());
                    subjoin_guarantee_deadline_time_arr.push(subjoin_guarantee_deadline_time.eq(i).val());
                }
            }
            var is_recommend = $('.recommend').hasClass('activetxt');
            if(is_recommend == true){
                var recommend = 1;
            }else{
                var recommend = 2;
            }
            if(fujia_len == 0){
                window.location.href="{:url('form/cost','','')}"+'/insurance_company_id/'+gs+'/product_name/'+cp+'/insurance_type_id/'+lx+'/insurance_price/'+jr+'/pay_method_id/'+jf+'/payment_time/'+qx+'/pay_method_price/'+bf+'/guarantee_deadline_time/'+bzqs+'/insurance_num/'+danhao+'/application/'+toubaor+'/insurer/'+beibaor+'/relation/'+guanxi+'/insurer_birthday/'+shengr+'/insurer_time/'+toubaorq+'/take_time/'+hetongshengxr+'/remit/'+beibaorhm+'/remark/'+remark+'/agent_name/'+agent_name+'/agent_phone/'+agent_phone+'/imgs/'+imgs+'/recommend/'+recommend;
            }else{
                window.location.href="{:url('form/cost','','')}"+'/subjoin_guarantee_deadline_time_arr/'+subjoin_guarantee_deadline_time_arr+'/subjoin_pay_method_price_arr/'+subjoin_pay_method_price_arr+'/payment_time_arr/'+payment_time_arr+'/subjoin_price_arr/'+subjoin_price_arr+'/subjoin_insurance_type_id_arr/'+subjoin_insurance_type_id_arr+'/subjoin_product_name_arr/'+subjoin_product_name_arr+'/insurance_company_id/'+gs+'/product_name/'+cp+'/insurance_type_id/'+lx+'/insurance_price/'+jr+'/pay_method_id/'+jf+'/payment_time/'+qx+'/pay_method_price/'+bf+'/guarantee_deadline_time/'+bzqs+'/insurance_num/'+danhao+'/application/'+toubaor+'/insurer/'+beibaor+'/relation/'+guanxi+'/insurer_birthday/'+shengr+'/insurer_time/'+toubaorq+'/take_time/'+hetongshengxr+'/insure_time/'+baoxianshijian+'/remit/'+beibaorhm+'/remark/'+remark+'/agent_name/'+agent_name+'/agent_phone/'+agent_phone+'/imgs/'+imgs+'/recommend/'+recommend;
            }

        }
    })
    //保险公司的选择
    $('.gs_item').click(function () {
        weui.picker(
            [
                <foreach name="$insurance_company" item="i_o">
                {
                    label: '{$i_o.insurance_company_name}',
                    value: '{$i_o.id}'
                },
                </foreach>
            ], {
                onChange: function(result) {
                },
                onConfirm: function(result) {
                    $('.gstxt').hide();
                    $('.gsmaintxt').html(result[0].label)
                    $('.gsmaintxt').attr('data-id',result[0].value)
                }
            });
    })
    //保险类型的选择
    $('.lx_item').click(function () {
        weui.picker([{
            label: '重疾',
            value: '1'
        }, {
            label:  '人寿',
            value:  '2'
        }, {
            label:  '出行',
            value:  '3'
        }, {
            label:  '医疗',
            value:  '4'
        }, {
            label:  '理财',
            value:  '5'
        }, {
            label:  '其它',
            value:  '6'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                $('.baselxtxt').hide();
                $('.baselxmaintxt').html(result[0].label)
                $('.baselxmaintxt').attr('data-id',result[0].value);
            }
        });
    })
//缴费方式
    $('.jf_item').click(function () {
        weui.picker([{
            label: '月缴',
            value: '1'
        }, {
            label:  '季缴',
            value:  '2'
        }, {
            label:  '半年缴',
            value:  '3'
        }, {
            label:  '年交',
            value:  '4'
        }, {
            label:  '一次性交付(趸交)',
            value:  '5'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                $('.jftxt').hide();
                $('.jfmaintxt').html(result[0].label)
            }
        });
    })
    //缴费期限选择
    $('.qx_choose').click(function () {
        weui.picker([{
            label: '1年',
            value: '1'
        },{
            label: '3年',
            value: '3'
        }, {
            label:  '5年',
            value:  '5'
        }, {
            label:  '10年',
            value:  '10'
        }, {
            label:  '15年',
            value:  '15'
        }, {
            label:  '20年',
            value:  '20'
        }, {
            label:  '30年',
            value:  '30'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                $('#qx').val(result[0].value);
            }
        });
    })
    $('.bzqs_choose').click(function () {
        weui.picker([{
            label: '3年',
            value: '3年'
        }, {
            label:  '5年',
            value:  '5年'
        }, {
            label:  '10年',
            value:  '10年'
        }, {
            label:  '15年',
            value:  '15年'
        }, {
            label:  '20年',
            value:  '20年'
        }, {
            label:  '30年',
            value:  '30年'
        }, {
            label:  '至60岁',
            value:  '至60岁'
        }, {
            label:  '至65岁',
            value:  '至65岁'
        }, {
            label:  '至70岁',
            value:  '至70岁'
        }, {
            label:  '至75岁',
            value:  '至75岁'
        }, {
            label:  '至80岁',
            value:  '至80岁'
        }, {
            label:  '至85岁',
            value:  '至85岁'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                $('#bzqs').val(result[0].value);
            }
        });
    })
//附加险缴费期限选择
    $('.fujia_trust').on('click','.fujia_bzqs_choose',function () {
        var that=$(this);
        weui.picker([{
            label: '3年',
            value: '3年'
        }, {
            label:  '5年',
            value:  '5年'
        }, {
            label:  '10年',
            value:  '10年'
        }, {
            label:  '15年',
            value:  '15年'
        }, {
            label:  '20年',
            value:  '20年'
        }, {
            label:  '30年',
            value:  '30年'
        }, {
            label:  '至60岁',
            value:  '至60岁'
        }, {
            label:  '至65岁',
            value:  '至65岁'
        }, {
            label:  '至70岁',
            value:  '至70岁'
        }, {
            label:  '至75岁',
            value:  '至75岁'
        }, {
            label:  '至80岁',
            value:  '至80岁'
        }, {
            label:  '至85岁',
            value:  '至85岁'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                that.parents('.choose_iteminputcell').find('.fujia_bzqs_input').val(result[0].value)
            }
        });
    })
    //fujia_lx_item
    $('.fujia_trust').on('click','.fujia_lx_item',function () {

        var that=$(this);
        weui.picker([{
            label: '重疾',
            value: '1'
        }, {
            label:  '人寿',
            value:  '2'
        }, {
            label:  '出行',
            value:  '3'
        }, {
            label:  '医疗',
            value:  '4'
        }, {
            label:  '理财',
            value:  '5'
        }, {
            label:  '其它',
            value:  '6'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                that.prev('.lxmaintxt').html(result[0].label)
                that.prev('.lxmaintxt').attr('data-id',result[0].value)
                that.prev('.lxtxt').hide();
            }
        });
    })
    //fujia_time_item保险时间的选择
    $('.fujia_trust').on('click','.fujia_time_item',function () {
        var that=$(this);
        weui.datePicker({
            start: new Date().getFullYear() - 90,
            end: new Date(),
            defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
            onConfirm: function(result){
                let date='';
                for(var i=0;i<result.length;i++){
                    if(i==(result.length-1)){
                        date += result[i].value
                    }else{
                        date += result[i].value+'-'
                    }
                }
                that.prev('.lxmaintxt').html(date)
                that.prev('.lxtxt').hide();
            },
        });
    })
    //与被保人关系
    $('.trust_guanxi').click(function () {
        var that=$(this);
        weui.picker([{
            label: '本人',
            value: '1'
        }, {
            label:  '配偶',
            value:  '2'
        }, {
            label:  '子女',
            value:  '3'
        }, {
            label:  '父母',
            value:  '4'
        }, {
            label:  '祖父母',
            value:  '5'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
               that.prev('.guanxitxt').hide();
               that.prev('.tip_guanximiantxt').html(result[0].label)
            }
        });
    })
    //被保人生日
    $('.trust_shengren').click(function () {
        var that=$(this);
        weui.datePicker({
            start: new Date().getFullYear() - 90,
            end: new Date(),
            defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
            onConfirm: function(result){
                let date='';
                for(var i=0;i<result.length;i++){
                    if(i==(result.length-1)){
                        date += result[i].value
                    }else{
                        date += result[i].value+'-'
                    }
                }
                that.prev('.guanxitxt').hide();
                that.prev('.tip_guanximiantxt').html(date)
            },
        });
    })
    //投保日期
    $('.trust_toubaorqi').click(function () {
        var that=$(this);
        weui.datePicker({
            start: new Date().getFullYear() - 90,
            end: new Date(),
            defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
            onConfirm: function(result){
                let date='';
                for(var i=0;i<result.length;i++){
                    if(i==(result.length-1)){
                        date += result[i].value
                    }else{
                        date += result[i].value+'-'
                    }
                }
                that.prev('.guanxitxt').hide();
                that.prev('.tip_guanximiantxt').html(date)
            },
        });
    });
    //合同生效日期
    $('.hetongshegnxiao').click(function () {
        var that=$(this);
        weui.datePicker({
            start: new Date().getFullYear() - 90,
            end: new Date(),
            defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
            onConfirm: function(result){
                let date='';
                for(var i=0;i<result.length;i++){
                    if(i==(result.length-1)){
                        date += result[i].value
                    }else{
                        date += result[i].value+'-'
                    }
                }
                that.prev('.guanxitxt').hide();
                that.prev('.tip_guanximiantxt').html(date)
            },
        });
    })
    //保险日期
    $('.baozhangrq').click(function () {
        var that=$(this);
        weui.datePicker({
            start: new Date().getFullYear() - 90,
            end: new Date(),
            defaultValue: [new Date().getFullYear(), new Date().getMonth()+1, new Date().getDate()],
            onConfirm: function(result){
                let date='';
                for(var i=0;i<result.length;i++){
                    if(i==(result.length-1)){
                        date += result[i].value
                    }else{
                        date += result[i].value+'-'
                    }
                }
                that.prev('.guanxitxt').hide();
                that.prev('.tip_guanximiantxt').html(date)
            },
        });
    })
    //被保人豁免
    $('.huomian').click(function () {
        var that=$(this);
        weui.picker([{
            label: '是',
            value: '1'
        }, {
            label:  '否',
            value:  '2'
        }], {
            onChange: function(result) {
            },
            onConfirm: function(result) {
                that.prev('.guanxitxt').hide();
                that.prev('.tip_guanximiantxt').html(result[0].label)
            }
        });
    })
    $('.img_titlesun').click(function () {
        $('.trust_mold').show();
    })
    $('.trust_mold').click(function () {
        $('.trust_mold').hide();
    })
    $('.trust_main').click(function (e) {
        e.stopPropagation();
    })
    $('.trust_mold_btn').click(function () {
        $('.trust_mold').hide();
    })

    ////删除图片
    $('.trust_imgs').on('click','.icon-close-b',function (e) {
        e.stopPropagation()
        console.log('sdfdf',e);
        var index=$(this).index();
        imgs.splice(index,1);
        $(this).parents('.trust_img').remove();
    })
    //添加附加险
    $('.add_trustmian').click(function () {
        if($(this).hasClass('mark') == true){
            $(this).text('附加险一');
            $(this).removeClass('add_trustmian');
            $(this).removeClass('mark');
            $(this).off('click')
        }
        var fujia_len=$('.fujia_trusttrustmain').length;
        var fujia_lentxt=['一','二','三','四','五','六','七','八','九','十'];
        if(fujia_len<=10){
            var html='<div class="trustmain fujia_trusttrustmain">\n' +
                '            <div class="trust_subbox">\n' +
                '                <div class="trust_subboxtitle">附加险'+fujia_lentxt[fujia_len]+'</div>\n' +
                '                <div class="trust_del">删除</div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>产品名称</div>\n' +
                '                <div class="trust_iteminput">\n' +
                '                    <input type="text" placeholder="请输入" value="" class="subjoin_product_name">\n' +
                '                </div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>保单类型</div>\n' +
                '                <div class="trust_iteminput choose_iteminputcell">\n' +
                '                    <div class="lxmaintxt subjoin_insurance_type_id"></div>\n' +
                '                    <div class="sex_itemtxt fujia_lx_item">选择</div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>保险金额</div>\n' +
                '                <div class="trust_iteminput  m_tipitem">\n' +
                '                    <input type="text" placeholder="请输入" value="" class="subjoin_price">\n' +
                '                    <div class="m_tip">元</div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>缴费期限</div>\n' +
                '                <div class="trust_iteminput choose_iteminputcell">\n' +
                '                    <input type="number" placeholder="请输入或选择" value="" class="fujia_bzqs_input payment_time">\n' +
                '                    <div class="m_tip">年</div>\n' +
                '                    <div class="sex_itemtxt fujia_bzqs_choose">选择</div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>期缴保费</div>\n' +
                '                <div class="trust_iteminput m_tipitem">\n' +
                '                    <input type="number" placeholder="请输入" value="" class="subjoin_pay_method_price">\n' +
                '                    <div class="m_tip">元</div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '            <div class="trust_m_item">\n' +
                '                <div>保障期限</div>\n' +
                '                <div class="trust_iteminput choose_iteminputcell">\n' +
                '                    <input type="number" placeholder="请输入或选择" value="" class="fujia_bzqs_input subjoin_guarantee_deadline_time">\n' +
                '                    <div class="m_tip">年</div>\n' +
                '                    <div class="sex_itemtxt fujia_bzqs_choose">选择</div>\n' +
                '                </div>\n' +
                '            </div>\n' +
                '        </div>';
            $('.fujia_trust').append(html);
        }else{
            toast('附加险只能添加10个');
        }
    })
    $('.fujia_trust').on('click','.trust_del',function () {
        $(this).parents('.fujia_trusttrustmain').remove();
    })
    $('.trust_txtnox').click(function () {
        if($(this).hasClass('activetxt')){
            $(this).removeClass('activetxt')
        }else{
            $(this).addClass('activetxt')
        }

    })
    // $("#dailiname").focus(function(){
    //     $('.trust_txtnox').removeClass('activetxt')
    // });
    // $('#dailitel').focus(function () {
    //     if($('#dailiname').val()==''){
    //         toast('请先输入投保人姓名');
    //     }else{
    //         $('.trust_txtnox').removeClass('activetxt')
    //     }
    // })
</script>
</body>
</html>