<?php /* Smarty version Smarty-3.1.8, created on 2015-11-24 14:47:10
         compiled from "D:\wwwroot\o2o\htdocs\themes\default\xiche\mcenter\order\detail.html" */ ?>
<?php /*%%SmartyHeaderCode:27129565407ee503eb1-73390809%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '7d2792901b5f58fc31023856b539d75e5ee5421e' => 
    array (
      0 => 'D:\\wwwroot\\o2o\\htdocs\\themes\\default\\xiche\\mcenter\\order\\detail.html',
      1 => 1448087375,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '27129565407ee503eb1-73390809',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'order_count' => 0,
    'order' => 0,
    'goods' => 0,
    'other' => 0,
    'v' => 0,
    'photo' => 0,
    'pager' => 0,
    'comment' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_565407ee5d6de3_21951405',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_565407ee5d6de3_21951405')) {function content_565407ee5d6de3_21951405($_smarty_tpl) {?><?php if (!is_callable('smarty_function_link')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\function.link.php';
if (!is_callable('smarty_modifier_format')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\modifier.format.php';
?><?php $_smarty_tpl->tpl_vars['tpl_title'] = new Smarty_variable('生活宝易车洗', null, 0);?>
<!DOCTYPE HTML>
<html>
<head>
<?php echo $_smarty_tpl->getSubTemplate ("xiche/mcenter/block/mheader.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

</head>

<body>
    
    <script type="text/javascript">
    require(["zepto", "underscore", "frozen"], function($, _, fz) {
        $('#upload1').click(function(){
            $('#car_photo1').click();
        })
        $('#upload2').click(function(){
            $('#car_photo2').click();
        })
        
        
        $('#img1').click(function(){
          $('#upload1').click();  
        })
        $('#img2').click(function(){
          $('#upload2').click();  
        })
    });
    
    function fileSelected(obj,type){
        
            var files = obj.files;
            for(var i=0;i<files.length;i++){
                var tag = '';
                var rFilter = /^(image\/gif|image\/jpeg|image\/jpg|image\/png)$/i;
            if (! rFilter.test(files[i].type)) {                   
                alert("只允许上传JPG、PNG、GIF格式图片");
                return false;
            }
            var reader = new FileReader();
            reader.onloadstart = function(e){
                    $(".loading").show();
            }
            reader.onload = function(e){
                if(type == 1){
                  $("#img1").attr("src",e.target.result);
                  $('#btn1').show();
                }else if(type ==2){
                  $("#img2").attr("src",e.target.result);
                  $('#btn2').show();
                }
            }
            reader.readAsDataURL(files[i]);
        }
    } 
    </script>
    
    
<header>                                             
	<i class="left"><a id="icon_goback" href="<?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/order/rob'),$_smarty_tpl);?>
"></a></i>
    <div class="title">订单详情</div>
    <i class="right"></i>
</header>

<section id="order_detail" class="page_center_box">
    <div class="cont_box">
    	<div class="cont">
            <div class="title">
                订单详情
            </div>
            <div class="nr">
                <p><span class="graycl">下单次数：</span>第<?php echo $_smarty_tpl->tpl_vars['order_count']->value;?>
次下单</p>
                <p><span class="graycl">车辆位置：</span><?php echo $_smarty_tpl->tpl_vars['order']->value['addr'];?>
<a href="<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['order']->value['order_id'];?>
<?php $_tmp1=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['order']->value['lat'];?>
<?php $_tmp2=ob_get_clean();?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['order']->value['lng'];?>
<?php $_tmp3=ob_get_clean();?><?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/map','order_id'=>$_tmp1,'lat'=>$_tmp2,'lng'=>$_tmp3),$_smarty_tpl);?>
" class="fontcl1 see_map fr"><em></em>查看位置</a></p>
                <p class="last"><span class="graycl">洗车时间：</span><?php echo smarty_modifier_format($_smarty_tpl->tpl_vars['order']->value['fuwu_time']);?>
</p>
                <p><span class="graycl">车辆详情：</span><?php echo $_smarty_tpl->tpl_vars['order']->value['car'];?>
</p>
                <p><span class="graycl">联系电话：</span><?php echo $_smarty_tpl->tpl_vars['order']->value['mobile'];?>
</p>
                <p><span class="graycl">服务项目：</span><span style="color:red;"><?php echo $_smarty_tpl->tpl_vars['goods']->value[$_smarty_tpl->tpl_vars['order']->value['goods_id']]['title'];?>
</span><?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['other']->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;
?>+<?php echo $_smarty_tpl->tpl_vars['v']->value['product_name'];?>
<?php } ?></p>
                <p><span class="graycl">订单价格：</span>￥<b><?php echo $_smarty_tpl->tpl_vars['order']->value['price'];?>
</b></p>
            </div>
        </div>
        <div class="cont">
            <div class="title">
                订单状态
                <?php if ($_smarty_tpl->tpl_vars['order']->value['order_status']==2){?>
                <span class="fr pointcl">未被抢
                    <a id="qiang" rel="<?php echo $_smarty_tpl->tpl_vars['order']->value['order_id'];?>
" href="javascript:void(0);" class="btn">立即抢单</a>
                </span>
                <?php }?>
                <?php if ($_smarty_tpl->tpl_vars['order']->value['order_status']==3){?>
                <span class="fr pointcl">正在洗车<a id="end" rel="<?php echo $_smarty_tpl->tpl_vars['order']->value['order_id'];?>
" href="javascript:void(0);" class="btn bg_1">完成洗车</a></span>
                <?php }?>
                <?php if ($_smarty_tpl->tpl_vars['order']->value['order_status']==4){?>
                <span class="fr pointcl">已完成</span>
                <?php }?>
            </div>
            <?php if ($_smarty_tpl->tpl_vars['order']->value['order_status']>=2){?> 
            <ul class="state_list">
                <li>
                	<div class="bt">
                        <div class="clear"></div>
                    </div>
                </li>
                <form action="<?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/order/upload_photo','order_id'=>$_smarty_tpl->tpl_vars['order']->value['order_id']),$_smarty_tpl);?>
" mini-form="car-form" id="sbtfrm" method="post" ENCTYPE="multipart/form-data">
                <li>
                	<div class="bt">
                        <div class="fl">车辆初始照片</div>
                        <?php if (!$_smarty_tpl->tpl_vars['photo']->value['before']){?>
                        <div class="fr">
                        	<a class="fontcl1 upload" id="upload1">
                                    <em></em>上传
                                </a>
                            <input type="file" name="car_photo1" id="car_photo1" onchange="fileSelected(this,1)" id="fileField" value="上传" style="height:100%;width:100%;opacity:0;filter:alpha(opacity=0);display:none;"  />
                                
                        </div>
                        <?php }?>
                        <div class="clear"></div>
                    </div>
                    
                    <?php if ($_smarty_tpl->tpl_vars['photo']->value['before']){?>
                    <div class="nr">
                        <img src="<?php echo $_smarty_tpl->tpl_vars['pager']->value['img'];?>
/<?php echo $_smarty_tpl->tpl_vars['photo']->value['before'];?>
" id="img1" style="width:100%;">
                    </div>
                    <?php }else{ ?>
                    <div class="nr">
                        <img src="/themes/default/xiche/static/images/add.png" id="img1" style="width:100%;">
                    </div>
                    <input type="submit" value="保存" class="btn" id="btn1" style="display:none;">
                    <?php }?>
                    
                </li>
                </form>
           
                <form action="<?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/order/upload_photo','order_id'=>$_smarty_tpl->tpl_vars['order']->value['order_id']),$_smarty_tpl);?>
" mini-form="car-form" id="sbtfrm" method="post" ENCTYPE="multipart/form-data">
                <li>
                	<div class="bt">
                        <div class="fl">清洗完毕照片</div>
                        <?php if (!$_smarty_tpl->tpl_vars['photo']->value['after']){?>
                        <div class="fr">
                        	<a class="fontcl1 upload" id="upload2"><em></em>上传</a>
                                <input type="file" name="car_photo2" id="car_photo2" onchange="fileSelected(this,2)" id="fileField" value="上传" style="height:100%;width:100%;opacity:0;filter:alpha(opacity=0);display:none;"  />
                                
                        </div>
                        <?php }?>
                        <div class="clear"></div>
                    </div>

                    
                    <?php if ($_smarty_tpl->tpl_vars['photo']->value['after']){?>
                    <div class="nr">
                        <img src="<?php echo $_smarty_tpl->tpl_vars['pager']->value['img'];?>
/<?php echo $_smarty_tpl->tpl_vars['photo']->value['after'];?>
" id="img2" style="width:100%;">
                    </div>
                    <?php }else{ ?>
                    <div class="nr">
                        <img src="/themes/default/xiche/static/images/add.png" id="img2" style="width:100%;"> 
                    </div>
                     <input type="submit" value="保存" class="btn" id="btn2" style="display:none;">
                    <?php }?>
                    
                    
                </li>
                </form>
            </ul>
            <?php }?>
        </div>
        
        
        
        <div class="cont">
            <div class="title">
                用户评价
            </div>
            <ul class="state_list">
                <?php if ($_smarty_tpl->tpl_vars['comment']->value){?>
                    <?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['comment']->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;
?>
                    <li><?php echo $_smarty_tpl->tpl_vars['v']->value['text'];?>
</li>
                    <?php } ?>
                    <?php }else{ ?>
                    <li>暂时没有用户评价</li>
                <?php }?>
            </ul>
        </div>
        
        
    </div>
</section>
</body>
</html>
<script type="text/javascript">
require(["zepto", "underscore", "frozen"], function ($, _, fz) {
    
    $("#qiang").click(function () {
        var dia = $.dialog({
            title: '温馨提示',
            content: '您确定要抢单吗？抢单后请在规定的时间内完成！',
            button: ["确认", "取消"],
        });
        var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/order/qiang'),$_smarty_tpl);?>
";
        var order_id = $(this).attr('rel');

        if(order_id == null) {
            alert('订单号不存在');
            return false;
        }
        dia.on("dialog:action", function (e) {
            if (e.index == 0) {
                $.post(link, {order_id: order_id}, function (ret) {
                    if (ret.error) {
                        $.tips({content: ret.message, stayTime: 2000});
                    } else {
                        $.tips({content: ret.message, stayTime: 2000});
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000)
                    }
                }, 'json');
            }
        });
    });
    
    
    
    $("#end").click(function () {
        var dia = $.dialog({
            title: '温馨提示',
            content: '您确定要完成吗？',
            button: ["确认", "取消"],
        });
        var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/mcenter/order/end'),$_smarty_tpl);?>
";
        var order_id = $(this).attr('rel');

        if(order_id == null) {
            alert('订单号不存在');
            return false;
        }
        dia.on("dialog:action", function (e) {
            if (e.index == 0) {
                $.post(link, {order_id: order_id}, function (ret) {
                    if (ret.error) {
                        $.tips({content: ret.message, stayTime: 2000});
                    } else {
                        $.tips({content: ret.message, stayTime: 2000});
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000)
                    }
                }, 'json');
            }
        });
    });
    
    
});
</script><?php }} ?>