<!--标签零售样式-->
<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>
<!--标签零售样式结束-->
<style>
.sm_c{color: #ff7d00;}
.sm_input_m {
margin-top: 10px;
width: 416px;
height: 28px;
border: 1px solid #bebebe;
line-height: 28px;
color: #999;
background-color: #fff;}
.sm_input_m .tex{ color:#666666}
.sm_input_m .tex span{ padding:0 10px;}
.select_house_name_box .sm_t { width: 100px;float: left; text-align: right; font-size: 14px; padding-top:14px; color:#333; font-weight:bold}
</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">房源包装—视频看房</span></div>
      </div>
      <!---->
      
      <div class="belongBox belongBox_visible radius5">
        <div class="select_house_name_box">
          <div class="select_house clearfix clear">
            <div class="clearfix">
              <div class="sm_t">选择房源：</div>
              <div class="info">
                <div class="input_m">                 
                  <div class="tex">请选择 <span class="sm_c">精装修的1条二手房源作为推广房源</div>
                </div>
              </div>
            </div>
          </div>
          <div class="select_house clearfix">
            <div class="clearfix">
              <div class="sm_t">所选房源：</div>
              <div class="info">
                <div class="js_select_house sm_input_m">
                  <input type="hidden" value="" class="js_hidden_input">
                 <div class="tex inputcontent">请选择推广房源</div>
                </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">本人符合条件的全部二手房源</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($house_all) && !empty($house_all)) {
                            $n = 1;
                            foreach($house_all as $key=>$value) {
                                $street = $this->street_model->find_by_id($value['streetid']);
                                ?>
                        <tr <?php if($n%2==0) {
                             echo 'class="bg"';
                               }?>>
                            <td class="td f w185"><?php echo $value['blockshowname'];?></td>
                            <td class="td w345"><?php echo $value['room'].'室'.$value['hall'].'厅';?> / <?php echo ceil($value['buildarea']);?>㎡ / <?php echo ceil($value['price']);?>万 / <?php echo $value['district'];?> / <?php echo  $street['streetname'];?></td>
                            <td class="td w195"><a href="<?php echo get_sellinfo_url($value['id']);?>" target="_blank"><?php echo $value['id'];?></a></td>
                            <td class="td"><input type="radio" id="<?php echo $value['id'];?>" streetid="<?php echo $value['streetid'];?>" class="js_checkbox_house"></td>
                        </tr>
                     <?php
                                $n++;
                            }
                            }
                            ?>
            
          </table>
        </div>
        <div class="bd">
          <div class="bd_school_zw_qk">
              <?php
                     $price_sell=$price['current_price']==0?$price['cost_price']:$price['current_price'];
               ?>
            <div class="left tex tex2">我要支付<span class="c"><?php echo $price_sell;?></span>房豆</div>
          </div>
          <div class="bd_school_zw_btn clear"> 
               <?php if($info['credit']>=$price_sell) { ?>
                     <a href="javascript:void(0)" class="btnB btnSubmit radius5" id="sub">立即支付</a>
               <?php }else { ?>
                     <a href="<?=$payment_url?>" class="btnB btnSubmit radius5" target="_blank">立即充值</a>
               <?php }?>
              <a href="javascript:void(0)" class="btnB btnCon radius5">取消</a> </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript" src="<?=STATIC_SOURCE_URL?>/min/?f=common/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script>
$(function(){
	
	$(".js_checkbox_house").change(function(){      
			var _id = $(this).attr("id");           
			var obj = $(".js_select_house");
			var num = obj.length;      
			if(this.checked){
                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+"】";                              
                $(".inputcontent").text(tex4);
                $(".js_hidden_input").val(_id);		
                $(":radio").each(function(){                   
                    if($(this).attr("id")!=_id){
                        $(this).removeAttr("checked");                        
                    }        
                })                
					
			}	
	})	
	
	if(window.XMLHttpRequest)
	{
		(function($){
			$(window).load(function(){
				if($("#js_list_scoll").length>0)
				{
					$("#js_list_scoll").mCustomScrollbar();
				}
			});
		})(jQuery);
	}    
    
     $("#sub").click(function(){ 
       
        //检查是否选择房源 
        var rowid = $(".js_hidden_input").val();       
         if(isNaN(rowid)||rowid==""){
             alert("请选择房源！");
             return false;
         }
         $.ajax({
            type: 'post',
            url : '/vas_packing_house/addorder_video/',
            data: 'rowid='+rowid,
            dataType:'json',
            success: function(msg){
                if(msg['status']==1){
                    $("#waring_text").html("交易号："+msg['transaction_id']);
                    openWin("warning1");
                    window.setTimeout("window.location.href='/vas_packing_house/orderlist/'; ",4000);
                }else if(msg['status']==2){
                    openWin("warning3");
                }else{
                    openWin("warning2");
                }
                
            }
       });         

    })	
	
	
})
</script>
<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_packing_house/orderlist/">我的购买记录</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>
<div style="display:none;" class="dialog dialogW485 radius5" id="warning3">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod005">购买产品：<span class="ch">房源包装-视频看房</span></div>
				<div class="sb_text_box" style="padding-left: 146px;">
						<p class="p">温馨提示：1.请选择<span class="c1">1条</span>二手房源作为推广房源。
								<br>2.推广房源必须是<span class="c1">精装修</span>房源。 </p>
						<p class="p">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;很遗憾您的房源不满足条件
							        <a class="c2" href="/sell/add/" target="_blank">去发布房源 &gt;&gt;</a><br>
								</p>
				</div>
				<div class="img_pirce_box"> <img src="<?=STATIC_SOURCE_URL?>/zsb/images/v1.0/pay_ico_zx13.png" class="img"> <span>我要支付<strong class="num"><?php echo $price['current_price']?$price['current_price']:$price['cost_price'];?></strong>房豆</span> </div>
				<div class="pop_pay_btn_box"> <a href="javascript:void(0)" class="btn btnCon btnCon_none radius5">确认支付</a> <a href="javascript:void(0)" class="btn btnCon radius5 close-win">取消</a> </div>
		</div>
</div>
</body>
</html>
