
<!doctype HTML>
<html>
<head>
    <title>{{#equal param.isHelper 1}}购车小秘{{else}}我要贷款{{/equal}}</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="author" content="yangzhifang_gz maiyaotang_gz" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/><!-- 手机视图 -->
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="format-detection" content="address=no" >
    <meta name="apple-mobile-web-app-capable" content="yes" />
   <!-- <link href="http://js.3conline.com/pcauto/2015/chedaiwap/css/recommend.css" rel="stylesheet" type="text/css" />-->
 <style type="text/css">
     @charset "UTF-8";
     body,dl,dd,ul,ol,h1,h2,h3,h4,pre,optgroup,p,blockquote,hr,menu,dir{margin:0;padding:0}
     ul,ol{list-style-type:none;list-style-image:none}
     a{text-decoration:none;color:#333;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}
     /* a:hover{color:#333;} */
     a:visited{color:#333;}
     a:focus{outline:1px dotted}
     html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%;font-size:62.5%}
     body{font-size:14px;line-height:1.5em;color:#333;background:#f5f6f8}
     body,button,input,select,textarea{font-family:'helvetica neue',tahoma,'hiragino sans gb',stheiti,'wenquanyi micro hei',\5FAE\8F6F\96C5\9ED1,\5B8B\4F53,sans-serif;-ms-text-autospace:ideograph-alpha ideograph-numeric ideograph-parenthesis;text-autospace:ideograph-alpha ideograph-numeric ideograph-parenthesis}
     b,strong{font-weight:bold}
     i,em{font-style:normal}
     img{border:0 none;width:auto\9;height:auto;max-width:100%;vertical-align:top}
     article,aside,footer,header,main,nav,section,summary{display:block}
     .g-doc{margin:0 auto;overflow:hidden}
     @media only screen and (min-width:1025px){.g-doc{max-width:320px}}

     /*backgroundcolor*/
     .bg-gray{background-color:#f5f6f8;}
     .bg-white{background-color:#fff;}
     .bg-red{background-color:#ff4949;}
     .bg-yellow{background-color:#fdf3d6;}
     .bg-green{background-color:#32b49a;}

     /*color*/
     .white{color:#fff;}
     .gray{color:#777;}
     .red{color:#dc0f0f;}
     .blue{color:#007adf;}
     .green{color:#2bc86e;}

     /*cur*/
     .boxListA .cur a,.selectConA .cur a{color:#2d7eda; border:1px solid #2d7eda;}

     /*文字溢出用省略号表示*/
     .txt-hide{white-space:nowrap; text-overflow:ellipsis; -o-text-overflow:ellipsis; overflow:hidden;}

     /*head*/
     .header-bg{height:44px;overflow:hidden;position:relative;background-color:#007adf}
     .header-back{float:left;width:45px;height:29px;margin:7px 5px 0 0;position:relative;border-right:1px solid #0d81e1;z-index:999;}
     .header-back:before{content:"";display:block;width:10px;height:10px;border-width:2px;overflow:hidden;border-color:transparent transparent #fff #fff;border-style:solid;position:absolute;top:9px;left: 16px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);}
     .header-back:after{content:"";display:block;width:22px;height:0;border-top: 2px solid #fff;position:absolute;top:15px;left:16px}
     .header-title{line-height:45px;font-size:16px;color:#fff;position:relative;/*overflow:hidden;*/margin-right:5px}
     .header-title a{color:#fff}
     .header-bg a:visited{color:#fff}
     .header-title-nav{display:block;white-space:nowrap;-webkit-transform:translate(0, 0) translateZ(0);overflow-x:auto;overflow-y:hidden; width:67%;}

     /*m-top*/
     .m-top{padding:24px 12px 25px 12px; overflow:hidden;}
     .m-top .col,.m-top .line{float:left;}
     .m-top .col{padding:;}
     .m-top .line{width:1px; margin: 12px 5% 12px 10%; font-size:0; overflow:hidden; height:24px; background-color:#36c3a7;}
     .m-top .m-p1{line-height:24px;}
     .m-top .m-p2{line-height:28px; font-size:23px;}

     /*m-txt*/
     .m-txt{padding:16px 12px; font-size:12px; color:#777;}
     .m-txt-1{padding-top:105px;  font-size:14px;background:#fff url(http://www1.pcauto.com.cn/2015/chedai/wap/icon-false.png) no-repeat 50% 20px; background-size:77px 77px; border-bottom:1px solid #f5f5f5;}

     /*choiceCarBrand*/
     .popCar .pop-inner{width:100%;background-color:#fff;}

     .pop-inner .pop-th{height:21px; line-height:21px; font-size:19px; margin:0 12px 16px 12px;  padding:16px 0 0 0; border-bottom:2px solid #f2f2f2;}
     .pop-inner .pop-th span{display:block; width:46px; border-bottom:2px solid #007adf; text-align:center;}
     .pop-inner .item li{height:40px; line-height:40px; padding:0 10px; font-size:14px; overflow:hidden; border-bottom:1px solid #f5f5f5;}
     .pop-inner .item li em{height:40px; line-height:40px; overflow:hidden;}
     .pop-inner .item li em:nth-child(1){float:left; width:75%;}
     .pop-inner .item li em:nth-child(2){float:right; width:25%; text-align:right;}
     .pop-inner .item .item-th{height:28px; line-height:28px; font-size:12px; background-color:#f0f0f0; color:#777;}
     .pop-inner .pop-icon{width:40px; height:40px; position:absolute; top:123px; left:-40px;border-top-left-radius: 5px; border-bottom-left-radius: 5px; z-index:1000;}

     .pop-icon em{position:relative;}
     .pop-icon em:nth-child(2){margin-left:10px;}
     .pop-icon em::before,.pop-icon em::after{content: ""; font-size: 0; width: 0; height: 0; line-height: 0; overflow: hidden; display: inline-block; border: 0 dashed transparent; border-top-style: solid; position: absolute; border-width:8px; top:50%; margin-left:10px;}
     .pop-icon em::before{border-left-color: #8B8B8B; left:1px;}
     .pop-icon em::after{border-left-color: #fff; left:0px;}


     /*part1*/
     .part1{margin-top:10px;}
     .part2{margin-top:0;}
     /*m-th*/
     .part1 .m-th{font-size:12px; height:36px; line-height:36px; padding:0 12px; border-bottom:1px solid #f5f5f5;overflow:hidden;}
     .part1 .m-th img{float:left; margin:8px 5px 0 0;border-radius:50%;}

     /*m-lstA*/
     .m-lstA{padding:0 12px;}
     .m-lstA li{padding:12px 0 10px 0; border-bottom:1px solid #ddd;}
     .m-lstA li:last-child{border-bottom:1px solid transparent;}
     .m-lstA .m-lstA-name{font-size:16px;}
     .m-lstA .m-lstA-data{margin-top:10px; font-size:12px;}
     .m-lstA .m-lstA-data em{margin-right:10px;}
     .m-lstA .btn-wrap{margin-top:15px; overflow:hidden;}

     /*m-time*/
     .m-time{margin-top:10px; border-bottom:1px solid #f5f5f5;}
     .m-time li{overflow:hidden;}
     .m-time .m-plst-txt{float:left; width:67%; line-height:36px;}
     .m-time .item-wrap{padding:0 12px; }
     /*selectX  item*/
     .selectX{width:100%; overflow:hidden;font-size:0;display:table;word-spacing:-1em;}
     .selectX .item-wrap{overflow: hidden;}
     .selectX .item{ display: block; vertical-align: top; word-spacing: 0;}
     .selectX .item .tit{display:block;overflow:hidden;height:36px;line-height:36px;color:#333;position:relative;cursor:pointer;font-size:14px;-webkit-transform:translate(0px,0px) translateZ(0px);}

     .selectX .item .tit .icon{display:block; float:right; width:16px;height:16px; margin-top:10px;/*overflow:hidden;*/position:relative;/*left:12px;top:10px;*/border:1px solid #333;-wekit-border-radius:16px;-moz-border-radius:16px;-ms-border-radius:16px;border-radius:16px}
     .selectX .item .tit i{text-align:right;}
     .selectX .item .icon::before{display:block;content:"";position:absolute;width:6px;height:6px;border-width: 1px;border-color: transparent;border-top-color: #333;border-right-color: #333; border-style: solid; -webkit-transform: rotate(135deg); right: 4px;top: 2px;}
     .selectX .item.cur .icon::before{top:6px; -webkit-transform:rotate(-45deg);}
     .selectX .item .selectConA{overflow:hidden;zoom:1;}

     .selectConA{overflow:hidden;}
     .selectConA a{display:block; margin:5px auto;width:90%;line-height:30px;height:30px;background:#fff;overflow:hidden;vertical-align:middle;font-size:13px;text-align:center;border:1px solid #fff;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}
     .select-wrap{background:#e7e9ee;margin:0 auto;padding:10px;text-align:left;position:relative;display:none;font-size:14px;}
     .select-wrap::after{content:"\20";clear:both;height:0;display:block;overflow:hidden;}
     .select-wrap i{width: 33.33%; float:left; display: block;float: left;}

     .cur .tit::after{content: "";display: block;width: 0;height: 0;border-width: 6px;overflow: hidden; border-color: transparent transparent #e7e9ee;border-style: solid;position: absolute; top:25px; right:4px;}

     /*m-section*/
     .m-section{padding: 16px 12px;background:#fff;-webkit-tap-highlight-color:rgba(0,0,0,0);}
     .m-section-1{margin:10px 0 25px 0;}

     /*表单*/
     .m-form .u-info{margin-bottom:15px;padding:10px;background:#FDF3D6;color:#DC0F0F;font-size:13px;line-height:18px;}
     .m-form .u-txt {margin-bottom:12px;position:relative;}
     .m-form .u-txt input{width:97%;height:38px;line-height:38px;padding-left:3%;color:#777;font-size:16px;margin-bottom:5px;position:relative;border-radius:2px;border:1px #ddd solid;overflow:hidden;}
     .m-form .u-txt::after{content:"*";width:5px;height:5px;border-radius:5px;color:#FF4949;position:absolute;right:9px;top:18px;-webkit-transform:translateY(-100%);}
     .m-form .u-txt-1{width:65%; float:left;}

     .m-form .u-btn,.m-form .u-btn-1{width:100%;height:40px;line-height:40px;display:block;margin-top:14px; border-radius:2px;font-size:16px;color:#fff;text-align:center;}
     .m-form .u-btn-1{width:30%; margin-top:2px; float:right; background-color:#999;}
     .m-form .u-btn{background:#FF4949;}
     .m-form .u-txt-wrap{overflow:hidden;}

     /*提示语*/
     .tred{color: #dc0f0f; font-size: 12px; display: none; clear: both;}

     /*经销商列表*/
     .m-delist{padding:16px 0 0 0; margin-top:10px;}
     .m-delist .m-th{height:40px;line-height:40px; padding-left:10px; color:#777;font-size:13px;border-bottom:1px #F5F5F5 solid;font-size:15px;}
     .m-delist ul{overflow:hidden;}
     .m-delist li{border-bottom:1px #F5F5F5 solid;padding:10px 0px 10px 42px;position:relative;}
     .m-delist li::before{content:"";width:16px;height:16px;border:1px #E0E0E0 solid;border-radius:16px;display:block;position:absolute;left:10px;top:50%;margin-top:-12px;-webkit-transform:translateY(-50%);}
     .m-delist li.cur::before{content:"";width:16px;height:16px;border:1px #007ADF solid;background:#007ADF;border-radius:16px;display:block;position:absolute;left:10px;top:50%;  margin-top:-12px;-webkit-transform:translateY(-50%);}
     .m-delist li.cur::after{content:"";width:10px;height:4px;display:block;border-left:1px #fff solid;border-bottom:1px #fff solid;position:absolute;left:15px;top:47%; margin-top:-12px;-webkit-transform:rotate(-50deg) translateY(-50%);}
     .m-delist li span{display:block;width:100%;}
     .m-delist li span:first-of-type{line-height:25px;color:#333;font-size:18px;}
     .m-delist li span:last-of-type{line-height:24px;color:#777;}
     .m-delist .u-more{height:45px;line-height:45px;font-size:15px;color:#777;text-align:center;display:none;}
     .m-delist .u-more::after{content: '';display: inline-block;width: 6px;height: 6px;-webkit-transform: rotate(135deg);-moz-transform: rotate(135deg);-ms-transform: rotate(135deg);transform: rotate(135deg);border-top: 1px solid #777;border-right: 1px solid #777;vertical-align: middle;margin-left: 10px;margin-top: -6px;}

     .m-delist-1{padding: 10px 0 0 0;  margin-bottom: 25px;}
     .m-delist-1 li:last-child{border-bottom:none;}

     .m-delist li input { position: absolute; right: 0; top: 0; opacity: 0;}

     /*m-paper*/
     .m-paper{padding:0 10px; font-size:13px; color:#777;}
     .m-paper li{padding-top:28px;}
     .m-paper li:nth-child(1){border-bottom:1px solid #f5f5f5;}
     .m-paper .m-pic{padding:10px;}
     .m-paper .m-pic-1{width:40px;}
     .m-paper .m-pic-wrap{overflow:hidden; text-align:center;}
     .m-pic-wrap .m-pic em{width:40px; height:40px; margin:0 auto; display:block; background:url(http://www1.pcauto.com.cn/2015/chedai/wap/pic.png) no-repeat; background-size:40px 410px;}
     .m-pic-wrap .m-pic .e-1{background-position: 0 -280px;}
     .m-pic-wrap .m-pic .e-2{background-position: 0 -321px;}
     .m-pic-wrap .m-pic .e-3{background-position: 0 -360px;}
     .m-pic-wrap .m-pic .e-4{background-position: 0 -240px;}
     .m-pic-wrap .m-pic .e-5{background-position: 0 -41px;}
     .m-paper .m-pic .e-6{background-position: 0 0;}
     .m-paper .m-pic .e-7{background-position: 0 -163px;}
     .m-paper .m-pic .e-8{background-position: 0 -199px;}
     .m-paper .m-pic .e-9{background-position: 0 -120px;}
     .m-paper .m-pic .e-10{background-position: 0 -82px;}

     .m-pic-wrap .m-pic{float:left; padding:10px 8px;}

     .menu{margin-top:30px;}
     .bd-yellow{border: 1px solid #ffdf82}
     .u-btn{border: 0}
     .m-form .u-btn-1{width: 55%}
     .m-form .u-txt-1{width: 40%}
 </style>
</head>
<body>
 <script>document.body.insertBefore(document.createElement("script"),document.body.firstChild).src="http://count.pcauto.com.cn/count.php?channel={{{@root.pageCountId}}}&screen="+screen.width+"*"+screen.height+"&refer="+encodeURIComponent(document.referrer)+"&anticache="+new Date().getTime()+"&url="+encodeURIComponent(location.href)+"&uuid="+encodeURIComponent({{data.model.serialGroupId}}+":1");</script>

<div class="g-doc">
    <!--头部-->
    <script src="http://www.pcauto.com.cn/global/wap/header_js/" charset="utf-8" class=" defer"></script>
    <!--/头部-->
    <div class="header-bg">
        {{#equal param.isHelper '1'}}
        <a onclick="history.back(-1)" class="header-back" title=""></a>
        {{else}}
        <a onclick="goBackChoose()" class="header-back" title=""></a>
        {{/equal}}
        <div class="header-title">
            <span class="header-title-nav">
                <a href="http://{{{@root.host}}}/">首页</a>>
                {{#equal param.isHelper 1}}购车小秘{{else}}我要贷款{{/equal}}</span>
        </div>
    </div>
    {{#isObject data.product}}
    <div class="m-top bg-green white">
        <div class="col col-1">
            <p class="m-p1">预计可贷款金额(元)</p>
            <p class="m-p2">{{data.loan}}</p>
        </div>
        <div class="line"></div>
        <div class="col col-2">
            <p class="m-p1">购车最低首付</p>
            <p class="m-p2">{{data.proportion}}%</p>
        </div>
    </div>
            {{#equal param.isHelper '0'}}
            {{#equal data.isConform '1'}}
            <div class="m-txt bg-white">恭喜您，您只需要掏<span class="red">{{data.payment}}万</span>
                就能买到裸车价值{{data.price}}万的车(不含购置税、保险及其它费用) ，提高首付，更多好车等着您。</div>
            {{else}}
            <div class="m-txt bg-white">
             根据您的资质及产品选择，暂时不符合<span class="red">“{{data.productName}}”</span>产品；我们将为您推荐以下贷款产品：</div>
           {{/equal}}
           {{else}}
           <div class="m-txt bg-white">恭喜您，根据您的资质及车型的选择，我们将为您推荐"{{data.product.productName}}"产品</div>
           {{/equal}}


    <div class="part1 bg-white">
        <div class="m-th gray">
            <img style="width:20px;height:20px"src="{{data.product.icon}}"/>
            <em>{{data.product.orgName}}</em>
        </div>
        <ul class="m-lstA bg-white"  id="Jcon1">
            <li>
                <p class="m-lstA-name">{{data.product.productName}}</p>
                <p class="m-lstA-data gray">
                    <em>月供：<span class="red">{{data.product.payment}}元</span>起</em>
                    <em>贷款成本：{{data.product.cost}}万</em>
                </p>
            </li>
            {{#isObject data.model}}
            <li>
                <p class="m-lstA-name">选择车型：{{data.model.name}}</p>
                <p class="m-lstA-data gray">
                    {{data.model.title}}
                </p>
            </li>
            {{/isObject}}
        </ul>
    </div>
    {{else}}
    <div class="m-txt m-txt-1 bg-white">抱歉，暂时没有适合您当前条件的金融产品。留下您的信息，我们为您推荐以下经销商办理车贷并提供购车咨询：</div>
    {{#isObject data.model}}
    <div class="part1 part2 bg-white">
        <ul class="m-lstA bg-white"  id="Jcon1">
            <li>
                <p class="m-lstA-name">选择车型：{{data.model.modelName}}</p>
                <p class="m-lstA-data gray">
                    {{data.model.title}}
                </p>
            </li>
        </ul>
    </div>
    {{/isObject}}
    {{/isObject}}
    {{#equal param.isHelper "1"}}
    <div id="u-btn">
    <ul class="m-time bg-white hide">
        <li class="m-plst-c">
            <div class="selectX" id="JselectX">
                <div class="item-wrap" id="JitemWrap">
                    <div class="item item1" >
                        <a class="tit">
                            <span class="mark"><div class="m-plst-txt">您的购车时间:</div><i>一个月内</i></span></span>
                            <span class="icon"></span>
                        </a>
                    </div>
                </div>
                <div class="pop-wrap" id="JpopWrap">
                    <div class="select-wrap" id="Jselect1">
                        <input type="hidden" name="" value="30" id="gcTime">
                        <div class="selectConA">
                            <i><a href="javascript:;" data-value="7">一周内</a></i>
                            <i  class="cur"><a href="javascript:;"  data-value="30">一个月内</a></i>
                            <i><a href="javascript:;"  data-value="90">三个月内</a></i>
                            <i><a href="javascript:;"  data-value="180">六个月内</a></i>
                            <i><a href="javascript:;"  data-value="200">六个月以上</a></i>
                        </div>
                    </div>
                </div>
            </div>
        </li>
    </ul>

    <div class="m-section m-form"  >
        <div class="u-txt"><input type="text" placeholder="请输入您的称呼（如夏先生）" id="chenghu"><i class="tred"></i></div>
        <div class="u-txt"><input type="text" placeholder="请输入手机号" id="telephone"><i class="tred"></i></div>
        <div class="u-txt-wrap">
            <div class="u-txt u-txt-1">
                <input type="text" placeholder="请输入验证码" id="checkCode">
                <i class="tred"></i>
            </div>
            <a href="javascript:;" class="u-btn-1" id="yzm">免费获取短信验证码</a>
        </div>
        <a href="javascript:void(0)" class="u-btn" id="u-btn">提交</a>
        <div style="color: red;text-align:center;margin: 5px auto;" id="confirmResult"></div>
    </div>
    </div>
    {{else}}
    {{#equal param.hasData "1"}}
    <div class="m-section m-form"  >
          <a href="javascript:void(0)" class="u-btn">提交</a>
           <div style="color: red;text-align:center;margin: 5px auto;" id="confirmResult"></div>
    </div>
    {{else}}
    <div class="m-section m-form"  >
        <div class="u-txt"><input type="text" placeholder="请输入您的称呼（如夏先生）" id="chenghu"><i class="tred"></i></div>
        <div class="u-txt"><input type="text" placeholder="请输入手机号" id="telephone"><i class="tred"></i></div>
        <a href="javascript:void(0)" class="u-btn">提交</a>
        <div style="color: red;text-align:center;margin: 5px auto;" id="confirmResult"></div>
    </div>
    {{/equal}}
    {{/equal}}
    {{#if dealers.dealerList}}
    <div class="m-section m-delist">
        <div class="m-th">选择多个经销商对比，可获更全面的参考</div>
        <ul id="Jdelist">
            {{#each dealers.dealerList}}
            <li {{#compare 1 @index}}class="cur"{{/compare}} data-li="{{dealerId}}">
                <span>[{{agent}}]{{name}}</span>
                <span class="txt-hide">地址：{{address}}</span>
            </li>
            {{/each}}
        </ul>
    </div>
  {{/if}}

    <div class="m-paper bg-white">
        <ul>
            {{#isObject data.above}}
            <li>
                <div class="m-th">首付<span class="green">{{data.ratio}}%以上</span>，您只需要以下证明材料即可办理贷款</div>
                <div class="m-pic-wrap">
                {{#each data.above}}
                <div class="m-pic">
                    <em class="e-{{materialTypeId}}"></em>
                    <p>{{materialTypeName}}</p>
                </div>
                {{/each}}
                </div>
            </li>
            {{/isObject}}
            {{#isObject data.below}}
            <li>
                <div class="m-th">首付<span class="red">{{data.ratio}}%以下</span>，您需要</div>
                <div class="m-pic-wrap">
                    {{#each data.below}}
                    <div class="m-pic">
                        <em class="e-{{materialTypeId}}"></em>
                        <p>{{materialTypeName}}</p>
                    </div>
                    {{/each}}
                </div>
            </li>
            {{/isObject}}
        </ul>
    </div>

    <!-- 公共底部-->
    <script src="http://www.pcauto.com.cn/global/wap/footer_js/" charset="utf-8" class=" defer"></script>
    <!--/公共底部-->
</div>

<script src="http://js.3conline.com/wap/2013/common/js/zepto.min.js"></script>
<script>
    var param={{{json param}}};
    var isNotRepeat=1;
    var Cookie = {
        get: function(check_name) {
            check_name = encodeURIComponent(check_name);
            var a_all_cookies = document.cookie.split(';');
            var a_temp_cookie = '';
            var cookie_name = '';
            var cookie_value = '';
            var b_cookie_found = false;
            var i = '';
            var len = a_all_cookies.length;
            for (i = 0; i < len; i++) {
                a_temp_cookie = a_all_cookies[i].split('=');
                cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
                if (cookie_name == check_name) {
                    b_cookie_found = true;
                    if (a_temp_cookie.length > 1) {
                        cookie_value = unescape(decodeURI(a_temp_cookie[1]).replace(/^\s+|\s+$/g, ''));//对url进行解码再进行处理
                    }
                    return cookie_value;
                    break;
                }
                a_temp_cookie = null;
                cookie_name = '';
            }
            if (!b_cookie_found) {
                return null;
            }
        },
        set: function(name, value, expires, path, domain, secure) {
            var today = new Date();
            today.setTime(today.getTime());
            if (expires) {
                expires = expires * 1000 * 60 * 60 * 24;
            }
            var expires_date = new Date(today.getTime() + (expires));
            document.cookie = encodeURIComponent(name) + "=" + value +
                    ((expires) ? ";expires=" + expires_date.toGMTString() : "") +
                    ((path) ? ";path=" + path : "") +
                    ((domain) ? ";domain=" + domain : "") +
                    ((secure) ? ";secure" : "");
        },
        remove: function(name) {
            Cookie.set(name,null, -1, "/", "{{{@root.cookieHost}}}");
        }
    };

    //提交参数的设置
    var product={{{json data.product}}};
    var confirmInfo=JSON.parse(Cookie.get("confirmInfo"));

    /**以下部分用于限制url，禁止直拉访问开始**/
    if(confirmInfo==null){
        location.href="http://{{@root.host}}/";
    }

    if(param.isHelper==0&&confirmInfo&&Cookie.get("loanInfo")){//立即申请
        var phone=param.tel;
        var cookiePhone=JSON.parse(Cookie.get("loanInfo")).phone;
        if(phone!=cookiePhone){
            location.href="http://{{@root.host}}/";
        }
    }
    /**以上部分用于限制url，禁止直拉访问结束**/
    if(product.productId)  confirmInfo.productId=product.productId;
    if(product.prepay) confirmInfo.downPayment=product.prepay;
    if(product.term) confirmInfo.periods=product.term;
    if(product.cost)confirmInfo.cost=product.cost;
    if(product.orgId)confirmInfo.orgId=product.orgId;
    if(Cookie.get("loanInfo")){
        var loanInfo=JSON.parse(Cookie.get("loanInfo"));
        confirmInfo.phone=loanInfo.phone;
        if(loanInfo.name) confirmInfo.name=loanInfo.name;
    }
    var model={{{json data.model}}};
    if(model.modelId)confirmInfo.modelId=model.modelId;
    if(model.serialGroupId)confirmInfo.serialGroupId=model.serialGroupId;
    var averagePrice="{{data.price}}";
    if(averagePrice)confirmInfo.averagePrice=averagePrice;
    if(param.isHelper=="1"){
        if(param.hasData=="1"&&Cookie.get("loanInfo")){
            $("#u-btn .u-txt").hide();
            $("#u-btn .u-txt-wrap").hide();
        } else if(param.hasData!=1){
            $("#u-btn .u-txt-wrap").hide();
            $(".m-plst-c").hide();
        }

    }



    //获取id
    function $$(id) {
        return (typeof id == "object") ? id : document.getElementById(id);
    }

    /*************************筛选****************************/
    if(param.isHelper==1){
                var items = $$("JitemWrap").querySelectorAll(".item");
                var selectWraps = $$("JpopWrap").querySelectorAll(".select-wrap");
                for(var i=0; i< items.length; i++){
                    items[i].index=i;
                    selectWraps[i].index=i;

                    items[i].onclick=function(){
                        if(selectWraps[this.index].style.display=="block"){
                            items[this.index].className ="item";
                            selectWraps[this.index].style.display="none";

                        }else{
                            for(var j=0; j<items.length; j++){
                                items[j].className ="item";
                                selectWraps[j].style.display="none";
                            }
                            items[this.index].className +=" cur";
                            selectWraps[this.index].style.display="block";
                        }
                    }
                }
    }


    //高亮选择
    //动态获取id
    function setID(classname){
        var ids=document.querySelectorAll(classname);
        for(var i=0,len=ids.length;i<len;i++){
            index=i+1;
            ids[i].setAttribute("id",'Jselect'+index);
        }
    }
    setID('.select-wrap');

    function statusA(id,index){
        var toc=$(id+' i');
        var box=$('#JitemWrap i');
        toc.each(function(k,elem){
            toc.eq(k).click(function(){
                var toctxt=toc.eq(k).children("a").html();
                var tocValue=toc.eq(k).children("a").attr("data-value");
                $("#gcTime").val(tocValue);
                box.eq(index).html(toctxt);
                toc.eq(k).addClass('cur').siblings().removeClass('cur');
                $(id).hide();
                $('#JitemWrap .item').removeClass('cur');
            })
        })
        if(Cookie.get("loanInfo")){
            $(".hide").hide();

        }
    }

    statusA('#Jselect1',0);

    /*************************筛选****************************/

    /*************************验证码时间倒计时[ps:如果需要倒计时则加上这段js]********************/
     var gotime=1;
     var f=60;
     function settime(){
         document.getElementById("yzm").innerHTML=f+"秒后可重新发送";
         if(f<=0){
             document.getElementById("yzm").innerHTML="免费获取短信验证码";
             document.getElementById("yzm").style.color="#fff";
             document.getElementById("yzm").style.fontSize="16px";
             gotime=1;
         }else{
             gotime=0;
             f-=1;
             setTimeout('settime();',1000);
         }
     }
    if(document.getElementById("yzm")) {
        document.getElementById("yzm").onclick = function () {
            var isOk = true;
            var phone = document.getElementById("telephone").value;
            if (document.getElementById("telephone")) {
                var tel = document.getElementById("telephone");
                if (!tel.value) {
                    showTips(tel, "请输入手机号");
                    isOk = false;
                }
                if (!(/^1[3|4|5|8][0-9]\d{8}$/.test(tel.value))) {
                    showTips(tel, "请输入正确的手机号");
                    isOk = false;
                }
            }
            if (!isOk) return;
            if (gotime == 0) {
                return;
            }
            f = 60;
            document.getElementById("yzm").style.color = "#333";
            document.getElementById("yzm").style.fontSize = "12px";
            var url = "http://{{{@root.host}}}/jrproxy/jr.pcauto.com.cn/interface/outer/mobile/sendCode.jsp?phone=" + tel.value;
            confirmAjax(url, "", function (data) {
                //data.code==0表发送成功
                if (data.code == 0) {
                    console.log("发送验证码成功");
                }
            });
            settime();
        }
    }
    /*************************时间倒计时********************/

    /****************经销商点击选中效果********************/
    function status(){
        var toc=$('.m-delist li');
        toc.each(function(k,elem){
            $(this).bind('click',function(){
                if($(this).hasClass('cur')){
                    $(this).removeClass('cur');
                }else{
                    $(this).addClass('cur');
                }
            })
        })
    }
    status()
    /****************经销商点击选中效果********************/

    /*******************表单输入效果***********************/
    function onchange(){
        var num=$('form .u-txt input')[0];
        var name=$('form .u-txt input')[1];
        var code=$('form .u-txt input')[2];
        var numval=$(num).attr('value');
        var nameval=$(name).attr('value');
        var codeval=$(code).attr('value');
        $(num).focus(function(){
            if(numval=='请输入手机号'){
                $(num).attr('value','');
            }
        })
        $(num).blur(function(){
            if(numval=="" || numval=='请输入手机号'){
                $(num).attr('value','请输入手机号');
            }
        });
        $(name).focus(function(){
            if(nameval=='请输入您的称呼（如夏先生）'){
                $(name).attr('value','');
            }
        })
        $(name).blur(function(){
            if(nameval=="" || nameval=='请输入您的称呼（如夏先生）'){
                $(name).attr('value','请输入您的称呼（如夏先生）');
            }
        });

        $(code).focus(function(){
            if(codeval=='请输入验证码'){
                $(code).attr('value','');
            }
        })
        $(code).blur(function(){
            if(codeval=="" || codeval=='请输入验证码'){
                $(code).attr('value','请输入验证码');
            }
        });
    }
    onchange();
    /*******************表单输入效果***********************/

    /**
     * 表单submit
     */
    function submitF(){

        //提交事件
       $(".u-btn").click(function(){
           var temp=[];

           $("#Jdelist .cur").each(function () {
                   temp.push($(this).attr("data-li"));
               });

           if(temp.length==0){
                   temp.push($("#Jdelist li").eq(0).attr("data-li"));
           }

           confirmInfo.dealerIds=temp.length!=0?temp.join(","):"";//没有时设置为空

           if(param.hasData==0){
                      if(confirmValid()){
                          confirmInfo.phone=$("#telephone").val();
                          confirmInfo.name=$("#chenghu").val();
                          confirmInfo.buyTime=$("#gcTime").val();
                          addOrder();
                      }
           }else{
               confirmInfo.level=3;
               if(confirmInfo.phone==undefined){
                   if(Cookie.get("loanInfo")){
                       var loanInfo=JSON.parse(Cookie.get("loanInfo"));
                       confirmInfo.phone=loanInfo.phone;
                       if(loanInfo.name) confirmInfo.name=loanInfo.name;
                       thirdOrder();
                   }else{
                      if(confirmValid()){
                          var isOk=true;
                          validCode( $("#telephone").val(),$("#checkCode").val(),function(data){
                              if(isOk&&data.code==0){
                                  confirmInfo.phone=$("#telephone").val();
                                  confirmInfo.name=$("#chenghu").val();
                                  confirmInfo.buyTime=$("#gcTime").val();
                                  thirdOrder();//三级订单输入
                              }else{
                                  var ckc = document.getElementById("checkCode");
                                  showTips(ckc,"验证码错误，请重试");
                                  isOk=false;
                              }
                          });
                      }
                   }
               }else{
                //   console.log(702)
                   thirdOrder();
               }

           }
       });
    }

    //徇价
    function addOrder(){
        var urlToken = 'http://{{{@root.host}}}/jrproxy/price.pcauto.com.cn/interface/token/applyToken.jsp';
        var token="";
        $.ajax({
            type: 'GET',
            timeout : 3000,
            url: urlToken,
            dataType: 'jsonp',
            error:function(){
                $("#confirmResult").html("操作失败，请重试！");
            },
            // jsonp: 'callback',//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(默认为:callback)
            success: function (v) {
                token = v.token;
                console.log(token);
                var url="http://{{{@root.host}}}/jrproxy/price.pcauto.com.cn/dealer/action/add_order.jsp?ad={{{@root.applyCountId}}}";
                var confirmData={"dIds":confirmInfo.dealerIds,"serialGroupId":confirmInfo.serialGroupId,"modelId":confirmInfo.modelId,
                    "regionId":confirmInfo.regionId,"name":confirmInfo.name,"phone":confirmInfo.phone,"ip":param.ip,"refererType":2,
                    "origin":2,"payType":0,"html_TOKEN":token};
                confirmAjax(url,confirmData,function (data){
                    //徇价成功页
                    if(data.status==1){//发送成功
                        Cookie.remove("confirmInfo");//删除提交信息
                        setTimeout(function(){
                            location.href="http://{{{@root.host}}}/success/"+getWx();// 询价成功页，不带参数
                        },500)
                    }else{
                       $("#confirmResult").html("徇价失败，请重试！");
                    }
                });

            }
        });
                //跳转到徇价页面

    }


    //三级订单
    function  thirdOrder(){
        var url="http://{{{@root.host}}}/jrproxy/jr.pcauto.com.cn/interface/outer/mobile/apply.jsp?ad={{{@root.applyCountId}}}";
        confirmInfo.channelType=is_weixinSrc();
        confirmInfo.ip='{{{param.ip}}}';
        confirmInfo.pcsuv=Cookie.get("pcsuv");
        var params={"data": JSON.stringify(confirmInfo)};
        if(isNotRepeat) {
            confirmAjax(url, params, function (data) {
                //跳转成功页面
                if (data.code == 0) {
                    //已经成功
                    if (!Cookie.get("loanInfo")) {
                        var loanInfo = {};
                        loanInfo.phone = confirmInfo.phone;
                        if (confirmInfo.name) {
                            if (confirm.name != "")
                                loanInfo.name = confirmInfo.name;
                        }
                        Cookie.set('loanInfo', encodeURI(JSON.stringify(loanInfo)), 1, "/", "{{{@root.cookieHost}}}");
                    }
                    isNotRepeat=0;
                    Cookie.remove("confirmInfo");//删除提交信息
                    location.href = "http://{{{@root.host}}}/success/r" + param.rId + "/qr" + data.id + "/" + getWx();// 询价成功页，不带参数
                } else {
                    $("#confirmResult").html("申请失败，请重试！");
                }
            });
        }
    }

   function validCode(telephone,checkCode,callback){
       var sendUrl="http://{{{@root.host}}}/jrproxy/jr.pcauto.com.cn/interface/outer/mobile/checkCode.jsp?phone="+telephone+"&code="+checkCode;
       confirmAjax(sendUrl,"",function(data) {
            callback(data);
       });
   }


    // 检查 验证码
    function checkCode(phone,checkCode){
        return true;
    }
    function confirmAjax(url,params,callback){
        //代理处理ajax异步请求
        $.ajax({
            url: url,
            data:params,
            type:'POST',
            //timeout : 3000,
            dataType:"json",
            error: function(){
                console.log("ajax error");
                $("#confirmResult").html("操作失败，请重试！");
            },
            success: function (data) {//一级订单提交成功
//                console.log("提交的参数：isHelper"+param.isHelper+"==>level:"+param.level+JSON.stringify(params))
//                console.log("提交结果如下\n");
//                console.log(data);
                callback(data);
            }
        });
    }


    submitF();
    function inputValue(elem,tips){
        var gct = $$(elem);
        //有默认，自动获取先。
        if(gct.parentNode.getElementsByTagName("i")){
            var gcti = gct.parentNode.getElementsByTagName("i");
            var gctin = gcti.length;
            for(var i=0;i<gctin;i++){
                if(gcti[i].className.indexOf("cur")!=-1){
                    gct.value= gcti[i].childNodes[0].getAttribute("data-value");
                }
            }
        }
        if(!gct.value){openPop(tips); return false}
    }
    //显示提示语
    function showTips(obg,str){
        if(obg.parentNode.getElementsByTagName("i").length>0){
            var obi = obg.parentNode.getElementsByTagName("i")[0];
            if(obi.className.indexOf("tred")!=-1){
                obi.style.display = "block";
                obi.innerHTML = str;
            }
        }

    }
    //隐藏tred
    function htred(){
        if(document.querySelectorAll(".tred").length>0){
            var bii = document.querySelectorAll(".tred");
            var biin = bii.length;
            for(var i=0;i<biin;i++){
                bii[i].style.display = "none";
            }
        }
    }

    function confirmValid(){
        var isOk = true;
        //隐藏tred
        htred();

        if(document.getElementById("telephone")){
            var tel = document.getElementById("telephone");
            if(!tel.value){showTips(tel,"请输入手机号");isOk = false;}
            if (!(/^1[3|4|5|8][0-9]\d{8}$/.test(tel.value))) {showTips(tel,"请输入正确的手机号");isOk = false;}
        }
        if(document.getElementById("chenghu")){
            var cho = document.getElementById("chenghu");
           var  value1=cho.value.replace(/^\s+|\s+$/g, '');
            if(!value1){showTips(cho,"请输入您的称呼");isOk = false;}
            if(cho.value.length>5){
                showTips(cho,"请填写5位数的称呼");
                isOk=false;
            }

        }
        if($(".u-txt-wrap").css("display")!="none"&&document.getElementById("checkCode")){
            var ckc = document.getElementById("checkCode");
            if(ckc.style.display!="none"){
                if(!ckc.value){showTips(ckc,"请输入验证码");isOk = false;}
            }

        }

        //购车时间
        if(document.getElementById("gcTime")){inputValue("gcTime","请选择购车时间");}
        return isOk;
    }

    //是否是微信端输入
    function  getWx(){
        var str="";
        if(param.browser=="wx"){
            str="wx/";
        }
        return str;
    }

    function goBackChoose()
    {
        var phone=param.tel;
        var cookiePhone=JSON.parse(Cookie.get("loanInfo")).phone;
       if(phone==cookiePhone){
           var parentURL=param.parentURL.replace("?isChooseBack=1","");
           location.href="http://"+parentURL+"?isChooseBack=1"
       }else{
           history.back(-1);
       }
    }



    function is_weixinSrc() {
        var ua = navigator.userAgent.toLowerCase();
        return (/micromessenger/.test(ua)) ? 5 : 2 ;
    }


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