<?php /* Smarty version Smarty-3.1.8, created on 2015-11-24 13:42:51
         compiled from "D:\wwwroot\o2o\htdocs\themes\default\xiche\comment\add.html" */ ?>
<?php /*%%SmartyHeaderCode:266035653f8db2d2797-43151947%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'd4189bf6c6f1d2b1e3203100a6f93895fb1a7461' => 
    array (
      0 => 'D:\\wwwroot\\o2o\\htdocs\\themes\\default\\xiche\\comment\\add.html',
      1 => 1447920235,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '266035653f8db2d2797-43151947',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'order_id' => 0,
    'staff' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_5653f8db435f69_69174296',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5653f8db435f69_69174296')) {function content_5653f8db435f69_69174296($_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'=>'mobile/order:detail','oid'=>$_smarty_tpl->tpl_vars['order_id']->value),$_smarty_tpl);?>
"></a></i>
    <div class="title">评价师傅</div>
    <i class="right"></i>
</header>
<section class="page_center_box">
    <div class="evaluate_form">
    	<p class="starLevel fontcl" style="border-bottom:none;">当前评价师傅——<span class="fontcl"><?php echo $_smarty_tpl->tpl_vars['staff']->value['name'];?>
</span></p>
        <p class="starLevel fontcl">星级：
            <span class="heart_box">
                <span class="heart_clink"><a href="javascript:void(0);" val="1" style="padding:0;margin:0;"></a><a href="javascript:void(0);" val="2" style="padding:0;margin:0;"></a><a href="javascript:void(0);" val="3" style="padding:0;margin:0;"></a><a href="javascript:void(0);" val="4" style="padding:0;margin:0;"></a><a href="javascript:void(0);" val="5" style="padding:0;margin:0;"></a>
                </span>
                <span class="heart heart30" id="hearts"></span>
             </span>
        </p>
        <div class="form_box">
            <form>
                <input name="star" value="3" id="star" type="hidden">
                <textarea placeholder="说点您对该阿姨服务的印象吧！" name="text" id="text"></textarea>
            </form>
        </div>
    </div>
</section>
<footer>
	<div class="btn_long_box"><input class="btn_long" type="button" value="提 交"></div>
</footer>

<script type="text/javascript">
require(["zepto", "underscore", "frozen"], function($, _, fz) {
        
        $('.heart_clink a').click(function(){
            var val = $(this).attr('val');
            $('#star').val(val);
            $('#hearts').attr('class','');
            $('#hearts').addClass('heart');
            $('#hearts').addClass('heart'+val*10);
        })
        
         $(".btn_long").click(function () {
                    
                    var text = $('#text').val();
                    var star = $('#star').val();
                    var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/comment:handle'),$_smarty_tpl);?>
";
                    var staff_id = "<?php echo $_smarty_tpl->tpl_vars['staff']->value['staff_id'];?>
";
                    var order_id = '<?php echo $_smarty_tpl->tpl_vars['order_id']->value;?>
';
                     $.post(link,{text:text,star:star,staff_id:staff_id,order_id:order_id},function(ret){
                        if(ret.error){
                                if(ret.login == 0){
                                    
                                       $.tips({content:'请先登录!'});

                                        var dia = $.dialog({
                                           title: '温馨提示',
                                           content: '您还没有登录？登录后即可评价！',
                                           button: ["去登录", "取消"],
                                       });

                                       var login = "<?php echo smarty_function_link(array('ctl'=>'xiche/passport:login'),$_smarty_tpl);?>
";

                                       dia.on("dialog:action", function (e) {
                                           if (e.index == 0) {
                                               window.location.href=login;
                                           }
                                       });
                                    
                                    
                                }else{
                                    
                                    $.tips({content:ret.message});
                                    
                                }
                               
                           }else{
                               $.tips({content:ret.message});
                               
                               setTimeout(function(){
                                    window.location.href='<?php echo smarty_function_link(array('ctl'=>"xiche/order/detail",'order_id'=>$_smarty_tpl->tpl_vars['order_id']->value),$_smarty_tpl);?>
';
                               },2000)
                           }
                       },'json');

        });        
        
        
});
</script>
</body>
</html><?php }} ?>