<?php /* Smarty version Smarty-3.1.8, created on 2015-11-25 13:51:01
         compiled from "D:\wwwroot\o2o\htdocs\themes\default\xiche\order\goods.html" */ ?>
<?php /*%%SmartyHeaderCode:230615650371a6dc409-60240396%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '67e8cb486041e7a17608acabd05a676d4370bf23' => 
    array (
      0 => 'D:\\wwwroot\\o2o\\htdocs\\themes\\default\\xiche\\order\\goods.html',
      1 => 1448430656,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '230615650371a6dc409-60240396',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_5650371a7bed41_97939332',
  'variables' => 
  array (
    'res' => 0,
    'pager' => 0,
    'product' => 0,
    'v' => 0,
    'cookies' => 0,
    'gid' => 0,
    'addr' => 0,
    'car' => 0,
    'car_id' => 0,
    'MEMBER' => 0,
    'week' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5650371a7bed41_97939332')) {function content_5650371a7bed41_97939332($_smarty_tpl) {?><?php if (!is_callable('smarty_function_link')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\function.link.php';
?><!DOCTYPE HTML>
<html>
    <head>
        <?php echo $_smarty_tpl->getSubTemplate ("xiche/block/sheader.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

    </head>
    <body>

        
<header>
    <i class="left"><a id="icon_goback"  href="<?php echo smarty_function_link(array('ctl'=>'xiche'),$_smarty_tpl);?>
"></a></i>
    <div class="title"><?php echo $_smarty_tpl->tpl_vars['res']->value['title'];?>
</div>
    <i class="right"></i>
</header>


<section id="order_wait" class="page_center_box">
    <div class="box">
    	<div class="cont">
            <div class="img"><img src="<?php echo $_smarty_tpl->tpl_vars['pager']->value['img'];?>
/<?php echo $_smarty_tpl->tpl_vars['res']->value['photo'];?>
"></div>
            <div class="nr">
            	<div class="fl">
                    <h3 class="overflow_clear"><?php echo $_smarty_tpl->tpl_vars['res']->value['title'];?>
</h3>
                    <p><?php echo $_smarty_tpl->tpl_vars['res']->value['content'];?>
</p>
                </div>
                <div class="fr pointcl">￥<b><?php echo $_smarty_tpl->tpl_vars['res']->value['price'];?>
</b></div>
            </div>
        </div>
        
        <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['product']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
        <div class="decide">
        	<div class="fl"><?php echo $_smarty_tpl->tpl_vars['v']->value['title'];?>
 加<span class="graycl"><?php echo $_smarty_tpl->tpl_vars['v']->value['price'];?>
</span>元</div>
                <div class="fr fontcl1" rel="<?php echo $_smarty_tpl->tpl_vars['v']->value['product_id'];?>
"><span class="check product <?php if ($_smarty_tpl->tpl_vars['cookies']->value[$_smarty_tpl->tpl_vars['v']->value['product_id']]==$_smarty_tpl->tpl_vars['v']->value['product_id']){?>on<?php }?>"  rel="<?php echo $_smarty_tpl->tpl_vars['v']->value['product_id'];?>
" val="<?php echo $_smarty_tpl->tpl_vars['v']->value['product_id'];?>
" id="key<?php echo $_smarty_tpl->tpl_vars['v']->value['key'];?>
" key="<?php echo $_smarty_tpl->tpl_vars['v']->value['key'];?>
"></span></div>
        </div>
        <?php } ?>

    </div>
    <ul class="form_list_box" id="door_wash">
        
        <li>
            <a href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/car','gid'=>$_smarty_tpl->tpl_vars['gid']->value,'addr_id'=>$_smarty_tpl->tpl_vars['addr']->value['addr_id']),$_smarty_tpl);?>
"><p class="jump"><em class="ico_2"></em><input type="text" id="car" value="<?php echo $_smarty_tpl->tpl_vars['car']->value['paizhao_sf'];?>
<?php echo $_smarty_tpl->tpl_vars['car']->value['paizhao_hao'];?>
<?php echo $_smarty_tpl->tpl_vars['car']->value['color'];?>
" placeholder="您的车牌号码"></p></a>
        </li>
        <li>
            <a href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/addr','gid'=>$_smarty_tpl->tpl_vars['gid']->value,'car_id'=>$_smarty_tpl->tpl_vars['car_id']->value),$_smarty_tpl);?>
"><p class="jump"><em class="ico_3"></em><input type="text" id="addr" value="<?php echo $_smarty_tpl->tpl_vars['addr']->value['addr'];?>
" placeholder="车辆停放地址"></p></a>
        </li>
        <li>
            <p class="jump"><em class="ico_4"></em><input type="text" placeholder="您希望的服务时间" id="service_time" week='' hour=''></p>
        </li>
        <li class="last">
            <p class="jump" style="background:none;"><em class="ico_1"></em><input type="text" value='<?php echo $_smarty_tpl->tpl_vars['MEMBER']->value['mobile'];?>
' placeholder="请输入手机号码" id="mobile"></p>
        </li>

    </ul>


</section>
        
        
<script>
    require(["zepto", "underscore", "frozen"], function($, _, fz) {
	$(function(){
		$(".decide").click(function(){
                        var v   =   parseInt($(this).find('.graycl').text());
                        var all =   parseInt($('.all_price span').text());
                        if($(this).find(".check").hasClass("on")){
                            $(this).find(".check").removeClass("on");
                            var product_id = $(this).find('.check').attr('rel');
                            setCookie('product'+product_id,null,1);
                            $('.all_price span').text($('.all_price span').text()-v);
			}else{
                            var product_id = $(this).find('.fr').attr('rel');
                            setCookie('product'+product_id,product_id,1);
                            $(this).find(".check").addClass("on");
                            $('.all_price span').text(all+v);
			}
           
		});
	});

	$(function(){
		$(".mask_box .cancel").click(function(){
			$(".mask_box").hide();
		});
	});
	$(function(){
		$(".prompt_mask .cancel").click(function(){
			$(".prompt_mask").hide();
		});
	});
    var week_array = []; 
    <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['week']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>week_array.push({"d":"<?php echo $_smarty_tpl->tpl_vars['v']->value['d'];?>
","w":"<?php echo $_smarty_tpl->tpl_vars['v']->value['w'];?>
"});<?php } ?>

    $('#service_time').click(function(){
        select_time(week_array);
    })
    
    $('.btn').click(function(){
        var value="";
        for(var i=1;i<=$('.product').length;i++){
           if($('#key'+i).hasClass('on')){ //判断复选框是否选中
             value=value+$('#key'+i).attr('val') + ","; //值的拼凑 .. 具体处理看你的需要,
           }
        }
        
        var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/order/handle'),$_smarty_tpl);?>
";
        var mobile = $('#mobile').val();
        var car = $('#car').val();
        var addr = $('#addr').val();
        var hour = $('#service_time').attr('hour');
        var week = $('#service_time').attr('week');

        var gid = '<?php echo $_smarty_tpl->tpl_vars['gid']->value;?>
';
        if(value != ''){
            var product = value;
        }else{
            var product = 0;
        }
        
        $.post(link,{mobile:mobile,car:car,addr:addr,hour:hour,week:week,gid:gid,value:value,product:product},function(ret){
               if(ret.error){
                   $.tips({content:ret.message});
               }else{
                   $.tips({content:ret.message});
                   setTimeout(function(){
                       window.location.href='detail?order_id='+ret.oid;
                   },2000)
               }
        },'json');
        
        
    })
        
});
</script>



<footer>
    <div class="door_wash_foot">
    	<div class="fl" style="height:42px;line-height:42px;">
            合计：<span class="pointcl all_price">￥<span><?php echo $_smarty_tpl->tpl_vars['res']->value['price'];?>
</span></span>
            <!--p class="graycl overflow_clear">原价35元，冬季特惠立减10元</p-->
        </div>
        <div class="fr">
        	<a href="#" class="btn">立即下单</a>
        </div>
        <div class="clear"></div>
    </div>
</footer>

    </body>
</html><?php }} ?>