<!--标签零售样式-->
<style>
#asideBox .bq1 { background: url("<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/bq_sprites.png") no-repeat 0 -138px ;}
#asideBox .on .bq1{ background: url("<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/bq_sprites.png") no-repeat 0 0 ;}
.bq-record{border-collapse: collapse; border-spacing: 0;table-layout: fixed;margin:20px 10px;}
.bq-record td,.bq-record th{border: solid 1px #d9d9d9; padding: 3px;text-align: center;height: 30px;width: 5%;}
.bq-record th{color:#333;background-color: #ebebeb;}
.bq-record td{color: #333;}
</style>
<!--标签零售样式结束-->
<!---->
<div id="centre" class="layout">
		<div class="centreInner ">
				<div class="mainInner radius5 ">
						<div class="fgTitleBox fgTitleBox_school">
								<table class="table">
										<tbody>
												<tr>
														<td class="w20">&nbsp;</td>
														<td align="left">购买确认</td>
												</tr>
										</tbody>
								</table>
						</div>
						<!---->
						<div class="belongBox radius5">
								<div class="pay_school_dt">购买产品：<span class="c">学区房-<?=$blockName?></span></div>
						</div>
						<!---->
						
						<div class="belongBox belongBox_visible radius5">
								<div class="select_house_name_box">
										<div class="text clearfix">
												<p class="t">温馨提示：</p>
												<p class="info"> 1.请选择<strong class="c">1条</strong>二手房房源作为推广房源，<br>
														2.推广房源必须为<strong class="c"><?=$blockName?></strong> 挂靠小区的房源 </p>
										</div>
										<div class="select_house clearfix">
												<div class="t">推广房源：</div>
												<div class="info">
													<!--		<div class="input_m">
																<div class="tex">请选择推广房源</div>
														</div>-->
                                                        <input type="hidden" value="" name="rowid" class="js_hidden_input">
														<div class="input_m input_s"><div class="tex" id="js_select_house"> </div></div> 
												</div>
										</div>
								</div>
						</div>
						
						<!---->
						
						<div class="branchCommon branchCommon_pay branchCommon_pay_school radius5 "   >
								<div class="title"><span class="h4">请选择房源</span><span class="c">力学小学挂靠小区的二手房&nbsp;&nbsp;&nbsp;我有以下房源</span></div>
								<div class="hd">
										<table class="tableExpert">
												<tr>
														<td class="td f w185">小区名</td>
														<td class="td w345">详情</td>
														<td class="td w195">房源编号</td>
														<td class="td">操作</td>
												</tr>
										</table>
								</div>
								<div class="mod mod_school" id="js_list_scoll">
										<table class="tableExpert">
                                            <?php if(is_array($houseList)&&!empty($houseList)){?>
                                              <?php foreach ($houseList as $value){?>
												<tr>
														<td class="td f w185"><?=$value['blockshowname']?></td>
														<td class="td w345"><?=$value['room']?>室<?=$value['hall']?>厅 / <?=$value['buildarea']?>㎡ / <?=$value['price']?>万</td>
														<td class="td w195"><?=$value['id']?></td>
														<td class="td"><input id="<?=$value['id']?>" name="radio_school" type="radio" class="js_radio_school" ></td>
												</tr>
                                                <?php }?>
                                            <?php }?>
										</table>
								</div>
								<div class="bd">
										<div class="bd_school_zw_qk"> 
												<img alt="" class="left" src="<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/pay_ico_zx13.png">
												<div class="left tex">我要支付<span class="c"><?=$price?></span>房豆</div>
										</div>
										<div class="bd_school_zw_btn clear"> 
											<a href="javascript:void(0)" class="btnB btnSubmit radius5" id="sub">立即支付</a> <a href="javascript:void(0)" class="btnB btnCon radius5" onclick="history.go(-1)">取消</a> 
										</div>
								</div>
						</div>
				</div>
		</div>
</div>
<input id="subType" type="hidden" name="subType" value="<?=$subType?>">
<input id="schoolId" type="hidden" name="schoolId" value="<?=$sid?>">
<script type="text/javascript" src="<?=STATIC_SOURCE_URL?>/min/?f=common/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
$(function(){
	
	$(".js_radio_school").change(function(){
			var tex1 =$(this).parents("tr").find("td:eq(0)").text();
			var tex2 =$(this).parents("tr").find("td:eq(1)").text();
			var tex3 =$(this).parents("tr").find("td:eq(2)").text();
			var tex4 =tex1+" "+tex2+" "+"【"+tex3+"】"
			$("#js_select_house").text(tex4);
            var _id = $(this).attr("id");
            $(".js_hidden_input").val(_id);
             
	})

	
	
	if(window.XMLHttpRequest)
	{
		(function($){
			$(window).load(function(){
				if($("#js_list_scoll").length>0)
				{
					$("#js_list_scoll").mCustomScrollbar();
				}
			});
		})(jQuery);
	}
    
    
      $("#sub").click(function(){
           var subType = $("#subType").val();
           var houseid = $(".js_hidden_input").val()
           var schoolId = $("#schoolId").val();
           if(!houseid){
               alert("请选择房源！");
               return false;
           }
           $.ajax({
                type: 'post',
                url : '/vas_set_promot/schoolHouseBuy/',
                data: 'subType='+subType+'&houseid='+houseid+'&sid='+schoolId,
                dataType:'json',
                success: function(msg){
                    if(msg['status']==1){
                        $("#waring_text").html("交易号："+msg['transaction_id']);
                        openWin("warning1");
                        window.setTimeout("window.location.href='/vas_set_promot/myList/'; ",3000);
                    }else{
                          openWin("warning2");
                    }
                }
            });
      })
	
	
	
})
</script>

</body>
</html>

<div style="display:none;" class="dialog dialogW340 radius5" id="warning1">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/okBg.png"> 恭喜您，购买成功！</div>
				<div class="textHd_new textHd_new02">
						<p> 购买产品：<span class="c2">定投推广&mdash;学区房</span></p>
						<p id="waring_text"></p>
						<p>温馨提示：工作人员会尽快给您排期反馈，</p>
						<p>您可以在<a class="c1" href="/vas_set_promot/myList/">我的购买记录</a>中查看实时进度。</p>
				</div>
		</div>
</div>
<div style="display:none;" class="dialog dialogW340 radius5"  id="warning2">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/failureBg.png"> 很遗憾，购买失败！</div>
				<div class="textHd_new">
						<div class="textHd_new_link "><a href="###" class="close-win">再试一次吧！</a></div>
				</div>
		</div>
</div>
